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 XYGraphMemento
afterXYGraphMem
private XYGraphMemento
previousXYGraphMem
private IXYGraph
xyGraph
-
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 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.
-
-
-
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: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
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:
toString
in classjava.lang.Object
-
-