Class OperationsManager


  • public class OperationsManager
    extends java.lang.Object
    The operation manager will help to manage the undoable and redoable operations.
    • Constructor Detail

      • OperationsManager

        public OperationsManager()
        Constructor.
    • Method Detail

      • addCommand

        public void addCommand​(IUndoableCommand command)
        Execute a command and push it to undo stack.
        Parameters:
        command - the command to be executed.
      • undoCommand

        public void undoCommand​(IUndoableCommand command)
        Undo the command. Restore the state of the target to the previous state before this command has been executed.
        Parameters:
        command -
      • redoCommand

        public void redoCommand​(IUndoableCommand command)
        Re-do the command. Restore the state of the target to the state after this command has been executed.
        Parameters:
        command -
      • undo

        public void undo()
        undo the last command. Do nothing if there is no last command.
      • redo

        public void redo()
        redo the last undone command. Do nothing if there is no last undone command.
      • getUndoCommands

        public java.lang.Object[] getUndoCommands()
        Returns:
        the undo commands array. The first element is the oldest commands and the last element is the latest commands.
      • getRedoCommands

        public java.lang.Object[] getRedoCommands()
        Returns:
        the redo commands array. The first element is the oldest commands and the last element is the latest commands.
      • fireOperationsHistoryChanged

        private void fireOperationsHistoryChanged()
      • getUndoCommandsSize

        public int getUndoCommandsSize()
      • getRedoCommandsSize

        public int getRedoCommandsSize()