addEventListenerNS(null, type, listener, useCapture, null);
/** * Handles the event. */ public void handleEvent(Event evt) { listener.handleEvent(EventSupport.getUltimateOriginalEvent(evt)); }
/** * Moves all of the event listeners from this EventSupport object * to the given EventSupport object. * Used by {@link * org.apache.batik.dom.AbstractDocument#renameNode(Node,String,String)}. */ public void moveEventListeners(EventSupport other) { super.moveEventListeners(other); XBLEventSupport es = (XBLEventSupport) other; es.capturingImplementationListeners = capturingImplementationListeners; es.bubblingImplementationListeners = bubblingImplementationListeners; capturingImplementationListeners = null; bubblingImplementationListeners = null; }
throw createEventException(DOMException.NOT_SUPPORTED_ERR, "unsupported.event", new Object[] { }); String type = e.getType(); if (type == null || type.length() == 0) { throw createEventException (EventException.UNSPECIFIED_EVENT_TYPE_ERR, "unspecified.event", NodeEventTarget[] ancestors = getAncestors(target); for (NodeEventTarget node : ancestors) { e.setCurrentTarget(node); fireEventListeners(node, e, true, stoppedGroups, toBeStoppedGroups); stoppedGroups.addAll(toBeStoppedGroups); fireEventListeners(target, e, false, stoppedGroups, toBeStoppedGroups); stoppedGroups.addAll(toBeStoppedGroups); NodeEventTarget node = ancestors[i]; e.setCurrentTarget(node); fireEventListeners(node, e, false, stoppedGroups, toBeStoppedGroups); stoppedGroups.addAll(toBeStoppedGroups); runDefaultActions(e);
removeEventListenerNS(null, type, listener, useCapture);
/** * Fires the registered listeners on the given event target. */ protected void fireEventListeners(NodeEventTarget node, AbstractEvent e, boolean useCapture, HashSet stoppedGroups, HashSet toBeStoppedGroups) { String type = e.getType(); EventSupport support = node.getEventSupport(); // check if the event support has been instantiated if (support == null) { return; } EventListenerList list = support.getEventListeners(type, useCapture); // check if the event listeners list is not empty if (list == null) { return; } // dump event listeners, we get the registered listeners NOW EventListenerList.Entry[] listeners = list.getEventListeners(); fireEventListeners(node, e, listeners, stoppedGroups, toBeStoppedGroups); }
continue; EventListenerList list = support.getEventListeners(type, useCapture);
/** * <b>DOM</b>: Implements * {@link org.w3c.dom.events.EventTarget#dispatchEvent(Event)}. */ public boolean dispatchEvent(Event evt) throws EventException { if (eventSupport == null) { initializeEventSupport(); } return eventSupport.dispatchEvent(this, evt); }
/** * Creates an EventSupport object for a given node. */ public EventSupport createEventSupport(AbstractNode n) { return new EventSupport(n); }
/** * <b>DOM</b>: Implements * {@link * org.w3c.dom.events.EventTarget#addEventListener(String,EventListener,boolean)}. */ public void addEventListener(String type, EventListener listener, boolean useCapture) { if (eventSupport == null) { initializeEventSupport(); } eventSupport.addEventListener(type, listener, useCapture); }
throw createEventException(DOMException.NOT_SUPPORTED_ERR, "unsupported.event", new Object[] { }); String type = e.getType(); if (type == null || type.length() == 0) { throw createEventException (EventException.UNSPECIFIED_EVENT_TYPE_ERR, "unspecified.event", NodeEventTarget[] ancestors = getAncestors(target); for (NodeEventTarget node : ancestors) { e.setCurrentTarget(node); fireEventListeners(node, e, true, stoppedGroups, toBeStoppedGroups); stoppedGroups.addAll(toBeStoppedGroups); fireEventListeners(target, e, false, stoppedGroups, toBeStoppedGroups); stoppedGroups.addAll(toBeStoppedGroups); NodeEventTarget node = ancestors[i]; e.setCurrentTarget(node); fireEventListeners(node, e, false, stoppedGroups, toBeStoppedGroups); stoppedGroups.addAll(toBeStoppedGroups); runDefaultActions(e);
removeEventListenerNS(null, type, listener, useCapture);
/** * Fires the registered listeners on the given event target. */ protected void fireEventListeners(NodeEventTarget node, AbstractEvent e, boolean useCapture, HashSet stoppedGroups, HashSet toBeStoppedGroups) { String type = e.getType(); EventSupport support = node.getEventSupport(); // check if the event support has been instantiated if (support == null) { return; } EventListenerList list = support.getEventListeners(type, useCapture); // check if the event listeners list is not empty if (list == null) { return; } // dump event listeners, we get the registered listeners NOW EventListenerList.Entry[] listeners = list.getEventListeners(); fireEventListeners(node, e, listeners, stoppedGroups, toBeStoppedGroups); }
continue; EventListenerList list = support.getEventListeners(type, useCapture);
/** * <b>DOM</b>: Implements * {@link org.w3c.dom.events.EventTarget#dispatchEvent(Event)}. */ public boolean dispatchEvent(Event evt) throws EventException { if (eventSupport == null) { initializeEventSupport(); } return eventSupport.dispatchEvent(this, evt); }
/** * Creates an EventSupport object for a given node. */ public EventSupport createEventSupport(AbstractNode n) { return new EventSupport(n); }
/** * <b>DOM</b>: Implements * {@link * org.w3c.dom.events.EventTarget#addEventListener(String,EventListener,boolean)}. */ public void addEventListener(String type, EventListener listener, boolean useCapture) { if (eventSupport == null) { initializeEventSupport(); } eventSupport.addEventListener(type, listener, useCapture); }
/** * Handles the event. */ public void handleEvent(Event evt) { listener.handleEvent(EventSupport.getUltimateOriginalEvent(evt)); }
throw createEventException(DOMException.NOT_SUPPORTED_ERR, "unsupported.event", new Object[] { }); String type = e.getType(); if (type == null || type.length() == 0) { throw createEventException (EventException.UNSPECIFIED_EVENT_TYPE_ERR, "unspecified.event", NodeEventTarget[] ancestors = getAncestors(target); NodeEventTarget node = ancestors[i]; e.setCurrentTarget(node); fireEventListeners(node, e, true, stoppedGroups, toBeStoppedGroups); stoppedGroups.addAll(toBeStoppedGroups); fireEventListeners(target, e, false, stoppedGroups, toBeStoppedGroups); stoppedGroups.addAll(toBeStoppedGroups); NodeEventTarget node = ancestors[i]; e.setCurrentTarget(node); fireEventListeners(node, e, false, stoppedGroups, toBeStoppedGroups); stoppedGroups.addAll(toBeStoppedGroups); runDefaultActions(e);
removeEventListenerNS(null, type, listener, useCapture);