Class SVG12BridgeEventSupport.Listener
java.lang.Object
org.apache.batik.bridge.BridgeEventSupport.Listener
org.apache.batik.bridge.svg12.SVG12BridgeEventSupport.Listener
- All Implemented Interfaces:
EventListener, GraphicsNodeKeyListener, GraphicsNodeMouseListener, GraphicsNodeMouseWheelListener
- Enclosing class:
SVG12BridgeEventSupport
protected static class SVG12BridgeEventSupport.Listener
extends BridgeEventSupport.Listener
implements GraphicsNodeMouseWheelListener
A GraphicsNodeMouseListener that dispatch DOM events accordingly.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SVG12BridgeContextThe BridgeContext downcasted to an SVG12BridgeContext.protected static String[][]Array to hold the map of Java keycodes to DOM 3 key strings.Fields inherited from class BridgeEventSupport.Listener
context, isDown, lastTargetElement, ua -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddispatchKeyboardEvent(String eventType, GraphicsNodeKeyEvent evt) Dispatch a DOM 3 Keyboard event.protected voiddispatchMouseEvent(String eventType, Element targetElement, Element relatedElement, Point clientXY, 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, int bubbleLimit) Dispatches a DOM MouseEvent according to the specified parameters.protected voidDispatch a DOM 3 Text event.voidInvoked when a key has been pressed.voidInvoked when a key has been released.voidInvoked when a key has been typed.protected StringmapKeyCodeToIdentifier(int keyCode) Convert a Java key code to a DOM 3 key string.protected intmapKeyLocation(int location) Maps Java KeyEvent location numbers to DOM 3 location numbers.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 the mouse wheel has been moved.protected static voidputIdentifierKeyCode(String keyIdentifier, int keyCode) Put a key code to key identifier mapping into the IDENTIFIER_KEY_CODES table.Methods inherited from class BridgeEventSupport.Listener
dispatchKeyEvent, dispatchMouseEvent, getEventTarget, getRelatedElement, mapKeyCode, mouseClicked, mouseDragged, mousePressed, mouseReleased
-
Field Details
-
ctx12
The BridgeContext downcasted to an SVG12BridgeContext. -
IDENTIFIER_KEY_CODES
Array to hold the map of Java keycodes to DOM 3 key strings.
-
-
Constructor Details
-
Listener
-
-
Method Details
-
keyPressed
Invoked when a key has been pressed.- Specified by:
keyPressedin interfaceGraphicsNodeKeyListener- Overrides:
keyPressedin classBridgeEventSupport.Listener- Parameters:
evt- the graphics node key event
-
keyReleased
Invoked when a key has been released.- Specified by:
keyReleasedin interfaceGraphicsNodeKeyListener- Overrides:
keyReleasedin classBridgeEventSupport.Listener- Parameters:
evt- the graphics node key event
-
keyTyped
Invoked when a key has been typed.- Specified by:
keyTypedin interfaceGraphicsNodeKeyListener- Overrides:
keyTypedin classBridgeEventSupport.Listener- Parameters:
evt- the graphics node key event
-
dispatchKeyboardEvent
Dispatch a DOM 3 Keyboard event. -
dispatchTextEvent
Dispatch a DOM 3 Text event. -
mapKeyLocation
protected int mapKeyLocation(int location) Maps Java KeyEvent location numbers to DOM 3 location numbers. -
putIdentifierKeyCode
Put a key code to key identifier mapping into the IDENTIFIER_KEY_CODES table. -
mapKeyCodeToIdentifier
Convert a Java key code to a DOM 3 key string. -
mouseWheelMoved
Description copied from interface:GraphicsNodeMouseWheelListenerInvoked when the mouse wheel has been moved.- Specified by:
mouseWheelMovedin interfaceGraphicsNodeMouseWheelListener- Parameters:
evt- the graphics node mouse event
-
mouseEntered
Description copied from interface:GraphicsNodeMouseListenerInvoked when the mouse enters a graphics node.- Specified by:
mouseEnteredin interfaceGraphicsNodeMouseListener- Overrides:
mouseEnteredin classBridgeEventSupport.Listener- Parameters:
evt- the graphics node mouse event
-
mouseExited
Description copied from interface:GraphicsNodeMouseListenerInvoked when the mouse exits a graphics node.- Specified by:
mouseExitedin interfaceGraphicsNodeMouseListener- Overrides:
mouseExitedin classBridgeEventSupport.Listener- 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- Overrides:
mouseMovedin classBridgeEventSupport.Listener- Parameters:
evt- the graphics node mouse event
-
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.- Overrides:
dispatchMouseEventin classBridgeEventSupport.Listener- 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
-
dispatchMouseEvent
protected void dispatchMouseEvent(String eventType, Element targetElement, Element relatedElement, Point clientXY, GraphicsNodeMouseEvent evt, boolean cancelable, int bubbleLimit) 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 cancelablebubbleLimit- the limit to the number of nodes the event will bubble to
-