|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.command.BaseCommand
Abstract class BaseCommand is the common base class for all of
our Command implementation classes because it consolidates shared
code and provides a number of overloaded constructors that make subclasses easier
to write. Because this class automatically registers itself with an instance of
CommandRegistry, subclasses only have to override the method
Command.perform(Object).
| Constructor Summary | |
BaseCommand(CommandRegistry commandregistry,
java.lang.String id)
Constructor specifying the commandregistry to use and an id. |
|
BaseCommand(CommandRegistry commandregistry,
java.lang.String id,
java.lang.String description)
Constructor with additional description-parameter. |
|
BaseCommand(CommandRegistry commandregistry,
java.lang.String id,
java.lang.String description,
java.lang.String performDescription)
Constructor with additional description- and perform-description parameter. |
|
BaseCommand(CommandRegistry commandregistry,
java.lang.String id,
java.lang.String description,
java.lang.String performDescription,
boolean enabled)
Constructor with additional parameter indicating whether this command is enabled or not. |
|
| Method Summary | |
java.lang.String |
getDescription()
Returns the description of this command. |
java.lang.String |
getId()
Retrieves the unique identifier of the command. |
java.lang.String |
getPerformDescription()
Returns a textual description of what the command does when it is invoked. |
boolean |
isEnabled()
Returns true if this command is enabled. |
void |
setEnabled(boolean b)
Specifies whether this command is enabled or not. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.tensegrity.generic.command.Command |
perform |
| Constructor Detail |
public BaseCommand(CommandRegistry commandregistry,
java.lang.String id)
id.
commandregistry - the registry to register the command with.
(If it is null, then the command
will not be registered.)id - unique identifier for the command.
public BaseCommand(CommandRegistry commandregistry,
java.lang.String id,
java.lang.String description)
commandregistry - the registry to register the command with.id - unique identifier for the command.description - a description describing what this command
will do.
public BaseCommand(CommandRegistry commandregistry,
java.lang.String id,
java.lang.String description,
java.lang.String performDescription)
commandregistry - the registry to register the command with.id - unique identifier for the command.description - a String describing what this
command will do.performDescription - a String describing what this command
does when it performs.
public BaseCommand(CommandRegistry commandregistry,
java.lang.String id,
java.lang.String description,
java.lang.String performDescription,
boolean enabled)
commandregistry - the registry to register the command with.id - unique identifier for the command.description - a String describing what this
command will do.performDescription - a String describing what this
command does when it performs.enabled - indicating whether this command is enabled.| Method Detail |
public java.lang.String getId()
Command
getId in interface Commandpublic java.lang.String getDescription()
Command
getDescription in interface Commandnull
otherwise.public java.lang.String getPerformDescription()
CommandCommand.getDescription() is, that the returned
String of this method describes what the Command does
when it performs.
The String returned by getDescription() describes what the
command will do.
For example:
You specify a command that opens a document.
getPerformDescription in interface Commandnull if it is not set.public boolean isEnabled()
Commandtrue if this command is enabled.
isEnabled in interface Commandtrue if this command is enabled.public void setEnabled(boolean b)
Command
setEnabled in interface Commandb - specifies whether this command is enabled.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||