|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolox.pswing.PSwingEventHandler
public class PSwingEventHandler
Event handler to send MousePressed, MouseReleased, MouseMoved, MouseClicked, and MouseDragged events on Swing components within a PCanvas.
Constructor Summary | |
---|---|
PSwingEventHandler(PSwingCanvas canvas)
Constructs a new PSwingEventHandler for the given canvas. |
|
PSwingEventHandler(PSwingCanvas canvas,
PNode listenNode)
Constructs a new PSwingEventHandler for the given canvas, and a node that will receive the mouse events. |
Method Summary | |
---|---|
(package private) void |
dispatchEvent(PSwingEvent pSwingMouseEvent,
PInputEvent aEvent)
Determines if any Swing components in Piccolo2D should receive the given MouseEvent and forwards the event to that component. |
boolean |
isActive()
Returns if this event handler is active. |
void |
processEvent(PInputEvent aEvent,
int type)
Process a Piccolo2D event and (if active) dispatch the corresponding Swing event. |
(package private) void |
setActive(boolean active)
Sets whether this event handler can fire events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PSwingEventHandler(PSwingCanvas canvas, PNode listenNode)
canvas
- the canvas associated with this PSwingEventHandler.listenNode
- the node the mouse listeners will be attached to.public PSwingEventHandler(PSwingCanvas canvas)
canvas
- to associate this event handler toMethod Detail |
---|
void setActive(boolean active)
active
- true if this event handler can fire eventspublic boolean isActive()
void dispatchEvent(PSwingEvent pSwingMouseEvent, PInputEvent aEvent)
pSwingMouseEvent
- event being dispatchedaEvent
- Piccolo2D event translation of the pSwingMouseEventpublic void processEvent(PInputEvent aEvent, int type)
processEvent
in interface PInputEventListener
aEvent
- Piccolo2D event being tested for dispatch to swingtype
- is not used in this method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |