public class PDragEventHandler extends PDragSequenceEventHandler
Constructor and Description |
---|
PDragEventHandler()
Constructs a drag event handler which defaults to not raising the node to
the top on drag.
|
Modifier and Type | Method and Description |
---|---|
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 |
getRaiseToTopOnPress()
Returns whether this drag event handler has been informed to raise nodes
to the top of all other on drag.
|
protected void |
setDraggedNode(PNode draggedNode)
Set's the node that is currently being dragged.
|
void |
setRaiseToTopOnPress(boolean raiseToTopOnPress)
Informs this drag event handler whether it should raise nodes to the top
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 setRaiseToTopOnDrag.
|
dragActivityFinalStep, dragActivityFirstStep, dragActivityStep, getDragActivity, getMinDragStartDistance, getMousePressedCanvasPoint, isDragging, mouseDragged, mousePressed, mouseReleased, setIsDragging, setMinDragStartDistance, startDragActivity, stopDragActivity
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelRotated, mouseWheelRotatedByBlock, processEvent, setEventFilter
public PDragEventHandler()
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 testedprotected 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 getRaiseToTopOnPress()
public void setRaiseToTopOnPress(boolean raiseToTopOnPress)
raiseToTopOnPress
- true if dragging a node should raise it to the
topCopyright © 1995-2013 Piccolo2D. All Rights Reserved.