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 protectedCommandManager()Protected constructor. -
Method Summary
Modifier and Type Method Description voidaddCommand(AbstractCommand command)Adds the givenAbstractCommandto the stack and executes it.booleancanRedo()Returns true ifICommandManager.redoCommand()()} can be called.booleancanUndo()Returns true ifICommandManager.undoCommand()can be called.voidredoCommand()Redo's the last committed command.voidundoCommand()Undo's the last committed command.
-
Constructor Details
-
CommandManager
protected CommandManager()Protected constructor.
-
-
Method Details
-
addCommand
Description copied from interface:ICommandManagerAdds the givenAbstractCommandto the stack and executes it.- Specified by:
addCommandin interfaceICommandManager- Parameters:
command- Command to execute.
-
redoCommand
public void redoCommand()Description copied from interface:ICommandManagerRedo's the last committed command.- Specified by:
redoCommandin interfaceICommandManager
-
canUndo
public boolean canUndo()Description copied from interface:ICommandManagerReturns true ifICommandManager.undoCommand()can be called.- Specified by:
canUndoin interfaceICommandManager- Returns:
- Returns true if
ICommandManager.undoCommand()can be called.
-
canRedo
public boolean canRedo()Description copied from interface:ICommandManagerReturns true ifICommandManager.redoCommand()()} can be called.- Specified by:
canRedoin interfaceICommandManager- Returns:
- Returns true if
ICommandManager.redoCommand()()} can be called.
-
undoCommand
public void undoCommand()Description copied from interface:ICommandManagerUndo's the last committed command.- Specified by:
undoCommandin interfaceICommandManager
-