|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.event.PBasicInputEventHandler
edu.umd.cs.piccolo.PInputManager
public class PInputManager
PInputManager is responsible for dispatching PInputEvents to node's event listeners. Events are dispatched from PRoot's processInputs method.
PInputEvent
,
PRoot
Constructor Summary | |
---|---|
PInputManager()
Creates a PInputManager and sets positions (last, current) to the origin (0,0). |
Method Summary | |
---|---|
protected void |
checkForMouseEnteredAndExited(PInputEvent event)
Fires events whenever the mouse moves from PNode to PNode. |
java.awt.geom.Point2D |
getCurrentCanvasPosition()
Returns the position of the current canvas event. |
PInputEventListener |
getKeyboardFocus()
Return the node that currently has the keyboard focus. |
java.awt.geom.Point2D |
getLastCanvasPosition()
Returns the position on the Canvas of the last event. |
PPickPath |
getMouseFocus()
Return the current Pick Path under the mouse focus. |
PPickPath |
getMouseOver()
Return the node the the mouse is currently over. |
void |
keyPressed(PInputEvent event)
|
void |
keyReleased(PInputEvent event)
|
void |
keyTyped(PInputEvent event)
|
void |
mouseClicked(PInputEvent event)
|
void |
mouseDragged(PInputEvent event)
|
void |
mouseEntered(PInputEvent event)
|
void |
mouseExited(PInputEvent event)
|
void |
mouseMoved(PInputEvent event)
|
void |
mousePressed(PInputEvent event)
|
void |
mouseReleased(PInputEvent event)
|
void |
mouseWheelRotated(PInputEvent event)
|
void |
mouseWheelRotatedByBlock(PInputEvent event)
|
void |
processEventFromCamera(java.awt.event.InputEvent event,
int type,
PCamera camera)
Flags the given event as needing to be processed. |
void |
processInput()
Causes the system to process any pending Input Events. |
void |
setKeyboardFocus(PInputEventListener eventHandler)
Set the node that should receive key events. |
void |
setMouseFocus(PPickPath path)
Sets the current Pick Path under the mouse focus. |
void |
setMouseOver(PPickPath path)
Records the path which is directly below the mouse. |
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler |
---|
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, paramString, processEvent, setEventFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PInputManager()
Method Detail |
---|
public PInputEventListener getKeyboardFocus()
public void setKeyboardFocus(PInputEventListener eventHandler)
eventHandler
- sets the keyboard event focus, may be nullpublic PPickPath getMouseFocus()
public void setMouseFocus(PPickPath path)
path
- the new mouse focuspublic PPickPath getMouseOver()
public void setMouseOver(PPickPath path)
path
- path over which the mouse has been movedpublic java.awt.geom.Point2D getLastCanvasPosition()
public java.awt.geom.Point2D getCurrentCanvasPosition()
public void keyPressed(PInputEvent event)
keyPressed
in class PBasicInputEventHandler
public void keyReleased(PInputEvent event)
keyReleased
in class PBasicInputEventHandler
public void keyTyped(PInputEvent event)
keyTyped
in class PBasicInputEventHandler
public void mouseClicked(PInputEvent event)
mouseClicked
in class PBasicInputEventHandler
public void mouseWheelRotated(PInputEvent event)
mouseWheelRotated
in class PBasicInputEventHandler
public void mouseWheelRotatedByBlock(PInputEvent event)
mouseWheelRotatedByBlock
in class PBasicInputEventHandler
public void mouseDragged(PInputEvent event)
mouseDragged
in class PBasicInputEventHandler
public void mouseEntered(PInputEvent event)
mouseEntered
in class PBasicInputEventHandler
public void mouseExited(PInputEvent event)
mouseExited
in class PBasicInputEventHandler
public void mouseMoved(PInputEvent event)
mouseMoved
in class PBasicInputEventHandler
public void mousePressed(PInputEvent event)
mousePressed
in class PBasicInputEventHandler
public void mouseReleased(PInputEvent event)
mouseReleased
in class PBasicInputEventHandler
protected void checkForMouseEnteredAndExited(PInputEvent event)
event
- to check to see if the top node has changed.public void processInput()
processInput
in interface PRoot.InputSource
public void processEventFromCamera(java.awt.event.InputEvent event, int type, PCamera camera)
event
- the event to be processedtype
- type of event to be processedcamera
- camera from which the event was dispatched
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |