Package org.eclipse.gef.zest.fx.models
Class NavigationModel
- java.lang.Object
-
- org.eclipse.gef.zest.fx.models.NavigationModel
-
public class NavigationModel extends java.lang.Object
TheNavigationModel
manages aSet
ofGraph
s for which the next layout pass should be skipped (due to transformation or navigation changes). Moreover, it manages aMap
saving aNavigationModel.ViewportState
perGraph
, so that the scroll position and zoom factor can be restored when navigating nested graphs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NavigationModel.ViewportState
Representation of a viewport's state, which manifests itself in x and y translation, width and height, as well as a contents transform.
-
Constructor Summary
Constructors Constructor Description NavigationModel()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NavigationModel.ViewportState
getViewportState(Graph graph)
Retrieves theNavigationModel.ViewportState
that is currently saved for the givenGraph
.void
removeViewportState(Graph graph)
Removes theNavigationModel.ViewportState
for the givenGraph
.void
setViewportState(Graph graph, NavigationModel.ViewportState state)
Saves the givenNavigationModel.ViewportState
for the givenGraph
.
-
-
-
Method Detail
-
getViewportState
public NavigationModel.ViewportState getViewportState(Graph graph)
Retrieves theNavigationModel.ViewportState
that is currently saved for the givenGraph
.- Parameters:
graph
- TheGraph
of which the savedNavigationModel.ViewportState
is returned.- Returns:
- The
NavigationModel.ViewportState
that was saved for the givenGraph
.
-
removeViewportState
public void removeViewportState(Graph graph)
Removes theNavigationModel.ViewportState
for the givenGraph
.- Parameters:
graph
- TheGraph
for which to remove theNavigationModel.ViewportState
.
-
setViewportState
public void setViewportState(Graph graph, NavigationModel.ViewportState state)
Saves the givenNavigationModel.ViewportState
for the givenGraph
.- Parameters:
graph
- TheGraph
for which to save aNavigationModel.ViewportState
.state
- TheNavigationModel.ViewportState
that is saved for the givenGraph
.
-
-