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.ObjectTheNavigationModelmanages aSetofGraphs for which the next layout pass should be skipped (due to transformation or navigation changes). Moreover, it manages aMapsaving aNavigationModel.ViewportStateperGraph, 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 classNavigationModel.ViewportStateRepresentation 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.ViewportStategetViewportState(Graph graph)Retrieves theNavigationModel.ViewportStatethat is currently saved for the givenGraph.voidremoveViewportState(Graph graph)Removes theNavigationModel.ViewportStatefor the givenGraph.voidsetViewportState(Graph graph, NavigationModel.ViewportState state)Saves the givenNavigationModel.ViewportStatefor the givenGraph.
-
-
-
Method Detail
-
getViewportState
public NavigationModel.ViewportState getViewportState(Graph graph)
Retrieves theNavigationModel.ViewportStatethat is currently saved for the givenGraph.- Parameters:
graph- TheGraphof which the savedNavigationModel.ViewportStateis returned.- Returns:
- The
NavigationModel.ViewportStatethat was saved for the givenGraph.
-
removeViewportState
public void removeViewportState(Graph graph)
Removes theNavigationModel.ViewportStatefor the givenGraph.- Parameters:
graph- TheGraphfor which to remove theNavigationModel.ViewportState.
-
setViewportState
public void setViewportState(Graph graph, NavigationModel.ViewportState state)
Saves the givenNavigationModel.ViewportStatefor the givenGraph.- Parameters:
graph- TheGraphfor which to save aNavigationModel.ViewportState.state- TheNavigationModel.ViewportStatethat is saved for the givenGraph.
-
-