|
||||||||||
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.event.PDragSequenceEventHandler
edu.umd.cs.piccolo.event.PDragEventHandler
public class PDragEventHandler
PDragEventHandler is a simple event handler for dragging a node on the canvas.
Constructor Summary | |
---|---|
PDragEventHandler()
Constructs a drag event handler which defaults to not moving the node to the front on drag. |
Method Summary | |
---|---|
protected void |
drag(PInputEvent event)
Moves the dragged node in proportion to the drag distance. |
protected void |
endDrag(PInputEvent event)
Clears the current drag node. |
protected PNode |
getDraggedNode()
Returns the node that is currently being dragged, or null if none. |
boolean |
getMoveToFrontOnPress()
Returns whether this drag event handler has been informed to move nodes to the front of all other on drag. |
protected void |
setDraggedNode(PNode draggedNode)
Set's the node that is currently being dragged. |
void |
setMoveToFrontOnPress(boolean moveToFrontOnPress)
Informs this drag event handler whether it should move nodes to the front when they are dragged. |
protected boolean |
shouldStartDragInteraction(PInputEvent event)
Returns whether the given event should be start a drag interaction. |
protected void |
startDrag(PInputEvent event)
Starts a drag event and moves the dragged node to the front if this handler has been directed to do so with a call to setMoveToFrontOnDrag. |
Methods inherited from class edu.umd.cs.piccolo.event.PDragSequenceEventHandler |
---|
dragActivityFinalStep, dragActivityFirstStep, dragActivityStep, getDragActivity, getMinDragStartDistance, getMousePressedCanvasPoint, isDragging, mouseDragged, mousePressed, mouseReleased, setIsDragging, setMinDragStartDistance, startDragActivity, stopDragActivity |
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler |
---|
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelRotated, mouseWheelRotatedByBlock, paramString, processEvent, setEventFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDragEventHandler()
Method Detail |
---|
protected PNode getDraggedNode()
protected void setDraggedNode(PNode draggedNode)
draggedNode
- node to be flagged as this handler's current drag nodeprotected boolean shouldStartDragInteraction(PInputEvent event)
shouldStartDragInteraction
in class PDragSequenceEventHandler
event
- the event being tested
protected void startDrag(PInputEvent event)
startDrag
in class PDragSequenceEventHandler
event
- The Event responsible for the start of the dragprotected void drag(PInputEvent event)
drag
in class PDragSequenceEventHandler
event
- event representing the dragprotected void endDrag(PInputEvent event)
endDrag
in class PDragSequenceEventHandler
event
- Event reponsible for the end of the drag. Usually a
"Mouse Up" event.public boolean getMoveToFrontOnPress()
public void setMoveToFrontOnPress(boolean moveToFrontOnPress)
moveToFrontOnPress
- true if dragging a node should move it to the
front
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |