edu.umd.cs.jazz.event
Class ZPanEventHandler
java.lang.Object
|
+--edu.umd.cs.jazz.event.ZFilteredEventHandler
|
+--edu.umd.cs.jazz.event.ZDragSequenceEventHandler
|
+--edu.umd.cs.jazz.event.ZPanEventHandler
- All Implemented Interfaces:
- ZEventHandler
- public class ZPanEventHandler
- extends ZDragSequenceEventHandler
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.
- Author:
- Benjamin B. Bederson
- , Jesse Grosjean
Method Summary |
protected void |
dragInScreenCoords(ZMouseEvent e, java.awt.geom.Dimension2D aScreenDelta)
When the dragging action occurs invoke pan . |
ZMouseFilter |
getMouseFilter()
Return the event filter. |
boolean |
isMoved()
Deprecated. As of Jazz version 1.2, use ZDragSequenceEventHandler.isDragging() instead.
|
void |
pan(ZMouseEvent e, java.awt.geom.Dimension2D aScreenDelta)
Pan the interaction camera. |
Methods inherited from class edu.umd.cs.jazz.event.ZDragSequenceEventHandler |
drag, endDrag, filteredMouseDragged, filteredMousePressed, filteredMouseReleased, getCurrentScreenDelta, getCurrentScreenPoint, getDragStartScreenPoint, getMinDragStartDistance, getMousePressedScreenPoint, getPreviousScreenPoint, isDragging, setIsDragging, setMinDragStartDistance, shouldStartDragInteraction, startDrag |
Methods inherited from class edu.umd.cs.jazz.event.ZFilteredEventHandler |
filteredKeyPressed, filteredKeyReleased, filteredKeyTyped, filteredMouseClicked, filteredMouseEntered, filteredMouseExited, filteredMouseMoved, getCurrentFilteredMouseEvent, getCurrentSelection, getFilteredEventDispatcher, getFilteredKeyEventSource, getFilteredMouseEventSource, getInteractionCamera, getTopCamera, isActive, setActive, setFilteredKeyEventSource, setFilteredMouseEventSource, setMouseFilter, wantsKeyEvents, wantsMouseEvents, wantsMouseMotionEvents |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_MIN_PAN_START_DISTANCE
public static int DEFAULT_MIN_PAN_START_DISTANCE
-
The default distance that the mouse needs to be dragged for a panning action to start. This value can be customized on a per instance basis by using
setMinDragStartDistance
.
ZPanEventHandler
public ZPanEventHandler(ZSceneGraphObject aFilteredMouseEventSource)
-
Constructs a new ZPanEventHandler.
- Parameters:
-
aFilteredMouseEventSource
- the source for filtered ZMouseEvents and ZMouseMotionEvents. See the ZFilteredEventHandler class comment to customize this behavior.
ZPanEventHandler
public ZPanEventHandler(ZSceneGraphObject aEventSource,
ZCamera aIgnoredCamera)
-
Deprecated. As of Jazz version 1.2, use
ZPanEventHandler(ZSceneGraphObject aEventSource)
instead.
getMouseFilter
public ZMouseFilter getMouseFilter()
-
Return the event filter. If the filter is null then create the default event filter for ZPanEventHandler, it filters out events that do not have BUTTON1 pressed.
-
- Overrides:
-
getMouseFilter
in class ZFilteredEventHandler
-
- Returns:
- the filter that is currently in effect.
dragInScreenCoords
protected void dragInScreenCoords(ZMouseEvent e,
java.awt.geom.Dimension2D aScreenDelta)
-
When the dragging action occurs invoke
pan
.
-
- Overrides:
-
dragInScreenCoords
in class ZDragSequenceEventHandler
-
- Parameters:
-
e
- the event causing the drag.
-
aScreenDelta
- the change in mouse position between the current and last mouse events.
pan
public void pan(ZMouseEvent e,
java.awt.geom.Dimension2D aScreenDelta)
-
Pan the interaction camera.
-
- Parameters:
-
e
- the event causing the pan.
-
aScreenDelta
- the change in mouse position between the current and last mouse events.
isMoved
public boolean isMoved()
-
Deprecated. As of Jazz version 1.2, use
ZDragSequenceEventHandler.isDragging()
instead.
-
Copyright � 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.