org.apache.batik.bridge.svg12

Class SVG12BridgeEventSupport.Listener

protected static class SVG12BridgeEventSupport.Listener extends BridgeEventSupport.Listener implements GraphicsNodeMouseWheelListener

A GraphicsNodeMouseListener that dispatch DOM events accordingly.
Field Summary
protected SVG12BridgeContextctx12
The BridgeContext downcasted to an SVG12BridgeContext.
protected static String[][]IDENTIFIER_KEY_CODES
Array to hold the map of Java keycodes to DOM 3 key strings.
Constructor Summary
Listener(BridgeContext ctx, UserAgent u)
Method Summary
protected 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 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 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)
voidmouseExited(GraphicsNodeMouseEvent evt)
voidmouseMoved(GraphicsNodeMouseEvent evt)
voidmouseWheelMoved(GraphicsNodeMouseWheelEvent evt)
protected static voidputIdentifierKeyCode(String keyIdentifier, int keyCode)
Put a key code to key identifier mapping into the IDENTIFIER_KEY_CODES table.

Field Detail

ctx12

protected SVG12BridgeContext ctx12
The BridgeContext downcasted to an SVG12BridgeContext.

IDENTIFIER_KEY_CODES

protected static 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

dispatchKeyboardEvent

protected void dispatchKeyboardEvent(String eventType, GraphicsNodeKeyEvent evt)
Dispatch a DOM 3 Keyboard 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.

Parameters: eventType the event type targetElement the target of the event relatedElement the related target if any clientXY the mouse coordinates in the client space evt the GVT GraphicsNodeMouseEvent cancelable 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 type targetElement the target of the event relatedElement the related target if any clientXY the mouse coordinates in the client space evt the GVT GraphicsNodeMouseEvent cancelable true means the event is cancelable bubbleLimit the limit to the number of nodes the event will bubble to

dispatchTextEvent

protected void dispatchTextEvent(GraphicsNodeKeyEvent evt)
Dispatch a DOM 3 Text event.

keyPressed

public void keyPressed(GraphicsNodeKeyEvent evt)
Invoked when a key has been pressed.

Parameters: evt the graphics node key event

keyReleased

public void keyReleased(GraphicsNodeKeyEvent evt)
Invoked when a key has been released.

Parameters: evt the graphics node key event

keyTyped

public void keyTyped(GraphicsNodeKeyEvent evt)
Invoked when a key has been typed.

Parameters: evt the graphics node key event

mapKeyCodeToIdentifier

protected String mapKeyCodeToIdentifier(int keyCode)
Convert a Java key code to a DOM 3 key string.

mapKeyLocation

protected int mapKeyLocation(int location)
Maps Java KeyEvent location numbers to DOM 3 location numbers.

mouseEntered

public void mouseEntered(GraphicsNodeMouseEvent evt)

mouseExited

public void mouseExited(GraphicsNodeMouseEvent evt)

mouseMoved

public void mouseMoved(GraphicsNodeMouseEvent evt)

mouseWheelMoved

public void mouseWheelMoved(GraphicsNodeMouseWheelEvent evt)

putIdentifierKeyCode

protected static void putIdentifierKeyCode(String keyIdentifier, int keyCode)
Put a key code to key identifier mapping into the IDENTIFIER_KEY_CODES table.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.