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:
java.util.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
Fields Modifier and Type Field Description protected SVG12BridgeContext
ctx12
The BridgeContext downcasted to an SVG12BridgeContext.protected static java.lang.String[][]
IDENTIFIER_KEY_CODES
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 Constructor Description Listener(BridgeContext ctx, UserAgent u)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
dispatchKeyboardEvent(java.lang.String eventType, GraphicsNodeKeyEvent evt)
Dispatch a DOM 3 Keyboard event.protected void
dispatchMouseEvent(java.lang.String eventType, org.w3c.dom.Element targetElement, org.w3c.dom.Element relatedElement, java.awt.Point clientXY, GraphicsNodeMouseEvent evt, boolean cancelable)
Dispatches a DOM MouseEvent according to the specified parameters.protected void
dispatchMouseEvent(java.lang.String eventType, org.w3c.dom.Element targetElement, org.w3c.dom.Element relatedElement, java.awt.Point clientXY, GraphicsNodeMouseEvent evt, boolean cancelable, int bubbleLimit)
Dispatches a DOM MouseEvent according to the specified parameters.protected void
dispatchTextEvent(GraphicsNodeKeyEvent evt)
Dispatch a DOM 3 Text event.void
keyPressed(GraphicsNodeKeyEvent evt)
Invoked when a key has been pressed.void
keyReleased(GraphicsNodeKeyEvent evt)
Invoked when a key has been released.void
keyTyped(GraphicsNodeKeyEvent evt)
Invoked when a key has been typed.protected java.lang.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
mouseEntered(GraphicsNodeMouseEvent evt)
Invoked when the mouse enters a graphics node.void
mouseExited(GraphicsNodeMouseEvent evt)
Invoked when the mouse exits a graphics node.void
mouseMoved(GraphicsNodeMouseEvent evt)
Invoked when the mouse button has been moved on a node.void
mouseWheelMoved(GraphicsNodeMouseWheelEvent evt)
Invoked when the mouse wheel has been moved.protected static void
putIdentifierKeyCode(java.lang.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 Detail
-
ctx12
protected SVG12BridgeContext ctx12
The BridgeContext downcasted to an SVG12BridgeContext.
-
IDENTIFIER_KEY_CODES
protected static java.lang.String[][] IDENTIFIER_KEY_CODES
Array to hold the map of Java keycodes to DOM 3 key strings.
-
-
Constructor Detail
-
Listener
public Listener(BridgeContext ctx, UserAgent u)
-
-
Method Detail
-
keyPressed
public void keyPressed(GraphicsNodeKeyEvent evt)
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
public void keyReleased(GraphicsNodeKeyEvent evt)
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
public void keyTyped(GraphicsNodeKeyEvent evt)
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
protected void dispatchKeyboardEvent(java.lang.String eventType, GraphicsNodeKeyEvent evt)
Dispatch a DOM 3 Keyboard event.
-
dispatchTextEvent
protected void dispatchTextEvent(GraphicsNodeKeyEvent evt)
Dispatch a DOM 3 Text event.
-
mapKeyLocation
protected int mapKeyLocation(int location)
Maps Java KeyEvent location numbers to DOM 3 location numbers.
-
putIdentifierKeyCode
protected static void putIdentifierKeyCode(java.lang.String keyIdentifier, int keyCode)
Put a key code to key identifier mapping into the IDENTIFIER_KEY_CODES table.
-
mapKeyCodeToIdentifier
protected java.lang.String mapKeyCodeToIdentifier(int keyCode)
Convert a Java key code to a DOM 3 key string.
-
mouseWheelMoved
public void mouseWheelMoved(GraphicsNodeMouseWheelEvent evt)
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
public void mouseEntered(GraphicsNodeMouseEvent evt)
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
public void mouseExited(GraphicsNodeMouseEvent evt)
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
public void mouseMoved(GraphicsNodeMouseEvent evt)
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(java.lang.String eventType, org.w3c.dom.Element targetElement, org.w3c.dom.Element relatedElement, java.awt.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(java.lang.String eventType, org.w3c.dom.Element targetElement, org.w3c.dom.Element relatedElement, java.awt.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
-
-