|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.gvt.event.AWTEventDispatcher
An EventDispatcher implementation based on AWT events.
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.
Field Summary | |
protected java.awt.geom.AffineTransform |
baseTransform
The base AffineTransform for InputEvent-to-GraphicsNodeEvent coordinates as determined by setBaseTransform(). |
protected GraphicsNode |
currentKeyEventTarget
The current GraphicsNode targeted by an key events. |
protected GraphicsNode |
dummyNode
A dummy graphics node to dispacth "deselect" mouse events to. |
protected javax.swing.event.EventListenerList |
glisteners
The global listener list. |
protected GraphicsNode |
lastHit
The lastest node which has been targeted by an event. |
protected GraphicsNode |
root
The root GraphicsNode as determined by setRootNode(). |
Constructor Summary | |
AWTEventDispatcher()
Constructs a new event dispatcher. |
Method Summary | |
void |
addGraphicsNodeKeyListener(GraphicsNodeKeyListener l)
Adds the specified 'global' GraphicsNodeKeyListener which is notified of all KeyEvents dispatched. |
void |
addGraphicsNodeMouseListener(GraphicsNodeMouseListener l)
Adds the specified 'global' GraphicsNodeMouseListener which is notified of all MouseEvents dispatched. |
void |
dispatchEvent(java.util.EventObject evt)
Dispatches the specified AWT event. |
protected void |
dispatchKeyEvent(java.awt.event.KeyEvent evt)
Dispatches the specified AWT key event. |
protected void |
dispatchMouseEvent(java.awt.event.MouseEvent evt)
Dispatches the specified AWT mouse event. |
java.awt.geom.AffineTransform |
getBaseTransform()
Returns the base transform applied to MouseEvent coordinates prior to dispatch. |
java.util.EventListener[] |
getListeners(java.lang.Class listenerType)
Returns an array of listeners that were added to this event dispatcher and of the specified type. |
GraphicsNode |
getRootNode()
Returns the root node for MouseEvent dispatch containment searches and field selections. |
protected boolean |
isNodeDecrementEvent(java.awt.event.InputEvent e)
Returns true if the input event e is a node decrement event, false otherwise. |
protected boolean |
isNodeIncrementEvent(java.awt.event.InputEvent e)
Returns true if the input event e is a node increment event, false otherwise. |
void |
keyPressed(java.awt.event.KeyEvent evt)
Dispatches the specified AWT key event down to the GVT tree. |
void |
keyReleased(java.awt.event.KeyEvent evt)
Dispatches the specified AWT key event down to the GVT tree. |
void |
keyTyped(java.awt.event.KeyEvent evt)
Dispatches the specified AWT key event down to the GVT tree. |
void |
mouseClicked(java.awt.event.MouseEvent evt)
Dispatches the specified AWT mouse event down to the GVT tree. |
void |
mouseDragged(java.awt.event.MouseEvent evt)
Dispatches the specified AWT mouse event down to the GVT tree. |
void |
mouseEntered(java.awt.event.MouseEvent evt)
Dispatches the specified AWT mouse event down to the GVT tree. |
void |
mouseExited(java.awt.event.MouseEvent evt)
Dispatches the specified AWT mouse event down to the GVT tree. |
void |
mouseMoved(java.awt.event.MouseEvent evt)
Dispatches the specified AWT mouse event down to the GVT tree. |
void |
mousePressed(java.awt.event.MouseEvent evt)
Dispatches the specified AWT mouse event down to the GVT tree. |
void |
mouseReleased(java.awt.event.MouseEvent evt)
Dispatches the specified AWT mouse event down to the GVT tree. |
void |
processKeyEvent(GraphicsNodeKeyEvent evt)
Dispatches a graphics node key event to by firing the 'global' listeners attached to this event dispatcher. |
protected void |
processMouseEvent(GraphicsNodeMouseEvent evt)
Processes the specified event by firing the 'global' listeners attached to this event dispatcher. |
void |
removeGraphicsNodeKeyListener(GraphicsNodeKeyListener l)
Removes the specified 'global' GraphicsNodeKeyListener which is notified of all KeyEvents dispatched. |
void |
removeGraphicsNodeMouseListener(GraphicsNodeMouseListener l)
Removes the specified 'global' GraphicsNodeMouseListener which is notified of all MouseEvents dispatched. |
void |
setBaseTransform(java.awt.geom.AffineTransform t)
Sets the base transform applied to MouseEvent coordinates prior to dispatch. |
void |
setNodeDecrementEvent(java.awt.event.InputEvent e)
Associates all InputEvents of type e.getID() with "decrementing" of the currently selected GraphicsNode. |
void |
setNodeIncrementEvent(java.awt.event.InputEvent e)
Associates all InputEvents of type e.getID() with "incrementing" of the currently selected GraphicsNode. |
void |
setRootNode(GraphicsNode root)
Sets the root node for MouseEvent dispatch containment searches and field selections. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected GraphicsNode root
protected java.awt.geom.AffineTransform baseTransform
protected javax.swing.event.EventListenerList glisteners
protected GraphicsNode lastHit
protected GraphicsNode dummyNode
protected GraphicsNode currentKeyEventTarget
Constructor Detail |
public AWTEventDispatcher()
Method Detail |
public void setRootNode(GraphicsNode root)
setRootNode
in interface EventDispatcher
root
- the root nodepublic GraphicsNode getRootNode()
getRootNode
in interface EventDispatcher
public void setBaseTransform(java.awt.geom.AffineTransform t)
setBaseTransform
in interface EventDispatcher
t
- the affine transformpublic java.awt.geom.AffineTransform getBaseTransform()
getBaseTransform
in interface EventDispatcher
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface java.awt.event.MouseListener
evt
- the mouse event to propagatepublic void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased
in interface java.awt.event.MouseListener
evt
- the mouse event to propagatepublic void mouseEntered(java.awt.event.MouseEvent evt)
mouseEntered
in interface java.awt.event.MouseListener
evt
- the mouse event to propagatepublic void mouseExited(java.awt.event.MouseEvent evt)
mouseExited
in interface java.awt.event.MouseListener
evt
- the mouse event to propagatepublic void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked
in interface java.awt.event.MouseListener
evt
- the mouse event to propagatepublic void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface java.awt.event.MouseMotionListener
evt
- the mouse event to propagatepublic void mouseDragged(java.awt.event.MouseEvent evt)
mouseDragged
in interface java.awt.event.MouseMotionListener
evt
- the mouse event to propagatepublic void keyPressed(java.awt.event.KeyEvent evt)
keyPressed
in interface java.awt.event.KeyListener
evt
- the key event to propagatepublic void keyReleased(java.awt.event.KeyEvent evt)
keyReleased
in interface java.awt.event.KeyListener
evt
- the key event to propagatepublic void keyTyped(java.awt.event.KeyEvent evt)
keyTyped
in interface java.awt.event.KeyListener
evt
- the key event to propagatepublic void addGraphicsNodeMouseListener(GraphicsNodeMouseListener l)
addGraphicsNodeMouseListener
in interface EventDispatcher
l
- the listener to addpublic void removeGraphicsNodeMouseListener(GraphicsNodeMouseListener l)
removeGraphicsNodeMouseListener
in interface EventDispatcher
l
- the listener to removepublic void addGraphicsNodeKeyListener(GraphicsNodeKeyListener l)
addGraphicsNodeKeyListener
in interface EventDispatcher
l
- the listener to addpublic void removeGraphicsNodeKeyListener(GraphicsNodeKeyListener l)
removeGraphicsNodeKeyListener
in interface EventDispatcher
l
- the listener to removepublic java.util.EventListener[] getListeners(java.lang.Class listenerType)
getListeners
in interface EventDispatcher
listenerType
- the type of the listeners to returnpublic void dispatchEvent(java.util.EventObject evt)
dispatchEvent
in interface EventDispatcher
evt
- the event to dispatchprotected void dispatchKeyEvent(java.awt.event.KeyEvent evt)
evt
- the key event to dispatchprotected void dispatchMouseEvent(java.awt.event.MouseEvent evt)
evt
- the mouse event to dispatchprotected void processMouseEvent(GraphicsNodeMouseEvent evt)
evt
- the event to processpublic void processKeyEvent(GraphicsNodeKeyEvent evt)
evt
- the evt to dispatchpublic void setNodeIncrementEvent(java.awt.event.InputEvent e)
setNodeIncrementEvent
in interface EventDispatcher
public void setNodeDecrementEvent(java.awt.event.InputEvent e)
setNodeDecrementEvent
in interface EventDispatcher
protected boolean isNodeIncrementEvent(java.awt.event.InputEvent e)
e
- the input eventprotected boolean isNodeDecrementEvent(java.awt.event.InputEvent e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |