edu.umd.cs.jazz.event
Class ZPanEventHandler

java.lang.Object
  |
  +--edu.umd.cs.jazz.event.ZPanEventHandler
All Implemented Interfaces:
java.util.EventListener, java.io.Serializable, ZEventHandler, ZMouseListener, ZMouseMotionListener

public class ZPanEventHandler
extends java.lang.Object
implements ZEventHandler, ZMouseListener, ZMouseMotionListener, java.io.Serializable

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.

This event handler will properly pan within internal cameras if the clicked within an internal camera.

Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.

Author:
Benjamin B. Bederson
See Also:
Serialized Form

Constructor Summary
ZPanEventHandler(ZNode node)
          Constructs a new ZPanEventHandler.
ZPanEventHandler(ZNode node, ZCamera camera)
          Constructs a new ZPanEventHandler.
 
Method Summary
 boolean isActive()
          Determines if this event handler is active.
 boolean isMoved()
          Returns true if the most recent button press/drag/release resulted in a pan movement.
 void mouseClicked(ZMouseEvent e)
          Invoked when the mouse has been clicked on a component.
 void mouseDragged(ZMouseEvent e)
          Mouse drag event handler
 void mouseEntered(ZMouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(ZMouseEvent e)
          Invoked when the mouse exits a component.
 void mouseMoved(ZMouseEvent e)
          Invoked when the mouse button has been moved on a node (with no buttons no down).
 void mousePressed(ZMouseEvent e)
          Mouse press event handler
 void mouseReleased(ZMouseEvent e)
          Mouse release event handler
 void setActive(boolean active)
          Specifies whether this event handler is active or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZPanEventHandler

public ZPanEventHandler(ZNode node)
Constructs a new ZPanEventHandler.
Parameters:
node - The node this event handler attaches to.

ZPanEventHandler

public ZPanEventHandler(ZNode node,
                        ZCamera camera)
Constructs a new ZPanEventHandler.
Parameters:
node - The node this event handler attaches to.
camera - The camera this event handler attaches to
Method Detail

setActive

public void setActive(boolean active)
Specifies whether this event handler is active or not.
Specified by:
setActive in interface ZEventHandler
Parameters:
active - True to make this event handler active

isActive

public boolean isActive()
Description copied from interface: ZEventHandler
Determines if this event handler is active.
Specified by:
isActive in interface ZEventHandler
Returns:
Is this event handler active?

mousePressed

public void mousePressed(ZMouseEvent e)
Mouse press event handler
Specified by:
mousePressed in interface ZMouseListener
Parameters:
e - The event.

mouseDragged

public void mouseDragged(ZMouseEvent e)
Mouse drag event handler
Specified by:
mouseDragged in interface ZMouseMotionListener
Parameters:
e - The event.

mouseReleased

public void mouseReleased(ZMouseEvent e)
Mouse release event handler
Specified by:
mouseReleased in interface ZMouseListener
Parameters:
e - The event.

mouseEntered

public void mouseEntered(ZMouseEvent e)
Invoked when the mouse enters a component.
Specified by:
mouseEntered in interface ZMouseListener

mouseExited

public void mouseExited(ZMouseEvent e)
Invoked when the mouse exits a component.
Specified by:
mouseExited in interface ZMouseListener

mouseClicked

public void mouseClicked(ZMouseEvent e)
Invoked when the mouse has been clicked on a component.
Specified by:
mouseClicked in interface ZMouseListener

mouseMoved

public void mouseMoved(ZMouseEvent e)
Invoked when the mouse button has been moved on a node (with no buttons no down).
Specified by:
mouseMoved in interface ZMouseMotionListener

isMoved

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


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