Package org.apache.batik.apps.svgbrowser
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
public abstract class AbstractCompoundCommand extends AbstractUndoableCommand
Abstract compound command. Supports the execute / undo / redo of more than one command- Version:
- $Id: AbstractCompoundCommand.java 1804130 2017-08-04 14:41:11Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayListatomCommandsThe atom UndoableCommand command list.-
Fields inherited from class org.apache.batik.apps.svgbrowser.AbstractUndoableCommand
name
-
-
Constructor Summary
Constructors Constructor Description AbstractCompoundCommand()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCommand(UndoableCommand command)Adds the given command to the atomCommand list.voidexecute()Executes this command.intgetCommandNumber()Returns the command number that this compound command contains.voidredo()Performs redo for this command.booleanshouldExecute()Tests if the command can be executed.voidundo()Performs undo for this command.-
Methods inherited from class org.apache.batik.apps.svgbrowser.AbstractUndoableCommand
getName, setName
-
-
-
-
Method Detail
-
addCommand
public void addCommand(UndoableCommand command)
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
-
-