Class XYGraphConfigCommand
java.lang.Object
org.eclipse.nebula.visualization.internal.xygraph.undo.XYGraphConfigCommand
- All Implemented Interfaces:
IUndoableCommand
public class XYGraphConfigCommand extends java.lang.Object implements IUndoableCommand
The command for graph configuration.
-
Constructor Summary
Constructors Constructor Description XYGraphConfigCommand(IXYGraph xyGraph)
Construct a graph configuration commandXYGraphConfigCommand(IXYGraph xyGraph, java.util.function.Supplier<? extends XYGraphMemento> mementoFactory)
Constructor with a XYGraphMementoSupplier
-
Method Summary
Modifier and Type Method Description XYGraphMemento
getAfterXYGraphMemento()
Returns the after graph mementoXYGraphMemento
getPreviousXYGraphMemento()
Returns the previous graph mementovoid
redo()
Restore the state of the target to the state after this command has been executed.void
saveAfterStates()
void
savePreviousStates()
java.lang.String
toString()
void
undo()
Restore the state of the target to the state before this command has been executed.
-
Constructor Details
-
XYGraphConfigCommand
Construct a graph configuration command- Parameters:
xyGraph
-
-
XYGraphConfigCommand
public XYGraphConfigCommand(IXYGraph xyGraph, java.util.function.Supplier<? extends XYGraphMemento> mementoFactory)Constructor with a XYGraphMementoSupplier
- Parameters:
xyGraph
-mementoFactory
- A supplier that creates a new XYGraphMemento on each call to the supplier's get method.
-
-
Method Details
-
redo
public void redo()Description copied from interface:IUndoableCommand
Restore the state of the target to the state after this command has been executed.- Specified by:
redo
in interfaceIUndoableCommand
-
undo
public void undo()Description copied from interface:IUndoableCommand
Restore the state of the target to the state before this command has been executed.- Specified by:
undo
in interfaceIUndoableCommand
-
savePreviousStates
public void savePreviousStates() -
saveAfterStates
public void saveAfterStates() -
getPreviousXYGraphMemento
Returns the previous graph memento- Returns:
- previous graph memento
-
getAfterXYGraphMemento
Returns the after graph memento- Returns:
- after graph memento
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-