|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CommandManager
A command manager is used to create, register and deregister a list of commands. It also provides a set operations which are applied to all commands in the list.
| Method Summary | |
|---|---|
void |
addCommand(Command command)
Adds a new command to this command manager. |
CommandGroup |
createCommandGroup(String commandID,
CommandStateListener listener)
Creates a new command group command for the given unique command ID and the given command state listener. |
ExecCommand |
createExecCommand(String commandID,
CommandListener listener)
Creates a new executable command for the given unique command ID and the given command listener. |
ToolCommand |
createToolCommand(String commandID,
CommandStateListener listener,
com.bc.ceres.swing.figure.Interactor tool)
Creates a new tool command for the given unique command ID and the given tool. |
Command |
getCommand(String commandID)
Gets the command associated with the given command-COMMAND_ID or null if a command with the given command-ID
has not been registered (so far). |
Command |
getCommandAt(int index)
Returns the element at the specified position in this DefaultCommandManager. |
CommandGroup |
getCommandGroup(String commandID)
Gets the command group associated with the given command-ID or null if an command group with the
given command-ID has not been registered (so far). |
ExecCommand |
getExecCommand(String commandID)
Gets the executable command associated with the given command-ID or null if an executable command
with the given command-ID has not been registered (so far). |
int |
getNumCommands()
Returns the number of commands in this DefaultCommandManager. |
ToolCommand |
getToolCommand(String commandID)
Gets the tool command associated with the given command-ID or null if a tool command with the given
command-ID has not been registered (so far). |
void |
removeCommand(Command command)
Removes an existing command from this command manager. |
void |
updateComponentTreeUI()
Updates the component tree of all commands since the Java look-and-feel has changed. |
void |
updateState()
Calls the updateState method of all registered commands. |
| Method Detail |
|---|
ExecCommand createExecCommand(String commandID,
CommandListener listener)
commandID - a unique command IDlistener - the command listener which executes the command and updates its state
createToolCommand(java.lang.String, org.esa.beam.framework.ui.command.CommandStateListener, com.bc.ceres.swing.figure.Interactor),
createCommandGroup(java.lang.String, org.esa.beam.framework.ui.command.CommandStateListener)
ToolCommand createToolCommand(String commandID,
CommandStateListener listener,
com.bc.ceres.swing.figure.Interactor tool)
commandID - a unique command IDlistener - the command state listener used to update the tool command's statetool - the tool which executes the command and updates its state
createExecCommand(java.lang.String, org.esa.beam.framework.ui.command.CommandListener),
createCommandGroup(java.lang.String, org.esa.beam.framework.ui.command.CommandStateListener)
CommandGroup createCommandGroup(String commandID,
CommandStateListener listener)
commandID - a unique command IDlistener - the command state listener used to update the command group state
createExecCommand(java.lang.String, org.esa.beam.framework.ui.command.CommandListener),
createToolCommand(java.lang.String, org.esa.beam.framework.ui.command.CommandStateListener, com.bc.ceres.swing.figure.Interactor)int getNumCommands()
DefaultCommandManager. If this manager contains more than
Integer.MAX_VALUE elements, returns Integer.MAX_VALUE :-)
DefaultCommandManager.Command getCommandAt(int index)
DefaultCommandManager.
index - index of command to return.
Command at the specified position in this DefaultCommandManager.
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getNumCommands()).Command getCommand(String commandID)
null if a command with the given command-ID
has not been registered (so far).
ExecCommand getExecCommand(String commandID)
null if an executable command
with the given command-ID has not been registered (so far).
ToolCommand getToolCommand(String commandID)
null if a tool command with the given
command-ID has not been registered (so far).
CommandGroup getCommandGroup(String commandID)
null if an command group with the
given command-ID has not been registered (so far).
void updateState()
updateState method of all registered commands.
void updateComponentTreeUI()
void addCommand(Command command)
command - the command to be added
IllegalArgumentException - if the command ID property of the command has not been set, or if an command
with the same command ID has alreay been registeredvoid removeCommand(Command command)
command - the command to be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||