Class AbstractCompoundCommand
java.lang.Object
org.apache.batik.apps.svgbrowser.AbstractUndoableCommand
org.apache.batik.apps.svgbrowser.AbstractCompoundCommand
- All Implemented Interfaces:
UndoableCommand
- Direct Known Subclasses:
HistoryBrowserInterface.CompoundUpdateCommand
Abstract compound command. Supports the execute / undo / redo of more than
one command
- Version:
- $Id$
-
Field Summary
FieldsFields inherited from class AbstractUndoableCommand
name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(UndoableCommand command) Adds the given command to the atomCommand list.voidexecute()Executes this command.intReturns the command number that this compound command contains.voidredo()Performs redo for this command.booleanTests if the command can be executed.voidundo()Performs undo for this command.Methods inherited from class AbstractUndoableCommand
getName, setName
-
Field Details
-
atomCommands
The atom UndoableCommand command list.
-
-
Constructor Details
-
AbstractCompoundCommand
public AbstractCompoundCommand()Constructor.
-
-
Method Details
-
addCommand
Adds the given command to the atomCommand list.- Parameters:
command- The given command
-
execute
public void execute()Description copied from interface:UndoableCommandExecutes this command.- Specified by:
executein interfaceUndoableCommand- Overrides:
executein classAbstractUndoableCommand
-
undo
public void undo()Description copied from interface:UndoableCommandPerforms undo for this command.- Specified by:
undoin interfaceUndoableCommand- Overrides:
undoin classAbstractUndoableCommand
-
redo
public void redo()Description copied from interface:UndoableCommandPerforms redo for this command.- Specified by:
redoin interfaceUndoableCommand- Overrides:
redoin classAbstractUndoableCommand
-
shouldExecute
public boolean shouldExecute()Description copied from interface:UndoableCommandTests if the command can be executed.- Specified by:
shouldExecutein interfaceUndoableCommand- Overrides:
shouldExecutein classAbstractUndoableCommand- Returns:
- True if command should be executed
-
getCommandNumber
public int getCommandNumber()Returns the command number that this compound command contains.- Returns:
- The atom command number
-