|
|||||||||||
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.ZoomToEventHandler
ZoomToEventhandler provides the ability to zoom the interaction camera to a target node on the drawing surface.
On filtered mouse pressed with the right mouse button this event handler will zoom to the node that was picked by the mouse press. If no node 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 setZoomToScale
and setZoomToScreen
.
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 | |
ZoomToEventHandler(ZSceneGraphObject aFilteredMouseEventSource) Constructs a new ZoomToEventHandler. |
|
ZoomToEventHandler(ZSceneGraphObject aFilteredMouseEventSource, ZNode aDefaultZoomToNode) Constructs a new ZoomToEventHandler. |
Method Summary | |
void |
filteredMousePressed(ZMouseEvent e) Maps filtered mouse pressed onto the zoomTo action. |
ZMouseFilter |
getMouseFilter() Return the event filter. |
protected ZNode |
getNodeToZoomTo(ZMouseEvent aEvent) Return the node that should be zoomed to for the given event. |
int |
getZoomTime() Return the amount of time that the zoom action should take. |
void |
setDefaultZoomToNode(ZNode aDefaultZoomToNode) Set the default node that the camera should zoom to when no other node is picked for a zoom action. |
int |
setZoomTime(int aTime) Set the amount of time that the zoom action should take. |
void |
setZoomToScale(double aScale) Set the zoom mode to scale. |
void |
setZoomToScreen(double aSpacing) Set the zoom mode to screen. |
protected void |
zoomTo(ZMouseEvent e) Zoom the interaction camera to the node picked by the current mouse event. |
protected void |
zoomToScaleWith(ZCamera aCamera, ZNode aNode) Zoom the specified camera so that the specified node appears in the center of the camera view at the scale specified by setZoomToScale . |
protected void |
zoomToScreenWith(ZCamera aCamera, ZNode aNode) Zoom the specified camera so that the specified node fills the center of the camera view minus the specified spacing set in setZoomToScreen . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZoomToEventHandler(ZSceneGraphObject aFilteredMouseEventSource)
aFilteredMouseEventSource
- the source for filtered ZMouseEvents and ZMouseMotionEvents. See the ZFilteredEventHandler class comment to customize this behavior.public ZoomToEventHandler(ZSceneGraphObject aFilteredMouseEventSource, ZNode aDefaultZoomToNode)
aFilteredMouseEventSource
- the source for filtered ZMouseEvents and ZMouseMotionEvents. See the ZFilteredEventHandler class comment to customize this behavior.aDefaultZoomToNode
- The node that the event handler will zoom to if no other node is picked.Method Detail |
public ZMouseFilter getMouseFilter()
getMouseFilter
in class ZFilteredEventHandler
public void filteredMousePressed(ZMouseEvent e)
zoomTo
action.
filteredMousePressed
in class ZFilteredEventHandler
e
- the filtered mouse pressed event.protected void zoomTo(ZMouseEvent e)
e
- the event starting the zoomto action.protected ZNode getNodeToZoomTo(ZMouseEvent aEvent)
aEvent
- the event used to determine the node to zoom to.public int getZoomTime()
public int setZoomTime(int aTime)
aTime
- the duration for proceeding zoomto animations.public void setDefaultZoomToNode(ZNode aDefaultZoomToNode)
aDefaultZoomToNode
- the default zoom to node.public void setZoomToScale(double aScale)
aScale
- the scale that the zoom to node should appear on the screen after a zoom action.public void setZoomToScreen(double aSpacing)
aSpacing
- the spacing that should be left around the zoom to node after a zoom action.protected void zoomToScaleWith(ZCamera aCamera, ZNode aNode)
setZoomToScale
.
aCamera
- the camera that will be zoomed.aNode
- the node that will be zoomed to.protected void zoomToScreenWith(ZCamera aCamera, ZNode aNode)
setZoomToScreen
.
aCamera
- the camera that will be zoomed.aNode
- the node that will be zoomed to.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |