Package org.apache.batik.anim.dom
Class XBLEventSupport
- java.lang.Object
-
- org.apache.batik.dom.events.EventSupport
-
- org.apache.batik.anim.dom.XBLEventSupport
-
public class XBLEventSupport extends EventSupport
An EventSupport class that handles XBL-specific event processing.- Version:
- $Id: XBLEventSupport.java 1851346 2019-01-15 13:41:00Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.HashMap<java.lang.String,EventListenerList>bubblingImplementationListenersThe unstoppable bubbling listeners table.protected java.util.HashMap<java.lang.String,EventListenerList>capturingImplementationListenersThe unstoppable capturing listeners table.protected static java.util.HashMap<java.lang.String,java.lang.String>eventTypeAliasesMap of event types to their aliases.-
Fields inherited from class org.apache.batik.dom.events.EventSupport
bubblingListeners, capturingListeners, node
-
-
Constructor Summary
Constructors Constructor Description XBLEventSupport(AbstractNode n)Creates a new XBLEventSupport object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventListenerNS(java.lang.String namespaceURI, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture, java.lang.Object group)Registers an event listener for the given namespaced event type in the specified group.voidaddImplementationEventListenerNS(java.lang.String namespaceURI, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture)Registers an event listener that will not be stopped by the usual XBL stopping.booleandispatchEvent(NodeEventTarget target, org.w3c.dom.events.Event evt)This method allows the dispatch of events into the implementations event model.protected voidfireHandlerGroupEventListeners(NodeEventTarget node, AbstractEvent e, boolean useCapture, java.util.HashSet stoppedGroups, java.util.HashSet toBeStoppedGroups)Fires the event handlers registered on an XBL 'handlerGroup' element.protected voidfireImplementationEventListeners(NodeEventTarget node, AbstractEvent e, boolean useCapture)Fires the registered implementation listeners on the given event target.EventListenerListgetImplementationEventListeners(java.lang.String type, boolean useCapture)Returns the implementation listneers.protected AbstractEvent[]getRetargettedEvents(NodeEventTarget target, NodeEventTarget[] ancestors, AbstractEvent e)Returns an array of Event objects to be used for each event target in the event flow.protected booleanisSingleScopeEvent(org.w3c.dom.events.Event evt)Returns whether the given event should be stopped once it crosses a shadow scope boundary.voidmoveEventListeners(EventSupport other)Moves all of the event listeners from this EventSupport object to the given EventSupport object.voidremoveEventListenerNS(java.lang.String namespaceURI, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture)Deregisters an event listener.voidremoveImplementationEventListenerNS(java.lang.String namespaceURI, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture)Unregisters an implementation event listener.protected AbstractEventretargetEvent(AbstractEvent e, NodeEventTarget target)Clones and retargets the given event.-
Methods inherited from class org.apache.batik.dom.events.EventSupport
addEventListener, createEventException, fireEventListeners, fireEventListeners, getAncestors, getEventListeners, getUltimateOriginalEvent, hasEventListenerNS, preventDefault, removeEventListener, runDefaultActions, setCurrentTarget, setEventPhase, setTarget, stopImmediatePropagation, stopPropagation
-
-
-
-
Field Detail
-
capturingImplementationListeners
protected java.util.HashMap<java.lang.String,EventListenerList> capturingImplementationListeners
The unstoppable capturing listeners table.
-
bubblingImplementationListeners
protected java.util.HashMap<java.lang.String,EventListenerList> bubblingImplementationListeners
The unstoppable bubbling listeners table.
-
eventTypeAliases
protected static java.util.HashMap<java.lang.String,java.lang.String> eventTypeAliases
Map of event types to their aliases.
-
-
Constructor Detail
-
XBLEventSupport
public XBLEventSupport(AbstractNode n)
Creates a new XBLEventSupport object.
-
-
Method Detail
-
addEventListenerNS
public void addEventListenerNS(java.lang.String namespaceURI, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture, java.lang.Object group)Registers an event listener for the given namespaced event type in the specified group.- Overrides:
addEventListenerNSin classEventSupport
-
removeEventListenerNS
public void removeEventListenerNS(java.lang.String namespaceURI, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture)Deregisters an event listener.- Overrides:
removeEventListenerNSin classEventSupport
-
addImplementationEventListenerNS
public void addImplementationEventListenerNS(java.lang.String namespaceURI, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture)Registers an event listener that will not be stopped by the usual XBL stopping.
-
removeImplementationEventListenerNS
public void removeImplementationEventListenerNS(java.lang.String namespaceURI, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture)Unregisters an implementation event listener.
-
moveEventListeners
public void moveEventListeners(EventSupport other)
Moves all of the event listeners from this EventSupport object to the given EventSupport object. Used byAbstractDocument.renameNode(Node,String,String).- Overrides:
moveEventListenersin classEventSupport
-
dispatchEvent
public boolean dispatchEvent(NodeEventTarget target, org.w3c.dom.events.Event evt) throws org.w3c.dom.events.EventException
This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is theEventTargeton whichdispatchEventis called.- Overrides:
dispatchEventin classEventSupport- Parameters:
target- the target nodeevt- Specifies the event type, behavior, and contextual information to be used in processing the event.- Returns:
- The return value of
dispatchEventindicates whether any of the listeners which handled the event calledpreventDefault. IfpreventDefaultwas called the value is false, else the value is true. - Throws:
org.w3c.dom.events.EventException- UNSPECIFIED_EVENT_TYPE_ERR: Raised if theEvent's type was not specified by initializing the event beforedispatchEventwas called. Specification of theEvent's type asnullor an empty string will also trigger this exception.
-
fireHandlerGroupEventListeners
protected void fireHandlerGroupEventListeners(NodeEventTarget node, AbstractEvent e, boolean useCapture, java.util.HashSet stoppedGroups, java.util.HashSet toBeStoppedGroups)
Fires the event handlers registered on an XBL 'handlerGroup' element.
-
isSingleScopeEvent
protected boolean isSingleScopeEvent(org.w3c.dom.events.Event evt)
Returns whether the given event should be stopped once it crosses a shadow scope boundary.
-
getRetargettedEvents
protected AbstractEvent[] getRetargettedEvents(NodeEventTarget target, NodeEventTarget[] ancestors, AbstractEvent e)
Returns an array of Event objects to be used for each event target in the event flow. The Event objects are retargetted if an sXBL shadow scope is crossed and the event is not a DOM mutation event.
-
retargetEvent
protected AbstractEvent retargetEvent(AbstractEvent e, NodeEventTarget target)
Clones and retargets the given event.
-
getImplementationEventListeners
public EventListenerList getImplementationEventListeners(java.lang.String type, boolean useCapture)
Returns the implementation listneers.
-
fireImplementationEventListeners
protected void fireImplementationEventListeners(NodeEventTarget node, AbstractEvent e, boolean useCapture)
Fires the registered implementation listeners on the given event target.
-
-