|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.event.PBasicInputEventHandler
public class PBasicInputEventHandler
PBasicInputEventHandler is the standard class in Piccolo that is used to register for mouse and keyboard events on a PNode. Note the events that you get depends on the node that you have registered with. For example you will only get mouse moved events when the mouse is over the node that you have registered with, not when the mouse is over some other node.
Constructor Summary | |
---|---|
PBasicInputEventHandler()
Constructs a PBasicInputEventHandler with a wide open event filter. |
Method Summary | |
---|---|
boolean |
acceptsEvent(PInputEvent event,
int type)
Returns true if the event would be dispatched if passed to processEvent. |
PInputEventFilter |
getEventFilter()
Returns the event filter responsible for filtering incoming events. |
void |
keyboardFocusGained(PInputEvent event)
This method is invoked when a node gains the keyboard focus. |
void |
keyboardFocusLost(PInputEvent event)
This method is invoked when a node loses the keyboard focus. |
void |
keyPressed(PInputEvent event)
Will get called whenever a key has been pressed down. |
void |
keyReleased(PInputEvent event)
Will get called whenever a key has been released. |
void |
keyTyped(PInputEvent event)
Will be called at the end of a full keystroke (down then up). |
void |
mouseClicked(PInputEvent event)
Will be called at the end of a full click (mouse pressed followed by mouse released). |
void |
mouseDragged(PInputEvent event)
Will be called when a drag is occurring. |
void |
mouseEntered(PInputEvent event)
Will be invoked when the mouse enters a specified region. |
void |
mouseExited(PInputEvent event)
Will be invoked when the mouse leaves a specified region. |
void |
mouseMoved(PInputEvent event)
Will be called when the mouse is moved. |
void |
mousePressed(PInputEvent event)
Will be called when a mouse button is pressed down. |
void |
mouseReleased(PInputEvent event)
Will be called when any mouse button is released. |
void |
mouseWheelRotated(PInputEvent event)
This method is invoked when the mouse wheel is rotated. |
void |
mouseWheelRotatedByBlock(PInputEvent event)
This method is invoked when the mouse wheel is rotated by a block. |
protected String |
paramString()
Deprecated. see http://code.google.com/p/piccolo2d/issues/detail?id=99 |
void |
processEvent(PInputEvent event,
int type)
Dispatches a generic event to a more specific method. |
void |
setEventFilter(PInputEventFilter newEventFilter)
Changes this event handler's filter to the one provided. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PBasicInputEventHandler()
Method Detail |
---|
public void processEvent(PInputEvent event, int type)
processEvent
in interface PInputEventListener
event
- the event to be dispatchedtype
- Swing event type of the underlying Swing eventpublic boolean acceptsEvent(PInputEvent event, int type)
event
- event being tested for acceptancetype
- Swing event type of underlying swing event
public PInputEventFilter getEventFilter()
public void setEventFilter(PInputEventFilter newEventFilter)
newEventFilter
- filter to use for this input event handlerpublic void keyPressed(PInputEvent event)
event
- the event representing the keystrokepublic void keyReleased(PInputEvent event)
event
- the event representing the keystrokepublic void keyTyped(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseClicked(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mousePressed(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseDragged(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseEntered(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseExited(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseMoved(PInputEvent event)
event
- object which can be queried for event detailspublic void mouseReleased(PInputEvent event)
event
- object which can be queried for event detailspublic void mouseWheelRotated(PInputEvent event)
event
- an object that can be queries to discover the event's
detailspublic void mouseWheelRotatedByBlock(PInputEvent event)
event
- an object that can be queries to discover the event's
detailspublic void keyboardFocusGained(PInputEvent event)
event
- an object that can be queries to discover the event's
detailspublic void keyboardFocusLost(PInputEvent event)
event
- an object that can be queries to discover the event's
detailsprotected String paramString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |