edu.umd.cs.piccolo.event
Class PPanEventHandler

java.lang.Object
  extended byedu.umd.cs.piccolo.event.PBasicInputEventHandler
      extended byedu.umd.cs.piccolo.event.PDragSequenceEventHandler
          extended byedu.umd.cs.piccolo.event.PPanEventHandler
All Implemented Interfaces:
java.util.EventListener, PInputEventListener

public class PPanEventHandler
extends PDragSequenceEventHandler

PPanEventHandler provides event handlers for basic panning of the canvas view with the left mouse. The interaction is that clicking and dragging the mouse translates the view so that the point on the surface stays under the mouse.

Version:
1.0
Author:
Jesse Grosjean

Constructor Summary
PPanEventHandler()
           
 
Method Summary
protected  void drag(PInputEvent e)
          Subclasses should override this method to get notified of the drag events in a drag sequence.
protected  void dragActivityStep(PInputEvent aEvent)
          Do auto panning even when the mouse is not moving.
 boolean getAutopan()
           
protected  void pan(PInputEvent e)
           
protected  java.lang.String paramString()
          Returns a string representing the state of this node.
 void setAutopan(boolean autopan)
           
 void setMaxAutopanSpeed(double maxAutopanSpeed)
          Set the maxAutoPan speed in pixes per second.
 void setMinAutopanSpeed(double minAutopanSpeed)
          Set the minAutoPan speed in pixels per second.
protected  double validatePanningSpeed(double delta)
           
 
Methods inherited from class edu.umd.cs.piccolo.event.PDragSequenceEventHandler
dragActivityFinalStep, dragActivityFirstStep, endDrag, getDragActivity, getMinDragStartDistance, getMousePressedCanvasPoint, isDragging, mouseDragged, mousePressed, mouseReleased, setIsDragging, setMinDragStartDistance, shouldStartDragInteraction, startDrag, 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

PPanEventHandler

public PPanEventHandler()
Method Detail

drag

protected void drag(PInputEvent e)
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

pan

protected void pan(PInputEvent e)

setAutopan

public void setAutopan(boolean autopan)

getAutopan

public boolean getAutopan()

setMinAutopanSpeed

public void setMinAutopanSpeed(double minAutopanSpeed)
Set the minAutoPan speed in pixels per second.

Parameters:
minAutopanSpeed -

setMaxAutopanSpeed

public void setMaxAutopanSpeed(double maxAutopanSpeed)
Set the maxAutoPan speed in pixes per second.

Parameters:
maxAutopanSpeed -

dragActivityStep

protected void dragActivityStep(PInputEvent aEvent)
Do auto panning even when the mouse is not moving.

Overrides:
dragActivityStep in class PDragSequenceEventHandler

validatePanningSpeed

protected double validatePanningSpeed(double delta)

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 2004 by University of Maryland, College Park, MD 20742, USA All rights reserved.