at.tuwien.ifs.somtoolbox.apps.viewer.handlers
Class AbstractDragSequenceEventHandler

java.lang.Object
  extended by edu.umd.cs.piccolo.event.PBasicInputEventHandler
      extended by edu.umd.cs.piccolo.event.PDragSequenceEventHandler
          extended by at.tuwien.ifs.somtoolbox.apps.viewer.handlers.AbstractDragSequenceEventHandler
All Implemented Interfaces:
edu.umd.cs.piccolo.event.PInputEventListener, EventListener
Direct Known Subclasses:
MyInputDragSequenceEventHandler, MyLabelDragSequenceEventHandler

public abstract class AbstractDragSequenceEventHandler
extends edu.umd.cs.piccolo.event.PDragSequenceEventHandler

An abstract sequence handler that implements common tasks as drag start an drag activity step methods. Subclasses in most cases will have to implement the PDragSequenceEventHandler.endDrag(PInputEvent) to do specific handling at the end of the dragging.

Version:
$Id: AbstractDragSequenceEventHandler.java 3589 2010-05-21 10:42:01Z mayer $
Author:
Rudolf Mayer

Field Summary
protected  String[] allowedNodeTypes
          Define what values for the PNode.getAttribute(Object) are acceptable to select a PNode for dragging.
protected  double clickX
           
protected  double clickY
           
protected  Point2D startPos
           
 
Constructor Summary
AbstractDragSequenceEventHandler()
           
 
Method Summary
protected  void dragActivityStep(edu.umd.cs.piccolo.event.PInputEvent e)
           
protected  void startDrag(edu.umd.cs.piccolo.event.PInputEvent e)
           
 
Methods inherited from class edu.umd.cs.piccolo.event.PDragSequenceEventHandler
drag, dragActivityFinalStep, dragActivityFirstStep, endDrag, getDragActivity, getMinDragStartDistance, getMousePressedCanvasPoint, isDragging, mouseDragged, mousePressed, mouseReleased, paramString, setIsDragging, setMinDragStartDistance, shouldStartDragInteraction, 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
 

Field Detail

startPos

protected Point2D startPos

clickX

protected double clickX

clickY

protected double clickY

allowedNodeTypes

protected String[] allowedNodeTypes
Define what values for the PNode.getAttribute(Object) are acceptable to select a PNode for dragging. Subclasses have to set values to this variable in their constructor, otherwise all PNodes will be dragable.

Constructor Detail

AbstractDragSequenceEventHandler

public AbstractDragSequenceEventHandler()
Method Detail

dragActivityStep

protected void dragActivityStep(edu.umd.cs.piccolo.event.PInputEvent e)
Overrides:
dragActivityStep in class edu.umd.cs.piccolo.event.PDragSequenceEventHandler

startDrag

protected void startDrag(edu.umd.cs.piccolo.event.PInputEvent e)
Overrides:
startDrag in class edu.umd.cs.piccolo.event.PDragSequenceEventHandler