Package org.eclipse.gef.zest.fx.models

# Class NavigationModel

java.lang.Object
org.eclipse.gef.zest.fx.models.NavigationModel

public class NavigationModel extends Object
The `NavigationModel` manages a `Set` of `Graph`s for which the next layout pass should be skipped (due to transformation or navigation changes). Moreover, it manages a `Map` saving a `NavigationModel.ViewportState` per `Graph`, 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

Modifier and Type
Method
Description
`NavigationModel.ViewportState`
`getViewportState(Graph graph)`
Retrieves the `NavigationModel.ViewportState` that is currently saved for the given `Graph`.
`void`
`removeViewportState(Graph graph)`
Removes the `NavigationModel.ViewportState` for the given `Graph`.
`void`
`setViewportState(Graph graph, NavigationModel.ViewportState state)`
Saves the given `NavigationModel.ViewportState` for the given `Graph`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### NavigationModel

public NavigationModel()
Default constructor.

## Method Details

### getViewportState

public NavigationModel.ViewportState getViewportState(Graph graph)
Retrieves the `NavigationModel.ViewportState` that is currently saved for the given `Graph`.

Parameters:
  `graph` - The `Graph` of which the saved `NavigationModel.ViewportState` is returned.
Returns:
  The `NavigationModel.ViewportState` that was saved for the given `Graph`.

### removeViewportState

public void removeViewportState(Graph graph)
Removes the `NavigationModel.ViewportState` for the given `Graph`.

Parameters:
  `graph` - The `Graph` for which to remove the `NavigationModel.ViewportState`.

### setViewportState

public void setViewportState(Graph graph, NavigationModel.ViewportState state)
Saves the given `NavigationModel.ViewportState` for the given `Graph`.

Parameters:
  `graph` - The `Graph` for which to save a `NavigationModel.ViewportState`.
  `state` - The `NavigationModel.ViewportState` that is saved for the given `Graph`.