Class BridgeEventSupport.Listener
java.lang.Object
org.apache.batik.bridge.BridgeEventSupport.Listener
- All Implemented Interfaces:
EventListener, GraphicsNodeKeyListener, GraphicsNodeMouseListener
- Direct Known Subclasses:
SVG12BridgeEventSupport.Listener
- Enclosing class:
BridgeEventSupport
protected static class BridgeEventSupport.Listener
extends Object
implements GraphicsNodeMouseListener, GraphicsNodeKeyListener
A GraphicsNodeMouseListener that dispatch DOM events accordingly.
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BridgeContextprotected booleanprotected Elementprotected UserAgent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddispatchKeyEvent(String eventType, GraphicsNodeKeyEvent evt) Dispatch a DOM 2 Draft Key event.protected voiddispatchMouseEvent(String eventType, GraphicsNodeMouseEvent evt, boolean cancelable) Dispatches a DOM MouseEvent according to the specified parameters.protected voiddispatchMouseEvent(String eventType, Element targetElement, Element relatedElement, Point clientXY, GraphicsNodeMouseEvent evt, boolean cancelable) Dispatches a DOM MouseEvent according to the specified parameters.protected ElementgetEventTarget(GraphicsNode node, Point2D pt) Returns the element that is the target of the specified event or null if any.protected ElementReturns the related element according to the specified event.voidInvoked when a key has been pressed.voidInvoked when a key has been released.voidInvoked when a key has been typed.protected final intmapKeyCode(int keyCode) The java KeyEvent keyCodes and the DOMKeyEvent keyCodes map except for the VK_ENTER code (which has a different value in DOM and the VK_KANA_LOCK and VK_INPUT_METHOD_ON_OFF which have no DOM equivalent.voidInvoked when the mouse has been clicked on a graphics node.voidInvoked when a mouse button is pressed on a graphics node and then dragged.voidInvoked when the mouse enters a graphics node.voidInvoked when the mouse exits a graphics node.voidInvoked when the mouse button has been moved on a node.voidInvoked when a mouse button has been pressed on a graphics node.voidInvoked when a mouse button has been released on a graphics node.
-
Field Details
-
context
-
ua
-
lastTargetElement
-
isDown
protected boolean isDown
-
-
Constructor Details
-
Listener
-
-
Method Details
-
keyPressed
Invoked when a key has been pressed.- Specified by:
keyPressedin interfaceGraphicsNodeKeyListener- Parameters:
evt- the graphics node key event
-
keyReleased
Invoked when a key has been released.- Specified by:
keyReleasedin interfaceGraphicsNodeKeyListener- Parameters:
evt- the graphics node key event
-
keyTyped
Invoked when a key has been typed.- Specified by:
keyTypedin interfaceGraphicsNodeKeyListener- Parameters:
evt- the graphics node key event
-
dispatchKeyEvent
Dispatch a DOM 2 Draft Key event. -
mapKeyCode
protected final int mapKeyCode(int keyCode) The java KeyEvent keyCodes and the DOMKeyEvent keyCodes map except for the VK_ENTER code (which has a different value in DOM and the VK_KANA_LOCK and VK_INPUT_METHOD_ON_OFF which have no DOM equivalent. -
mouseClicked
Description copied from interface:GraphicsNodeMouseListenerInvoked when the mouse has been clicked on a graphics node.- Specified by:
mouseClickedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mousePressed
Description copied from interface:GraphicsNodeMouseListenerInvoked when a mouse button has been pressed on a graphics node.- Specified by:
mousePressedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseReleased
Description copied from interface:GraphicsNodeMouseListenerInvoked when a mouse button has been released on a graphics node.- Specified by:
mouseReleasedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseEntered
Description copied from interface:GraphicsNodeMouseListenerInvoked when the mouse enters a graphics node.- Specified by:
mouseEnteredin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseExited
Description copied from interface:GraphicsNodeMouseListenerInvoked when the mouse exits a graphics node.- Specified by:
mouseExitedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseDragged
Description copied from interface:GraphicsNodeMouseListenerInvoked when a mouse button is pressed on a graphics node and then dragged.- Specified by:
mouseDraggedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseMoved
Description copied from interface:GraphicsNodeMouseListenerInvoked when the mouse button has been moved on a node.- Specified by:
mouseMovedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
dispatchMouseEvent
Dispatches a DOM MouseEvent according to the specified parameters.- Parameters:
eventType- the event typeevt- the GVT GraphicsNodeMouseEventcancelable- true means the event is cancelable
-
dispatchMouseEvent
protected void dispatchMouseEvent(String eventType, Element targetElement, Element relatedElement, Point clientXY, GraphicsNodeMouseEvent evt, boolean cancelable) Dispatches a DOM MouseEvent according to the specified parameters.- Parameters:
eventType- the event typetargetElement- the target of the eventrelatedElement- the related target if anyclientXY- the mouse coordinates in the client spaceevt- the GVT GraphicsNodeMouseEventcancelable- true means the event is cancelable
-
getRelatedElement
Returns the related element according to the specified event.- Parameters:
evt- the GVT GraphicsNodeMouseEvent
-
getEventTarget
Returns the element that is the target of the specified event or null if any.- Parameters:
node- the graphics node that received the eventpt- the mouse coordinates in the GVT tree space
-