public class NavigateOperation extends ForwardUndoCompositeOperation
NavigateOperation
is a ReverseUndoCompositeOperation
that
combines a ChangeContentsOperation
and an
ChangeViewportOperation
to navigate between nested and parent
Graph
s.Constructor and Description |
---|
NavigateOperation(IViewer viewer)
Creates a new
NavigateOperation that saves the layout and viewport
for the currently displayed Graph . |
NavigateOperation(IViewer viewer,
Graph targetGraph,
boolean isNestedGraph)
Creates a new
NavigateOperation that saves the layout and viewport
for the currently displayed Graph , loads the layout and viewport of
the finalGraph, and changes the viewer contents. |
Modifier and Type | Method and Description |
---|---|
IStatus |
execute(IProgressMonitor monitor,
IAdaptable info) |
ChangeViewportOperation |
getChangeViewportOperation()
Returns the
ChangeViewportOperation that is used by this
NavigateOperation to update the viewport. |
void |
setFinalState(Graph targetGraph,
boolean isNestedGraph)
Changes this
NavigateOperation 's final state so that the given
finalGraph is opened. |
add, addAll, addContext, canExecute, canRedo, canUndo, combine, getOperations, isContentRelevant, isEmpty, isNoOp, redo, remove, undo, unwrap
dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dispose, getContexts, getLabel, hasContext, removeContext
public NavigateOperation(IViewer viewer)
NavigateOperation
that saves the layout and viewport
for the currently displayed Graph
. The final state for the operation
can later be set using setFinalState(Graph, boolean)
.viewer
- The InfiniteCanvasViewer
of which the contents and
viewport are manipulated.public NavigateOperation(IViewer viewer, Graph targetGraph, boolean isNestedGraph)
NavigateOperation
that saves the layout and viewport
for the currently displayed Graph
, loads the layout and viewport of
the finalGraph, and changes the viewer contents. If the
isNestedGraph flag is set to true
, then the viewport that
was saved for finalGraph will not be restored, but instead it will be
reset.viewer
- The InfiniteCanvasViewer
of which the contents and
viewport are manipulated.targetGraph
- The final Graph
to be displayed within the given
InfiniteCanvasViewer
.isNestedGraph
- Specifies whether or not the given finalGraph is a nested
Graph
.public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException
execute
in interface IUndoableOperation
execute
in class AbstractCompositeOperation
ExecutionException
public ChangeViewportOperation getChangeViewportOperation()
ChangeViewportOperation
that is used by this
NavigateOperation
to update the viewport.ChangeViewportOperation
that is used by this
NavigateOperation
to update the viewport.public void setFinalState(Graph targetGraph, boolean isNestedGraph)
NavigateOperation
's final state so that the given
finalGraph is opened. If the isNestedGraph flag is set to
true
, then the viewport that was saved for finalGraph
will not be restored, but instead it will be reset.Copyright (c) 2014 itemis AG and others. All rights reserved.