org.jhotdraw.util
Interface Command

All Known Implementing Classes:
AbstractCommand, UndoableCommand

public interface Command

Commands encapsulate an action to be executed. Commands have a name and can be used in conjunction with Command enabled ui components.


Design Patterns

 o Command
Command is a simple instance of the command pattern without undo support.


Version:
<$CURRENT_VERSION$>
See Also:
CommandButton, CommandMenu, CommandChoice

Method Summary
 void addCommandListener(CommandListener newCommandListener)
           
 void execute()
          Executes the command.
 DrawingEditor getDrawingEditor()
           
 Undoable getUndoActivity()
           
 boolean isExecutable()
          Tests if the command can be executed.
 java.lang.String name()
          Gets the command name.
 void removeCommandListener(CommandListener oldCommandListener)
           
 void setUndoActivity(Undoable newUndoableActivity)
           
 

Method Detail

execute

public void execute()
Executes the command.


isExecutable

public boolean isExecutable()
Tests if the command can be executed.


name

public java.lang.String name()
Gets the command name.


getDrawingEditor

public DrawingEditor getDrawingEditor()

getUndoActivity

public Undoable getUndoActivity()

setUndoActivity

public void setUndoActivity(Undoable newUndoableActivity)

addCommandListener

public void addCommandListener(CommandListener newCommandListener)

removeCommandListener

public void removeCommandListener(CommandListener oldCommandListener)