edu.umd.cs.jazz.event
Class ZPanEventHandler

java.lang.Object
  |
  +--edu.umd.cs.jazz.event.ZEventHandler
        |
        +--edu.umd.cs.jazz.event.ZPanEventHandler

public class ZPanEventHandler
extends ZEventHandler

ZPanEventHandler provides event handlers for basic panning of a Jazz camera with the left mouse. The interaction is that clicking and dragging the mouse translates the camera so that the point on the surface stays under the mouse.


Field Summary
protected  int minMovement
           
protected  boolean moved
           
protected  java.awt.geom.Point2D pressObjPt
           
protected  java.awt.geom.Point2D pressScreenPt
           
 
Fields inherited from class edu.umd.cs.jazz.event.ZEventHandler
activated, component, keyAdapter, mouseAdapter, mouseMotionAdapter, surface
 
Constructor Summary
ZPanEventHandler(java.awt.Component c, ZSurface v)
          Constructs a new ZPanEventHandler.
 
Method Summary
 void mouseDragged(java.awt.event.MouseEvent e)
          Mouse drag event handler
 void mousePressed(java.awt.event.MouseEvent e)
          Mouse press event handler
 void mouseReleased(java.awt.event.MouseEvent e)
          Mouse release event handler
 boolean moved()
          Returns true if the most recent button press/drag/release resulted in a pan movement.
 
Methods inherited from class edu.umd.cs.jazz.event.ZEventHandler
activate, deactivate, getCamera, getComponent, getSurface, keyPressed, keyReleased, keyTyped, mouseMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minMovement

protected int minMovement

pressObjPt

protected java.awt.geom.Point2D pressObjPt

moved

protected boolean moved

pressScreenPt

protected java.awt.geom.Point2D pressScreenPt
Constructor Detail

ZPanEventHandler

public ZPanEventHandler(java.awt.Component c,
                        ZSurface v)
Constructs a new ZPanEventHandler.
Parameters:
c - The component that this event handler listens to events on
v - The surface that is panned
Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Mouse press event handler
Parameters:
e - The event.
Overrides:
mousePressed in class ZEventHandler

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Mouse drag event handler
Parameters:
e - The event.
Overrides:
mouseDragged in class ZEventHandler

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Mouse release event handler
Parameters:
e - The event.
Overrides:
mouseReleased in class ZEventHandler

moved

public boolean moved()
Returns true if the most recent button press/drag/release resulted in a pan movement.
Returns:
moved