|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.event.ZFilteredEventHandler | +--edu.umd.cs.jazz.event.ZDragSequenceEventHandler | +--edu.umd.cs.jazz.event.ZoomEventHandler
ZoomEventhandler provides event handlers for basic zooming of a Jazz camera with the right button. The interaction is that the initial mouse press defines the zoom anchor point, and then moving the mouse to the right zooms with a speed proportional to the amount the mouse is moved to the right of the anchor point. Similarly, if the mouse is moved to the left, the the camera is zoomed out.
On a Mac with its single mouse button one may wish to change the standard right mouse button zooming behavior. This can be easily done with the ZMouseFilter. For example to zoom with button one and shift you would do this:
zoomEventHandler.getMouseFilter().setAndMask(InputEvent.BUTTON1_MASK |
InputEvent.SHIFT_MASK);
This event handler will properly pan within internal cameras if the clicked within an internal camera.
Nested Class Summary |
Nested classes inherited from class edu.umd.cs.jazz.event.ZFilteredEventHandler |
ZFilteredEventHandler.ZFilteredEventDispatcher |
Field Summary |
Fields inherited from class edu.umd.cs.jazz.event.ZFilteredEventHandler |
fFilteredEventDispatcher, fMouseFilter |
Constructor Summary | |
ZoomEventHandler(ZSceneGraphObject aFilteredMouseEventSource) Constructs a new ZoomEventHandler. |
Method Summary | |
protected void |
endDrag(ZMouseEvent e) When the dragging action ends invoke stopZooming . |
protected java.awt.geom.AffineTransform |
generateNextViewTransform() Return the next view transform for the current cameras zooming sequence. |
double |
getMaxMagnification() Return the max magnification that the zooming action is bound by. |
double |
getMinMagnification() Return the min magnification that the zooming action is bound by. |
ZMouseFilter |
getMouseFilter() Return the current event filter. |
protected boolean |
isZooming() Return if is zooming. |
protected void |
isZooming(boolean aBoolean) Set if is zooming. |
void |
setMaxMagnification(double aMagnification) Set the maximum magnification that the camera can be set to with this event handler. |
void |
setMinMagnification(double aMagnification) Set the minimum magnification that the camera can be set to with this event handler. |
protected void |
startDrag(ZMouseEvent e) When the dragging action starts invoke startZooming . |
protected void |
startZooming(ZMouseEvent e) Start zooming around the given mouse point with the interaction camera. |
protected void |
stopZooming(ZMouseEvent e) Stop animated zooming. |
protected void |
zoomOneStep() Do one zooming step, sleep a short amount, and schedule the next zooming step. |
Methods inherited from class edu.umd.cs.jazz.event.ZDragSequenceEventHandler |
drag, dragInScreenCoords, filteredMouseDragged, filteredMousePressed, filteredMouseReleased, getCurrentScreenDelta, getCurrentScreenPoint, getDragStartScreenPoint, getMinDragStartDistance, getMousePressedScreenPoint, getPreviousScreenPoint, isDragging, setIsDragging, setMinDragStartDistance, shouldStartDragInteraction |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZoomEventHandler(ZSceneGraphObject aFilteredMouseEventSource)
aFilteredMouseEventSource
- the source for filtered ZMouseEvents and ZMouseMotionEvents. See the ZFilteredEventHandler class comment to customize this behavior.Method Detail |
protected void endDrag(ZMouseEvent e)
stopZooming
.
endDrag
in class ZDragSequenceEventHandler
e
- the event causing the end of the drag sequence.protected java.awt.geom.AffineTransform generateNextViewTransform()
public double getMaxMagnification()
public double getMinMagnification()
public ZMouseFilter getMouseFilter()
getMouseFilter
in class ZFilteredEventHandler
protected boolean isZooming()
protected void isZooming(boolean aBoolean)
public void setMaxMagnification(double aMagnification)
public void setMinMagnification(double aMagnification)
protected void startDrag(ZMouseEvent e)
startZooming
.
startDrag
in class ZDragSequenceEventHandler
e
- the event starting the drag sequence.protected void startZooming(ZMouseEvent e)
protected void stopZooming(ZMouseEvent e)
protected void zoomOneStep()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |