|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.event.ZoomToEventHandler
ZoomToEventhandler provides the ability to zoom the current camera to a target node on the drawing surface. On a double click with the right mouse button this event handler will zoom to the node that picked by the mouse click. If no object was picked then it will zoom to its default zoom to node that is specified when the event handler is created or by setDefaultZoomToNode(). The event handler uses two methods to zoom into a target node. The method to use is set by makeZoomToScale(aScale) and makeZoomToScreen(aSpacing).
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.
Constructor Summary | |
ZoomToEventHandler(ZNode aNode)
Constructs a new ZoomToEventHandler. |
|
ZoomToEventHandler(ZNode aNode,
ZNode aDefaultZoomToNode)
Constructs a new ZoomToEventHandler. |
Method Summary | |
protected ZCamera |
getCameraToZoomWith(ZSceneGraphPath aPath)
Get the camera from the scene graph path that we will use to perform the zoom. |
protected ZNode |
getNodeToZoomTo(ZSceneGraphPath aPath)
Get the node the use for the target of the zoom. |
int |
getZoomTime()
Get the amount of time that the zoom animation will take. |
boolean |
isActive()
Determines if this event handler is active. |
void |
makeZoomToScale(double aScale)
This method puts the event handler in zoom to scale mode. |
void |
makeZoomToScreen(double aSpacing)
This method puts the event handler in zoom to screen mode. |
void |
mouseClicked(ZMouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseEntered(ZMouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(ZMouseEvent e)
Invoked when the mouse exits a component. |
void |
mousePressed(ZMouseEvent e)
If the mouse is double clicked then zoom into the picked node. |
void |
mouseReleased(ZMouseEvent e)
Mouse release event handler |
void |
setActive(boolean active)
Specifies whether this event handler is active or not. |
void |
setDefaultZoomToNode(ZNode aNode)
Set the default node to zoom to. |
int |
setZoomTime(int aTime)
Set the amount of time that the zoom animation will take. |
protected void |
zoomToScaleWith(ZCamera aCamera,
ZNode aNode)
Zoom the specified camera so that the specified target node appears at a certain scale on the screen. |
protected void |
zoomToScreenWith(ZCamera aCamera,
ZNode aNode)
Zoom the specified camera so that the specified target node fills the screen minus the spacing set in makeZoomToScreen(aSpacing); |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZoomToEventHandler(ZNode aNode)
aNode
- The node this event handler attaches to.public ZoomToEventHandler(ZNode aNode, ZNode aDefaultZoomToNode)
aNode
- The node this event handler attaches to.aDefaultZoomToNode
- The node that we should zoom to if no other node is picked.Method Detail |
public void setActive(boolean active)
setActive
in interface ZEventHandler
active
- True to make this event handler activepublic boolean isActive()
isActive
in interface ZEventHandler
public void mousePressed(ZMouseEvent e)
mousePressed
in interface ZMouseListener
e
- The event.public void mouseReleased(ZMouseEvent e)
mouseReleased
in interface ZMouseListener
e
- The event.public void mouseEntered(ZMouseEvent e)
mouseEntered
in interface ZMouseListener
public void mouseExited(ZMouseEvent e)
mouseExited
in interface ZMouseListener
public void mouseClicked(ZMouseEvent e)
mouseClicked
in interface ZMouseListener
protected ZCamera getCameraToZoomWith(ZSceneGraphPath aPath)
protected ZNode getNodeToZoomTo(ZSceneGraphPath aPath)
public int getZoomTime()
public int setZoomTime(int aTime)
public void setDefaultZoomToNode(ZNode aNode)
public void makeZoomToScale(double aScale)
public void makeZoomToScreen(double aSpacing)
protected void zoomToScaleWith(ZCamera aCamera, ZNode aNode)
protected void zoomToScreenWith(ZCamera aCamera, ZNode aNode)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |