org.apache.batik.apps.svgbrowser
Class AbstractCompoundCommand

java.lang.Object
  extended by org.apache.batik.apps.svgbrowser.AbstractUndoableCommand
      extended by 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


Field Summary
protected  ArrayList atomCommands
          The atom UndoableCommand command list.
 
Fields inherited from class org.apache.batik.apps.svgbrowser.AbstractUndoableCommand
name
 
Constructor Summary
AbstractCompoundCommand()
          Constructor.
 
Method Summary
 void addCommand(UndoableCommand command)
          Adds the given command to the atomCommand list.
 void execute()
          Executes this command.
 int getCommandNumber()
          Returns the command number that this compound command contains.
 void redo()
          Performs redo for this command.
 boolean shouldExecute()
          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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

atomCommands

protected ArrayList atomCommands
The atom UndoableCommand command list.

Constructor Detail

AbstractCompoundCommand

public AbstractCompoundCommand()
Constructor.

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: UndoableCommand
Executes this command.

Specified by:
execute in interface UndoableCommand
Overrides:
execute in class AbstractUndoableCommand

undo

public void undo()
Description copied from interface: UndoableCommand
Performs undo for this command.

Specified by:
undo in interface UndoableCommand
Overrides:
undo in class AbstractUndoableCommand

redo

public void redo()
Description copied from interface: UndoableCommand
Performs redo for this command.

Specified by:
redo in interface UndoableCommand
Overrides:
redo in class AbstractUndoableCommand

shouldExecute

public boolean shouldExecute()
Description copied from interface: UndoableCommand
Tests if the command can be executed.

Specified by:
shouldExecute in interface UndoableCommand
Overrides:
shouldExecute in class AbstractUndoableCommand
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


Copyright © 2008 Apache Software Foundation. All Rights Reserved.