org.apache.batik.bridge.svg12
Class SVG12BridgeEventSupport.Listener

java.lang.Object
  extended by org.apache.batik.bridge.BridgeEventSupport.Listener
      extended by 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
protected  SVG12BridgeContext ctx12
          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.
 
Fields inherited from class org.apache.batik.bridge.BridgeEventSupport.Listener
context, isDown, lastTargetElement, ua
 
Constructor Summary
SVG12BridgeEventSupport.Listener(BridgeContext ctx, UserAgent u)
           
 
Method Summary
protected  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 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  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(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

SVG12BridgeEventSupport.Listener

public SVG12BridgeEventSupport.Listener(BridgeContext ctx,
                                        UserAgent u)
Method Detail

keyPressed

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

Specified by:
keyPressed in interface GraphicsNodeKeyListener
Overrides:
keyPressed in class BridgeEventSupport.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 interface GraphicsNodeKeyListener
Overrides:
keyReleased in class BridgeEventSupport.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 interface GraphicsNodeKeyListener
Overrides:
keyTyped in class BridgeEventSupport.Listener
Parameters:
evt - the graphics node key event

dispatchKeyboardEvent

protected void dispatchKeyboardEvent(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(String keyIdentifier,
                                           int keyCode)
Put a key code to key identifier mapping into the IDENTIFIER_KEY_CODES table.


mapKeyCodeToIdentifier

protected 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 interface GraphicsNodeMouseWheelListener
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 interface GraphicsNodeMouseListener
Overrides:
mouseEntered in class BridgeEventSupport.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 interface GraphicsNodeMouseListener
Overrides:
mouseExited in class BridgeEventSupport.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 interface GraphicsNodeMouseListener
Overrides:
mouseMoved in class BridgeEventSupport.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 class BridgeEventSupport.Listener
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


Copyright © 2008 Apache Software Foundation. All Rights Reserved.