Package org.apache.batik.bridge.svg12
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 SVG12BridgeContext
The 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 org.apache.batik.bridge.BridgeEventSupport.Listener
context, isDown, lastTargetElement, ua
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
dispatchKeyboardEvent
(String eventType, GraphicsNodeKeyEvent evt) Dispatch a DOM 3 Keyboard event.protected void
dispatchMouseEvent
(String eventType, Element targetElement, Element relatedElement, Point clientXY, GraphicsNodeMouseEvent evt, boolean cancelable) Dispatches a DOM MouseEvent according to the specified parameters.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.protected void
Dispatch a DOM 3 Text event.void
Invoked when a key has been pressed.void
Invoked when a key has been released.void
Invoked when a key has been typed.protected String
mapKeyCodeToIdentifier
(int keyCode) Convert a Java key code to a DOM 3 key string.protected int
mapKeyLocation
(int location) Maps Java KeyEvent location numbers to DOM 3 location numbers.void
Invoked when the mouse enters a graphics node.void
Invoked when the mouse exits a graphics node.void
Invoked when the mouse button has been moved on a node.void
Invoked when the mouse wheel has been moved.protected static void
putIdentifierKeyCode
(String keyIdentifier, int keyCode) Put a key code to key identifier mapping into the IDENTIFIER_KEY_CODES table.Methods inherited from class org.apache.batik.bridge.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:
keyPressed
in interfaceGraphicsNodeKeyListener
- Overrides:
keyPressed
in classBridgeEventSupport.Listener
- Parameters:
evt
- the graphics node key event
-
keyReleased
Invoked when a key has been released.- Specified by:
keyReleased
in interfaceGraphicsNodeKeyListener
- Overrides:
keyReleased
in classBridgeEventSupport.Listener
- Parameters:
evt
- the graphics node key event
-
keyTyped
Invoked when a key has been typed.- Specified by:
keyTyped
in interfaceGraphicsNodeKeyListener
- Overrides:
keyTyped
in 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:GraphicsNodeMouseWheelListener
Invoked when the mouse wheel has been moved.- Specified by:
mouseWheelMoved
in interfaceGraphicsNodeMouseWheelListener
- Parameters:
evt
- the graphics node mouse event
-
mouseEntered
Description copied from interface:GraphicsNodeMouseListener
Invoked when the mouse enters a graphics node.- Specified by:
mouseEntered
in interfaceGraphicsNodeMouseListener
- Overrides:
mouseEntered
in classBridgeEventSupport.Listener
- Parameters:
evt
- the graphics node mouse event
-
mouseExited
Description copied from interface:GraphicsNodeMouseListener
Invoked when the mouse exits a graphics node.- Specified by:
mouseExited
in interfaceGraphicsNodeMouseListener
- Overrides:
mouseExited
in classBridgeEventSupport.Listener
- Parameters:
evt
- the graphics node mouse event
-
mouseMoved
Description copied from interface:GraphicsNodeMouseListener
Invoked when the mouse button has been moved on a node.- Specified by:
mouseMoved
in interfaceGraphicsNodeMouseListener
- Overrides:
mouseMoved
in 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:
dispatchMouseEvent
in 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
-