Package org.apache.batik.gvt.event
Interface EventDispatcher
- All Known Implementing Classes:
AWTEventDispatcher
public interface EventDispatcher
Interface for receiving and dispatching events down to a GVT tree.
Mouse events are dispatched to their "containing" node (the GraphicsNode corresponding to the mouse event coordinate). Searches for containment are performed from the EventDispatcher's "root" node.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified 'global' GraphicsNodeKeyListener which is notified of all KeyEvents dispatched.void
Adds the specified 'global' GraphicsNodeMouseListener which is notified of all MouseEvents dispatched.void
Adds the specified 'global' GraphicsNodeMouseWheelListener which is notified of all MouseWheelEvents dispatched.void
Dispatched the specified event object.Returns the base transform applied to MouseEvent coordinates prior to dispatch.getListeners
(Class listenerType) Returns an array of listeners that were added to this event dispatcher and of the specified type.Returns the root node for MouseEvent dispatch containment searches and field selections.void
Removes the specified 'global' GraphicsNodeKeyListener which is notified of all KeyEvents dispatched.void
Removes the specified 'global' GraphicsNodeMouseListener which is notified of all MouseEvents dispatched.void
Removes the specified 'global' GraphicsNodeMouseWheelListener which is notified of all MouseWheelEvents dispatched.void
Sets the base transform applied to MouseEvent coordinates prior to dispatch.void
Associates all InputEvents of typee.getID()
with "decrementing" of the currently selected GraphicsNode.void
Associates all InputEvents of typee.getID()
with "incrementing" of the currently selected GraphicsNode.void
setRootNode
(GraphicsNode root) Sets the root node for MouseEvent dispatch containment searches and field selections.
-
Method Details
-
setRootNode
Sets the root node for MouseEvent dispatch containment searches and field selections.- Parameters:
root
- the root node
-
getRootNode
GraphicsNode getRootNode()Returns the root node for MouseEvent dispatch containment searches and field selections. -
setBaseTransform
Sets the base transform applied to MouseEvent coordinates prior to dispatch.- Parameters:
t
- the affine transform
-
getBaseTransform
AffineTransform getBaseTransform()Returns the base transform applied to MouseEvent coordinates prior to dispatch. -
dispatchEvent
Dispatched the specified event object.Converts the EventObject to a corresponding GraphicsNodeEvent and dispatch it to the appropriate GraphicsNode(s). If the event is a MouseEvent the dispatch is performed to each GraphicsNode which contains the MouseEvent coordinate, until the event is consumed. If the event is a KeyEvent, it is dispatched to the currently selected GraphicsNode.
- Parameters:
e
- the event to dispatch
-
addGraphicsNodeMouseListener
Adds the specified 'global' GraphicsNodeMouseListener which is notified of all MouseEvents dispatched.- Parameters:
l
- the listener to add
-
removeGraphicsNodeMouseListener
Removes the specified 'global' GraphicsNodeMouseListener which is notified of all MouseEvents dispatched.- Parameters:
l
- the listener to remove
-
addGraphicsNodeMouseWheelListener
Adds the specified 'global' GraphicsNodeMouseWheelListener which is notified of all MouseWheelEvents dispatched.- Parameters:
l
- the listener to add
-
removeGraphicsNodeMouseWheelListener
Removes the specified 'global' GraphicsNodeMouseWheelListener which is notified of all MouseWheelEvents dispatched.- Parameters:
l
- the listener to remove
-
addGraphicsNodeKeyListener
Adds the specified 'global' GraphicsNodeKeyListener which is notified of all KeyEvents dispatched.- Parameters:
l
- the listener to add
-
removeGraphicsNodeKeyListener
Removes the specified 'global' GraphicsNodeKeyListener which is notified of all KeyEvents dispatched.- Parameters:
l
- the listener to remove
-
getListeners
Returns an array of listeners that were added to this event dispatcher and of the specified type.- Parameters:
listenerType
- the type of the listeners to return
-
setNodeIncrementEvent
Associates all InputEvents of typee.getID()
with "incrementing" of the currently selected GraphicsNode. -
setNodeDecrementEvent
Associates all InputEvents of typee.getID()
with "decrementing" of the currently selected GraphicsNode. The notion of "currently selected" GraphicsNode is used for dispatching KeyEvents.
-