|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.event.PInputEvent
public class PInputEvent
PInputEvent is used to notify PInputEventListeners of keyboard and mouse input. It has methods for normal event properties such as event modifier keys and event canvas location.
In addition is has methods to get the mouse position and delta in a variety of coordinate systems.
Last of all it provides access to the dispatch manager that can be queried to find the current mouse over, mouse focus, and keyboard focus.
Constructor Summary | |
---|---|
PInputEvent(PInputManager inputManager,
java.awt.event.InputEvent event)
|
Method Summary | |
---|---|
int |
getButton()
|
PCamera |
getCamera()
Return the bottom most camera that is currently painting. |
PDimension |
getCanvasDelta()
Return the delta between the last and current mouse position in PCanvas coordinates. |
java.awt.geom.Point2D |
getCanvasPosition()
Return the mouse position in PCanvas coordinates. |
int |
getClickCount()
|
PComponent |
getComponent()
Get the canvas associated with the top camera. |
PDimension |
getDelta()
Return the delta between the last and current mouse positions transformed through the view transform of the bottom camera. |
PDimension |
getDeltaRelativeTo(PNode nodeOnPath)
Return the delta between the last and current mouse positions relative to a given node on the pick path. |
PInputManager |
getInputManager()
Return the input manager that dispatched this event. |
char |
getKeyChar()
|
int |
getKeyCode()
|
int |
getKeyLocation()
|
int |
getModifiers()
|
int |
getModifiersEx()
|
PPickPath |
getPath()
Return the PPickPath associated with this input event. |
PNode |
getPickedNode()
Return the bottom node on the current pickpath, that is the picked node furthest from the root node. |
java.awt.geom.Point2D |
getPosition()
Return the mouse position transformed through the view transform of the bottom camera. |
java.awt.geom.Point2D |
getPositionRelativeTo(PNode nodeOnPath)
Return the mouse position relative to a given node on the pick path. |
java.awt.event.InputEvent |
getSourceSwingEvent()
|
PCamera |
getTopCamera()
Return the topmost camera this is painting. |
int |
getWheelRotation()
|
long |
getWhen()
|
boolean |
isActionKey()
|
boolean |
isAltDown()
|
boolean |
isControlDown()
|
boolean |
isFocusEvent()
|
boolean |
isHandled()
Return true if another event handler has already handled this event. |
boolean |
isKeyEvent()
|
boolean |
isLeftMouseButton()
|
boolean |
isMetaDown()
|
boolean |
isMiddleMouseButton()
|
boolean |
isMouseEnteredOrMouseExited()
|
boolean |
isMouseEvent()
|
boolean |
isMouseWheelEvent()
|
boolean |
isPopupTrigger()
Returns whether or not this event is a popup menu trigger event for the platform. |
boolean |
isRightMouseButton()
|
boolean |
isShiftDown()
|
void |
popCursor()
|
void |
pushCursor(java.awt.Cursor cursor)
|
void |
setHandled(boolean handled)
Set that this event has been handled by an event handler. |
void |
setPath(PPickPath path)
|
java.lang.String |
toString()
Returns a string representation of this object for debugging purposes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PInputEvent(PInputManager inputManager, java.awt.event.InputEvent event)
Method Detail |
---|
public void pushCursor(java.awt.Cursor cursor)
public void popCursor()
public PCamera getCamera()
public PCamera getTopCamera()
public PComponent getComponent()
public PInputManager getInputManager()
public PPickPath getPath()
public void setPath(PPickPath path)
public PNode getPickedNode()
public int getKeyCode()
public char getKeyChar()
public int getKeyLocation()
public boolean isActionKey()
public int getModifiers()
public int getModifiersEx()
public int getClickCount()
public long getWhen()
public boolean isAltDown()
public boolean isControlDown()
public boolean isMetaDown()
public boolean isShiftDown()
public boolean isLeftMouseButton()
public boolean isMiddleMouseButton()
public boolean isRightMouseButton()
public boolean isHandled()
public void setHandled(boolean handled)
public int getButton()
public int getWheelRotation()
public java.awt.event.InputEvent getSourceSwingEvent()
public boolean isKeyEvent()
public boolean isMouseEvent()
public boolean isMouseWheelEvent()
public boolean isFocusEvent()
public boolean isMouseEnteredOrMouseExited()
public boolean isPopupTrigger()
Note: Popup menus are triggered differently on different
systems. Therefore, isPopupTrigger
should be checked in both
mousePressed
and mouseReleased
for proper
cross-platform functionality.
java.lang.IllegalStateException
- if this event is not a mouse eventpublic java.awt.geom.Point2D getCanvasPosition()
public PDimension getCanvasDelta()
public java.awt.geom.Point2D getPositionRelativeTo(PNode nodeOnPath)
public PDimension getDeltaRelativeTo(PNode nodeOnPath)
public java.awt.geom.Point2D getPosition()
public PDimension getDelta()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |