|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.EventObject
java.awt.AWTEvent
java.awt.event.ComponentEvent
java.awt.event.InputEvent
java.awt.event.MouseEvent
edu.umd.cs.piccolox.pswing.PSwingMouseEvent
public class PSwingMouseEvent
PMouseEvent is an event which indicates that a mouse action occurred in a node.
This low-level event is generated by a node object for:
A PMouseEvent object is passed to every PMouseListener or
PMouseAdapter object which registered to receive the
"interesting" mouse events using the component's
addMouseListener method. (PMouseAdapter objects
implement the PMouseListener interface.) Each such listener
object gets a PMouseEvent containing the mouse event.
Warning: Serialized objects of this class will not be compatible with future Piccolo releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Piccolo. A future release of Piccolo will provide support for long term persistence.
| Field Summary |
|---|
| Fields inherited from class java.awt.event.MouseEvent |
|---|
BUTTON1, BUTTON2, BUTTON3, MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_FIRST, MOUSE_LAST, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_WHEEL, NOBUTTON |
| Fields inherited from class java.awt.event.InputEvent |
|---|
ALT_DOWN_MASK, ALT_GRAPH_DOWN_MASK, ALT_GRAPH_MASK, ALT_MASK, BUTTON1_DOWN_MASK, BUTTON1_MASK, BUTTON2_DOWN_MASK, BUTTON2_MASK, BUTTON3_DOWN_MASK, BUTTON3_MASK, CTRL_DOWN_MASK, CTRL_MASK, META_DOWN_MASK, META_MASK, SHIFT_DOWN_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, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK |
| Fields inherited from class java.util.EventObject |
|---|
source |
| Constructor Summary | |
|---|---|
protected |
PSwingMouseEvent(int id,
java.awt.event.MouseEvent e,
edu.umd.cs.piccolo.event.PInputEvent event)
Constructs a new PMouse event from a Java MouseEvent. |
| Method Summary | |
|---|---|
java.awt.event.MouseEvent |
asMouseEvent()
Returns this event as a mouse event. |
static PSwingEvent |
createMouseEvent(int id,
java.awt.event.MouseEvent e,
edu.umd.cs.piccolo.event.PInputEvent pEvent)
Creates and returns a new PMouse event from a Java MouseEvent. |
void |
dispatchTo(java.lang.Object listener)
Calls appropriate method on the listener based on this events ID. |
edu.umd.cs.piccolo.PNode |
getCurrentNode()
Get the current node that is under the cursor. |
edu.umd.cs.piccolo.util.PPickPath |
getCurrentPath()
Get the path from the PCanvas down to the visual component currently under the mouse.This may give a different result then getGrabPath() durring a MOUSE_DRAGGED or MOUSE_RELEASED operation. |
edu.umd.cs.piccolo.PNode |
getGrabNode()
Determine the node the event originated at. |
edu.umd.cs.piccolo.util.PPickPath |
getGrabPath()
Return the path from the PCanvas down to the currently grabbed object. |
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. |
edu.umd.cs.piccolo.PNode |
getNode()
Determine the node the event originated at. |
edu.umd.cs.piccolo.util.PPickPath |
getPath()
Determine the path the event took from the PCanvas down to the visual component. |
void |
setSource(java.lang.Object aSource)
Set the souce of this event. |
| Methods inherited from class java.awt.event.MouseEvent |
|---|
getButton, getClickCount, getLocationOnScreen, getMouseModifiersText, getPoint, getX, getXOnScreen, getY, getYOnScreen, isPopupTrigger, paramString, translatePoint |
| Methods inherited from class java.awt.event.InputEvent |
|---|
consume, getModifiers, getModifiersEx, getModifiersExText, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown |
| Methods inherited from class java.awt.event.ComponentEvent |
|---|
getComponent |
| Methods inherited from class java.awt.AWTEvent |
|---|
toString |
| Methods inherited from class java.util.EventObject |
|---|
getSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected PSwingMouseEvent(int id,
java.awt.event.MouseEvent e,
edu.umd.cs.piccolo.event.PInputEvent event)
id - The event type (MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_CLICKED,
MOUSE_ENTERED, MOUSE_EXITED)e - The original Java mouse event when in MOUSE_RELEASED events.| Method Detail |
|---|
public static PSwingEvent createMouseEvent(int id, java.awt.event.MouseEvent e, edu.umd.cs.piccolo.event.PInputEvent pEvent)
id - The event type (MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_CLICKED,
MOUSE_ENTERED, MOUSE_EXITED, MOUSE_MOVED, MOUSE_DRAGGED)e - The original Java mouse event when in MOUSE_DRAGGED and
MOUSE_RELEASED events.public java.awt.geom.Point2D getLocalPoint()
getLocalPoint in interface PSwingEventpublic double getLocalX()
getLocalX in interface PSwingEventpublic double getLocalY()
getLocalY in interface PSwingEventpublic int getID()
getID in interface PSwingEventgetID in class java.awt.AWTEventpublic edu.umd.cs.piccolo.PNode getNode()
getNode in interface PSwingEventpublic edu.umd.cs.piccolo.util.PPickPath getPath()
getPath in interface PSwingEventpublic edu.umd.cs.piccolo.PNode getGrabNode()
getGrabNode in interface PSwingEventpublic edu.umd.cs.piccolo.util.PPickPath getGrabPath()
getGrabPath in interface PSwingEventpublic edu.umd.cs.piccolo.PNode getCurrentNode()
getCurrentNode in interface PSwingEventpublic edu.umd.cs.piccolo.util.PPickPath getCurrentPath()
getCurrentPath in interface PSwingEventpublic void dispatchTo(java.lang.Object listener)
dispatchTo in interface PSwingEventlistener - the MouseListener or MouseMotionListener to dispatch to.public void setSource(java.lang.Object aSource)
setSource in interface PSwingEventsetSource in class java.awt.AWTEventaSource - public java.awt.event.MouseEvent asMouseEvent()
PSwingEvent
asMouseEvent in interface PSwingEvent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||