Class XYGraphConfigCommand

  • All Implemented Interfaces:
    IUndoableCommand

    public class XYGraphConfigCommand
    extends java.lang.Object
    implements IUndoableCommand
    The command for graph configuration.
    • 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 XYGraphMemento Supplier
        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 interface IUndoableCommand
      • 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 interface IUndoableCommand
      • 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 class java.lang.Object