edu.umd.cs.piccolo.event
Class PDragEventHandler

java.lang.Object
  extended by edu.umd.cs.piccolo.event.PBasicInputEventHandler
      extended by edu.umd.cs.piccolo.event.PDragSequenceEventHandler
          extended by edu.umd.cs.piccolo.event.PDragEventHandler
All Implemented Interfaces:
PInputEventListener, java.util.EventListener

public class PDragEventHandler
extends PDragSequenceEventHandler

PDragEventHandler is a simple event handler for dragging a node on the canvas.

Version:
1.0
Author:
Jesse Grosjean

Constructor Summary
PDragEventHandler()
           
 
Method Summary
protected  void drag(PInputEvent event)
          Subclasses should override this method to get notified of the drag events in a drag sequence.
protected  void endDrag(PInputEvent event)
          Subclasses should override this method to get notified of the end event in a drag sequence.
protected  PNode getDraggedNode()
           
 boolean getMoveToFrontOnPress()
           
protected  java.lang.String paramString()
          Returns a string representing the state of this node.
protected  void setDraggedNode(PNode draggedNode)
           
 void setMoveToFrontOnPress(boolean moveToFrontOnPress)
           
protected  boolean shouldStartDragInteraction(PInputEvent event)
           
protected  void startDrag(PInputEvent event)
          Subclasses should override this method to get notified of the start of a new drag sequence.
 
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, processEvent, setEventFilter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDragEventHandler

public PDragEventHandler()
Method Detail

getDraggedNode

protected PNode getDraggedNode()

setDraggedNode

protected void setDraggedNode(PNode draggedNode)

shouldStartDragInteraction

protected boolean shouldStartDragInteraction(PInputEvent event)
Overrides:
shouldStartDragInteraction in class PDragSequenceEventHandler

startDrag

protected void startDrag(PInputEvent event)
Description copied from class: PDragSequenceEventHandler
Subclasses should override this method to get notified of the start of a new drag sequence. Note that that overriding methods must still call super.startDrag() for correct behavior.

Overrides:
startDrag in class PDragSequenceEventHandler

drag

protected void drag(PInputEvent event)
Description copied from class: PDragSequenceEventHandler
Subclasses should override this method to get notified of the drag events in a drag sequence. Note that that overriding methods must still call super.startDrag() for correct behavior.

Overrides:
drag in class PDragSequenceEventHandler

endDrag

protected void endDrag(PInputEvent event)
Description copied from class: PDragSequenceEventHandler
Subclasses should override this method to get notified of the end event in a drag sequence. Note that that overriding methods must still call super.startDrag() for correct behavior.

Overrides:
endDrag in class PDragSequenceEventHandler

getMoveToFrontOnPress

public boolean getMoveToFrontOnPress()

setMoveToFrontOnPress

public void setMoveToFrontOnPress(boolean moveToFrontOnPress)

paramString

protected java.lang.String paramString()
Returns a string representing the state of this node. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString in class PDragSequenceEventHandler
Returns:
a string representation of this node's state


Copyright © 2008 by University of Maryland, College Park, MD 20742, USA All rights reserved.