Jazz API Documentation

edu.umd.cs.jazz.event
Class ZMouseEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--java.awt.AWTEvent
              |
              +--java.awt.event.ComponentEvent
                    |
                    +--java.awt.event.InputEvent
                          |
                          +--java.awt.event.MouseEvent
                                |
                                +--edu.umd.cs.jazz.event.ZMouseEvent
All Implemented Interfaces:
java.io.Serializable

public class ZMouseEvent
extends java.awt.event.MouseEvent
implements java.io.Serializable

ZMouseEvent is an event which indicates that a mouse action occurred in a node. This event is used both for mouse events (click, enter, exit) and mouse motion events (moves and drags).

This low-level event is generated by a node object for:

A ZMouseEvent object is passed to every ZMouseListener or ZMouseAdapter object which registered to receive the "interesting" mouse events using the component's addMouseListener method. (ZMouseAdapter objects implement the ZMouseListener interface.) Each such listener object gets a ZMouseEvent containing the mouse event.

A ZMouseEvent object is also passed to every ZMouseMotionListener or ZMouseMotionAdapter object which registered to receive mouse motion events using the component's addMouseMotionListener method. (ZMouseMotionAdapter objects implement the ZMouseMotionListener interface.) Each such listener object gets a ZMouseEvent containing the mouse motion event.

Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.

See Also:
ZMouseAdapter, ZMouseListener, ZMouseMotionAdapter, ZMouseMotionListener, Serialized Form

Fields inherited from class java.awt.event.MouseEvent
MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_FIRST, MOUSE_LAST, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED
 
Fields inherited from class java.awt.event.InputEvent
ALT_GRAPH_MASK, ALT_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, CTRL_MASK, META_MASK, SHIFT_MASK
 
Fields inherited from class java.awt.event.ComponentEvent
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ZMouseEvent(int id, ZNode node, java.awt.event.MouseEvent e, ZSceneGraphPath path)
          Constructs a new ZMouse event from a Java MouseEvent.
ZMouseEvent(int id, ZNode node, java.awt.event.MouseEvent e, ZSceneGraphPath path, ZNode target, ZSceneGraphPath targetPath)
          Constructs a new ZMouseEvent from a Java MouseEvent.
 
Method Summary
 int getID()
          Determine the event type.
 java.awt.geom.Point2D getLocalPoint()
          Returns the x,y position of the event in the local coordinate system of the node the event occurred on.
 double getLocalX()
          Returns the horizontal x position of the event in the local coordinate system of the node the event occurred on.
 double getLocalY()
          Returns the vertical y position of the event in the local coordinate system of the node the event occurred on.
 ZNode getNode()
          Determine the node the event ocurred on
 ZSceneGraphPath getPath()
          Determine the path the event took from the ZCanvas down to the visual component.
 ZNode getTarget()
          Determine the target of the event.
 ZSceneGraphPath getTargetPath()
          Determine the path from the ZCanvas down to the target visual component.
 
Methods inherited from class java.awt.event.MouseEvent
getClickCount, getPoint, getX, getY, isPopupTrigger, paramString, translatePoint
 
Methods inherited from class java.awt.event.InputEvent
consume, getModifiers, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown
 
Methods inherited from class java.awt.event.ComponentEvent
getComponent
 
Methods inherited from class java.awt.AWTEvent
finalize, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZMouseEvent

public ZMouseEvent(int id,
                   ZNode node,
                   java.awt.event.MouseEvent e,
                   ZSceneGraphPath path)
Constructs a new ZMouse event from a Java MouseEvent.
Parameters:
id - The event type (MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_CLICKED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_MOVED, MOUSE_DRAGGED)
node - The node the event occurred on
e - The original Java mouse event
path - The path the event took from the ZCanvas to the visual component

ZMouseEvent

public ZMouseEvent(int id,
                   ZNode node,
                   java.awt.event.MouseEvent e,
                   ZSceneGraphPath path,
                   ZNode target,
                   ZSceneGraphPath targetPath)
Constructs a new ZMouseEvent from a Java MouseEvent. This constructor is specifically designed for a MOUSE_RELEASED event.
Parameters:
id - The event type (MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_CLICKED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_MOVED, MOUSE_DRAGGED)
node - The node the event occurred on
e - The original Java mouse event
path - The path the event took from the ZCanvas to the visual component
target - The target node of the event
targetPath - The target path of the event
Method Detail

getLocalPoint

public java.awt.geom.Point2D getLocalPoint()
Returns the x,y position of the event in the local coordinate system of the node the event occurred on.
Returns:
a Point2D object containing the x and y coordinates local to the node.

getLocalX

public double getLocalX()
Returns the horizontal x position of the event in the local coordinate system of the node the event occurred on.
Returns:
x a double indicating horizontal position local to the node.

getLocalY

public double getLocalY()
Returns the vertical y position of the event in the local coordinate system of the node the event occurred on.
Returns:
y a double indicating vertical position local to the node.

getID

public int getID()
Determine the event type.
Overrides:
getID in class java.awt.AWTEvent
Returns:
the id

getNode

public ZNode getNode()
Determine the node the event ocurred on
Returns:
the node

getPath

public ZSceneGraphPath getPath()
Determine the path the event took from the ZCanvas down to the visual component.
Returns:
the path

getTarget

public ZNode getTarget()
Determine the target of the event. This may be null if there is no valid target node or if this is not a MOUSE_RELEASED event.
Returns:
the target

getTargetPath

public ZSceneGraphPath getTargetPath()
Determine the path from the ZCanvas down to the target visual component. This may be null if this is not a MOUSE_RELEASED event.
Returns:
the target path

Jazz API Documentation