org.apache.batik.gvt.event
Class GraphicsNodeMouseEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--org.apache.batik.gvt.event.GraphicsNodeEvent
              |
              +--org.apache.batik.gvt.event.GraphicsNodeInputEvent
                    |
                    +--org.apache.batik.gvt.event.GraphicsNodeMouseEvent
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class GraphicsNodeMouseEvent
extends GraphicsNodeInputEvent

An event which indicates that a mouse action occurred in a graphics node.

See Also:
Serialized Form

Field Summary
static int MOUSE_CLICKED
          The id for the "mouseClicked" event.
static int MOUSE_DRAGGED
          The id for the "mouseDragged" event.
static int MOUSE_ENTERED
          The id for the "mouseEntered" event.
static int MOUSE_EXITED
          The id for the "mouseExited" event.
static int MOUSE_MOVED
          The id for the "mouseMoved" event.
static int MOUSE_PRESSED
          The id for the "mousePressed" event.
static int MOUSE_RELEASED
          The id for the "mouseReleased" event.
 
Fields inherited from class org.apache.batik.gvt.event.GraphicsNodeInputEvent
ALT_GRAPH_MASK, ALT_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, CTRL_MASK, META_MASK, SHIFT_MASK
 
Fields inherited from class org.apache.batik.gvt.event.GraphicsNodeEvent
id
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
GraphicsNodeMouseEvent(GraphicsNode source, int id, long when, int modifiers, float x, float y, int clickCount)
          Constructs a new graphics node mouse event.
GraphicsNodeMouseEvent(GraphicsNode source, java.awt.event.MouseEvent evt)
          Constructs a new graphics node mouse event from an AWT MouseEvent.
 
Method Summary
 int getClickCount()
          Return the number of mouse clicks associated with this event.
 java.awt.geom.Point2D getPoint2D()
          Returns the (x, y) position of the event relative to the source node.
 float getX()
          Returns the horizontal x position of the event relative to the source graphics node.
 float getY()
          Returns the vertical y position of the event relative to the source node.
 void transform(java.awt.geom.AffineTransform t)
          Transforms the event's coordinates to a new position according to the specified transform.
 
Methods inherited from class org.apache.batik.gvt.event.GraphicsNodeInputEvent
getModifiers, getWhen, isAltDown, isAltGraphDown, isControlDown, isMetaDown, isShiftDown
 
Methods inherited from class org.apache.batik.gvt.event.GraphicsNodeEvent
clone, consume, getGraphicsNode, getID, isConsumed
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MOUSE_CLICKED

public static final int MOUSE_CLICKED
The id for the "mouseClicked" event.

MOUSE_PRESSED

public static final int MOUSE_PRESSED
The id for the "mousePressed" event.

MOUSE_RELEASED

public static final int MOUSE_RELEASED
The id for the "mouseReleased" event.

MOUSE_ENTERED

public static final int MOUSE_ENTERED
The id for the "mouseEntered" event.

MOUSE_EXITED

public static final int MOUSE_EXITED
The id for the "mouseExited" event.

MOUSE_DRAGGED

public static final int MOUSE_DRAGGED
The id for the "mouseDragged" event.

MOUSE_MOVED

public static final int MOUSE_MOVED
The id for the "mouseMoved" event.
Constructor Detail

GraphicsNodeMouseEvent

public GraphicsNodeMouseEvent(GraphicsNode source,
                              int id,
                              long when,
                              int modifiers,
                              float x,
                              float y,
                              int clickCount)
Constructs a new graphics node mouse event.
Parameters:
source - the graphics node where the event originated
id - the id of this event
when - the time the event occurred
modifiers - the modifier keys down while event occurred
x, y - the mouse coordinates
clickCount - the number of clicks

GraphicsNodeMouseEvent

public GraphicsNodeMouseEvent(GraphicsNode source,
                              java.awt.event.MouseEvent evt)
Constructs a new graphics node mouse event from an AWT MouseEvent.
Parameters:
source - the source where the event originated
evt - the AWT mouse event which is the source of this GraphicsNodeEvent
Method Detail

getX

public float getX()
Returns the horizontal x position of the event relative to the source graphics node.
Returns:
x a float indicating horizontal position relative to the node

getY

public float getY()
Returns the vertical y position of the event relative to the source node.
Returns:
y a float indicating vertical position relative to the node

getPoint2D

public java.awt.geom.Point2D getPoint2D()
Returns the (x, y) position of the event relative to the source node.
Returns:
a Point object containing the x and y coordinates

transform

public void transform(java.awt.geom.AffineTransform t)
Transforms the event's coordinates to a new position according to the specified transform.
Parameters:
t - the transform to use

getClickCount

public int getClickCount()
Return the number of mouse clicks associated with this event.
Returns:
integer value for the number of clicks


Copyright © 2000 Apache Software Foundation. All Rights Reserved.