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
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
FieldsFields inherited from class org.apache.batik.apps.svgbrowser.AbstractUndoableCommand
name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommand
(UndoableCommand command) Adds the given command to the atomCommand list.void
execute()
Executes this command.int
Returns the command number that this compound command contains.void
redo()
Performs redo for this command.boolean
Tests if the command can be executed.void
undo()
Performs undo for this command.Methods inherited from class org.apache.batik.apps.svgbrowser.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:UndoableCommand
Executes this command.- Specified by:
execute
in interfaceUndoableCommand
- Overrides:
execute
in classAbstractUndoableCommand
-
undo
public void undo()Description copied from interface:UndoableCommand
Performs undo for this command.- Specified by:
undo
in interfaceUndoableCommand
- Overrides:
undo
in classAbstractUndoableCommand
-
redo
public void redo()Description copied from interface:UndoableCommand
Performs redo for this command.- Specified by:
redo
in interfaceUndoableCommand
- Overrides:
redo
in classAbstractUndoableCommand
-
shouldExecute
public boolean shouldExecute()Description copied from interface:UndoableCommand
Tests if the command can be executed.- Specified by:
shouldExecute
in interfaceUndoableCommand
- Overrides:
shouldExecute
in 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
-