org.apache.batik.dom.svg12

Class XBLEventSupport

public class XBLEventSupport extends EventSupport

An EventSupport class that handles XBL-specific event processing.
Field Summary
protected HashTablebubblingImplementationListeners
The unstoppable bubbling listeners table.
protected HashTablecapturingImplementationListeners
The unstoppable capturing listeners table.
protected static HashTableeventTypeAliases
Map of event types to their aliases.
Constructor Summary
XBLEventSupport(AbstractNode n)
Creates a new XBLEventSupport object.
Method Summary
voidaddEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture, Object group)
Registers an event listener for the given namespaced event type in the specified group.
voidaddImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture)
Registers an event listener that will not be stopped by the usual XBL stopping.
booleandispatchEvent(NodeEventTarget target, Event evt)
This method allows the dispatch of events into the implementations event model.
protected voidfireHandlerGroupEventListeners(NodeEventTarget node, AbstractEvent e, boolean useCapture, HashSet stoppedGroups, 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(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(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(String namespaceURI, String type, EventListener listener, boolean useCapture)
Deregisters an event listener.
voidremoveImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture)
Unregisters an implementation event listener.
protected AbstractEventretargetEvent(AbstractEvent e, NodeEventTarget target)
Clones and retargets the given event.

Field Detail

bubblingImplementationListeners

protected HashTable bubblingImplementationListeners
The unstoppable bubbling listeners table.

capturingImplementationListeners

protected HashTable capturingImplementationListeners
The unstoppable capturing listeners table.

eventTypeAliases

protected static HashTable 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(String namespaceURI, String type, EventListener listener, boolean useCapture, Object group)
Registers an event listener for the given namespaced event type in the specified group.

addImplementationEventListenerNS

public void addImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture)
Registers an event listener that will not be stopped by the usual XBL stopping.

dispatchEvent

public boolean dispatchEvent(NodeEventTarget target, Event evt)
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 the EventTarget on which dispatchEvent is called.

Parameters: target the target node evt Specifies the event type, behavior, and contextual information to be used in processing the event.

Returns: The return value of dispatchEvent indicates whether any of the listeners which handled the event called preventDefault. If preventDefault was called the value is false, else the value is true.

Throws: EventException UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as null or an empty string will also trigger this exception.

fireHandlerGroupEventListeners

protected void fireHandlerGroupEventListeners(NodeEventTarget node, AbstractEvent e, boolean useCapture, HashSet stoppedGroups, HashSet toBeStoppedGroups)
Fires the event handlers registered on an XBL 'handlerGroup' element.

fireImplementationEventListeners

protected void fireImplementationEventListeners(NodeEventTarget node, AbstractEvent e, boolean useCapture)
Fires the registered implementation listeners on the given event target.

getImplementationEventListeners

public EventListenerList getImplementationEventListeners(String type, boolean useCapture)
Returns the implementation listneers.

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.

isSingleScopeEvent

protected boolean isSingleScopeEvent(Event evt)
Returns whether the given event should be stopped once it crosses a shadow scope boundary.

moveEventListeners

public void moveEventListeners(EventSupport other)
Moves all of the event listeners from this EventSupport object to the given EventSupport object. Used by renameNode.

removeEventListenerNS

public void removeEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture)
Deregisters an event listener.

removeImplementationEventListenerNS

public void removeImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture)
Unregisters an implementation event listener.

retargetEvent

protected AbstractEvent retargetEvent(AbstractEvent e, NodeEventTarget target)
Clones and retargets the given event.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.