Interface ICommandManager
- All Known Implementing Classes:
CommandManager
public interface ICommandManager
Invoker of commands in the command pattern.
-
Method Summary
Modifier and Type Method Description voidaddCommand(AbstractCommand command)Adds the givenAbstractCommandto the stack and executes it.booleancanRedo()Returns true ifredoCommand()()} can be called.booleancanUndo()Returns true ifundoCommand()can be called.voidredoCommand()Redo's the last committed command.voidundoCommand()Undo's the last committed command.
-
Method Details
-
addCommand
Adds the givenAbstractCommandto the stack and executes it.- Parameters:
command- Command to execute.
-
undoCommand
void undoCommand()Undo's the last committed command. -
redoCommand
void redoCommand()Redo's the last committed command. -
canUndo
boolean canUndo()Returns true ifundoCommand()can be called.- Returns:
- Returns true if
undoCommand()can be called.
-
canRedo
boolean canRedo()Returns true ifredoCommand()()} can be called.- Returns:
- Returns true if
redoCommand()()} can be called.
-