public class PSwingMouseWheelEvent extends MouseWheelEvent implements PSwingEvent
PMouseMotionListener
or
PMouseMotionAdapter
object which registered to receive mouse
motion events using the component's addMouseMotionListener
method. (PMouseMotionAdapter
objects implement the
PMouseMotionListener
interface.) Each such listener object gets
a PMouseEvent
containing the mouse motion 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.WHEEL_BLOCK_SCROLL, WHEEL_UNIT_SCROLL
BUTTON1, BUTTON2, BUTTON3, MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_FIRST, MOUSE_LAST, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_WHEEL, NOBUTTON
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
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
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
source
Modifier | Constructor and Description |
---|---|
protected |
PSwingMouseWheelEvent(int id,
MouseWheelEvent swingEvent,
PInputEvent piccoloEvent)
Constructs a new PMouseWheel event from a Java MouseWheelEvent.
|
Modifier and Type | Method and Description |
---|---|
MouseEvent |
asMouseEvent()
Returns this event as a mouse event.
|
void |
dispatchTo(Object listener)
Calls appropriate method on the listener based on this events ID.
|
PNode |
getCurrentNode()
Get the current node that is under the cursor.
|
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.
|
PNode |
getGrabNode()
Determine the node the event originated at.
|
PPickPath |
getGrabPath()
Return the path from the PCanvas down to the currently grabbed object.
|
int |
getID()
Determine the event type.
|
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.
|
PNode |
getNode()
Determine the node the event originated at.
|
PPickPath |
getPath()
Determine the path the event took from the PCanvas down to the visual
component.
|
void |
setSource(Object newSource)
Set the souce of this event.
|
getPreciseWheelRotation, getScrollAmount, getScrollType, getUnitsToScroll, getWheelRotation, paramString
getButton, getClickCount, getLocationOnScreen, getModifiersEx, getMouseModifiersText, getPoint, getX, getXOnScreen, getY, getYOnScreen, isPopupTrigger, translatePoint
consume, getMaskForButton, getModifiers, getModifiersExText, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown
getComponent
getSource
protected PSwingMouseWheelEvent(int id, MouseWheelEvent swingEvent, PInputEvent piccoloEvent)
id
- The event type (MOUSE_WHEEL)swingEvent
- The original swing mouse wheel event.piccoloEvent
- Piccolo2D event for use when querying about the
event's piccolo2d contextpublic Point2D getLocalPoint()
getLocalPoint
in interface PSwingEvent
public double getLocalX()
getLocalX
in interface PSwingEvent
public double getLocalY()
getLocalY
in interface PSwingEvent
public int getID()
getID
in interface PSwingEvent
getID
in class AWTEvent
public PNode getNode()
getNode
in interface PSwingEvent
public PPickPath getPath()
getPath
in interface PSwingEvent
public PNode getGrabNode()
getGrabNode
in interface PSwingEvent
public PPickPath getGrabPath()
getGrabPath
in interface PSwingEvent
public PNode getCurrentNode()
getCurrentNode
in interface PSwingEvent
public PPickPath getCurrentPath()
getCurrentPath
in interface PSwingEvent
public void dispatchTo(Object listener)
dispatchTo
in interface PSwingEvent
listener
- the target for dispatch.public void setSource(Object newSource)
setSource
in interface PSwingEvent
setSource
in class AWTEvent
newSource
- the current source of the event to reportpublic MouseEvent asMouseEvent()
asMouseEvent
in interface PSwingEvent
Copyright © 1995-2012 Piccolo2D. All Rights Reserved.