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 SVG12BridgeContextctx12The BridgeContext downcasted to an SVG12BridgeContext.protected static java.lang.String[][]IDENTIFIER_KEY_CODESArray 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 voiddispatchKeyboardEvent(java.lang.String eventType, GraphicsNodeKeyEvent evt)Dispatch a DOM 3 Keyboard event.protected voiddispatchMouseEvent(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 voiddispatchMouseEvent(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 voiddispatchTextEvent(GraphicsNodeKeyEvent evt)Dispatch a DOM 3 Text event.voidkeyPressed(GraphicsNodeKeyEvent evt)Invoked when a key has been pressed.voidkeyReleased(GraphicsNodeKeyEvent evt)Invoked when a key has been released.voidkeyTyped(GraphicsNodeKeyEvent evt)Invoked when a key has been typed.protected java.lang.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.voidmouseEntered(GraphicsNodeMouseEvent evt)Invoked when the mouse enters a graphics node.voidmouseExited(GraphicsNodeMouseEvent evt)Invoked when the mouse exits a graphics node.voidmouseMoved(GraphicsNodeMouseEvent evt)Invoked when the mouse button has been moved on a node.voidmouseWheelMoved(GraphicsNodeMouseWheelEvent evt)Invoked when the mouse wheel has been moved.protected static voidputIdentifierKeyCode(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:
keyPressedin interfaceGraphicsNodeKeyListener- Overrides:
keyPressedin classBridgeEventSupport.Listener- Parameters:
evt- the graphics node key event
-
keyReleased
public void keyReleased(GraphicsNodeKeyEvent evt)
Invoked when a key has been released.- Specified by:
keyReleasedin interfaceGraphicsNodeKeyListener- Overrides:
keyReleasedin classBridgeEventSupport.Listener- Parameters:
evt- the graphics node key event
-
keyTyped
public void keyTyped(GraphicsNodeKeyEvent evt)
Invoked when a key has been typed.- Specified by:
keyTypedin interfaceGraphicsNodeKeyListener- Overrides:
keyTypedin 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:GraphicsNodeMouseWheelListenerInvoked when the mouse wheel has been moved.- Specified by:
mouseWheelMovedin interfaceGraphicsNodeMouseWheelListener- Parameters:
evt- the graphics node mouse event
-
mouseEntered
public void mouseEntered(GraphicsNodeMouseEvent evt)
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
public void mouseExited(GraphicsNodeMouseEvent evt)
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
public void mouseMoved(GraphicsNodeMouseEvent evt)
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(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:
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(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
-
-