Class CommandManager
java.lang.Object
rs.edu.raf.dsw.rudok.app.gui.swing.command.CommandManager
- All Implemented Interfaces:
ICommandManager
public class CommandManager extends Object implements ICommandManager
-
Constructor Summary
Constructors Modifier Constructor Description protected
CommandManager()
Protected constructor. -
Method Summary
Modifier and Type Method Description void
addCommand(AbstractCommand command)
Adds the givenAbstractCommand
to the stack and executes it.boolean
canRedo()
Returns true ifICommandManager.redoCommand()
()} can be called.boolean
canUndo()
Returns true ifICommandManager.undoCommand()
can be called.void
redoCommand()
Redo's the last committed command.void
undoCommand()
Undo's the last committed command.
-
Constructor Details
-
CommandManager
protected CommandManager()Protected constructor.
-
-
Method Details
-
addCommand
Description copied from interface:ICommandManager
Adds the givenAbstractCommand
to the stack and executes it.- Specified by:
addCommand
in interfaceICommandManager
- Parameters:
command
- Command to execute.
-
redoCommand
public void redoCommand()Description copied from interface:ICommandManager
Redo's the last committed command.- Specified by:
redoCommand
in interfaceICommandManager
-
canUndo
public boolean canUndo()Description copied from interface:ICommandManager
Returns true ifICommandManager.undoCommand()
can be called.- Specified by:
canUndo
in interfaceICommandManager
- Returns:
- Returns true if
ICommandManager.undoCommand()
can be called.
-
canRedo
public boolean canRedo()Description copied from interface:ICommandManager
Returns true ifICommandManager.redoCommand()
()} can be called.- Specified by:
canRedo
in interfaceICommandManager
- Returns:
- Returns true if
ICommandManager.redoCommand()
()} can be called.
-
undoCommand
public void undoCommand()Description copied from interface:ICommandManager
Undo's the last committed command.- Specified by:
undoCommand
in interfaceICommandManager
-