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.
-
-
Field Summary
Fields Modifier and Type Field Description private XYGraphMementoafterXYGraphMemprivate XYGraphMementopreviousXYGraphMemprivate IXYGraphxyGraph
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XYGraphMementogetAfterXYGraphMemento()Returns the after graph mementoXYGraphMementogetPreviousXYGraphMemento()Returns the previous graph mementovoidredo()Restore the state of the target to the state after this command has been executed.voidsaveAfterStates()voidsavePreviousStates()java.lang.StringtoString()voidundo()Restore the state of the target to the state before this command has been executed.
-
-
-
Field Detail
-
xyGraph
private IXYGraph xyGraph
-
previousXYGraphMem
private XYGraphMemento previousXYGraphMem
-
afterXYGraphMem
private XYGraphMemento afterXYGraphMem
-
-
Constructor Detail
-
XYGraphConfigCommand
public XYGraphConfigCommand(IXYGraph xyGraph)
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 Detail
-
redo
public void redo()
Description copied from interface:IUndoableCommandRestore the state of the target to the state after this command has been executed.- Specified by:
redoin interfaceIUndoableCommand
-
undo
public void undo()
Description copied from interface:IUndoableCommandRestore the state of the target to the state before this command has been executed.- Specified by:
undoin interfaceIUndoableCommand
-
savePreviousStates
public void savePreviousStates()
-
saveAfterStates
public void saveAfterStates()
-
getPreviousXYGraphMemento
public XYGraphMemento getPreviousXYGraphMemento()
Returns the previous graph memento- Returns:
- previous graph memento
-
getAfterXYGraphMemento
public XYGraphMemento getAfterXYGraphMemento()
Returns the after graph memento- Returns:
- after graph memento
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-