|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--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.
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.
| Inner Class Summary | |
protected class |
ZoomEventHandler.ZoomEventState
Provides indirect access this event handlers private state. |
| Constructor Summary | |
ZoomEventHandler(ZNode node)
Constructs a new ZoomEventHandler. |
|
ZoomEventHandler(ZNode node,
ZCamera camera)
Constructs a new ZoomEventHandler. |
|
| Method Summary | |
protected java.awt.geom.AffineTransform |
generateNextViewTransform(ZoomEventHandler.ZoomEventState state)
Return the next view transform for the interaction cameras zooming sequence. |
boolean |
isActive()
Determines if this event handler is active. |
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. |
void |
setMaxMagnification(double newMaxMag)
Set the maximum magnification that the camera can be set to with this event handler. |
void |
setMinMagnification(double newMinMag)
Set the minimum magnification that the camera can be set to with this event handler. |
void |
startZooming()
Start animated zooming. |
void |
stopZooming()
Stop animated zooming. |
void |
zoomOneStep()
Do one zooming step, sleep a short amount, and schedule the next zooming step. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ZoomEventHandler(ZNode node)
node - The node this event handler attaches to.
public ZoomEventHandler(ZNode node,
ZCamera camera)
node - The node this event handler attaches to.camera - The camera to which this event handler attaches| Method Detail |
public void setActive(boolean active)
setActive in interface ZEventHandleractive - True to make this event handler activepublic boolean isActive()
isActive in interface ZEventHandlerpublic void mousePressed(ZMouseEvent e)
mousePressed in interface ZMouseListenere - The event.public void mouseDragged(ZMouseEvent e)
mouseDragged in interface ZMouseMotionListenere - The event.public void mouseReleased(ZMouseEvent e)
mouseReleased in interface ZMouseListenere - The event.public void mouseEntered(ZMouseEvent e)
mouseEntered in interface ZMouseListenerpublic void mouseExited(ZMouseEvent e)
mouseExited in interface ZMouseListenerpublic void mouseClicked(ZMouseEvent e)
mouseClicked in interface ZMouseListenerpublic void mouseMoved(ZMouseEvent e)
mouseMoved in interface ZMouseMotionListenerpublic void startZooming()
public void setMinMagnification(double newMinMag)
newMinMag - the new minimum magnificationpublic void setMaxMagnification(double newMaxMag)
newMaxMag - the new maximum magnificationpublic void stopZooming()
public void zoomOneStep()
protected java.awt.geom.AffineTransform generateNextViewTransform(ZoomEventHandler.ZoomEventState state)
state - provides access to the current state of the event handler.
ZoomEventState is declared as a protected inner class in ZoomEventHandler.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||