|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A node in the command graph. Each node has a flavor, which defines the type of node (e.g. simple command, container, etc.) Each node also extends ModifiablePropertySet, which provides other domain-dependent information about the node, such as title, icon, visibility, etc. ComamndNode also extends CommandListener, which defines the actual command operation. Different flavors have different semantics of responding to command invocation. Each node may have an ordered set of children; hence, the nodes are arranged in a directed acyclic graph. Nodes broadcast events when their child set changes. Most implementations will probably want to subclass AbstractCommandNode, which provides default implementations for all methods except commandInvoked() and getFlavor().
Field Summary |
Fields inherited from interface com.virtuosotechnologies.lib.command.CommandListener |
COMMAND_INVOKED_METHOD |
Method Summary | |
void |
addChild(CommandNode child)
Add a child node |
void |
addNodeListener(CommandNodeListener listener)
Add listener for node hierarchy events |
CommandNodeFlavor |
getFlavor()
Get the flavor of CommandNode |
CommandNode |
getNthChild(int index)
Get the indexed child |
int |
getNumChildren()
Get the number of children |
void |
insertChild(int index,
CommandNode child)
Insert a child node at the given index |
void |
removeAllChildren()
Remove all children |
void |
removeNodeListener(CommandNodeListener listener)
Remove listener for node hierarchy events |
void |
removeNthChild(int index)
Remove a child node |
Methods inherited from interface com.virtuosotechnologies.lib.container.ModifiablePropertySet |
putValue, resetValue |
Methods inherited from interface com.virtuosotechnologies.lib.container.PropertySet |
addPropertySetListener, getDefaultValue, getValue, removePropertySetListener |
Methods inherited from interface com.virtuosotechnologies.lib.command.CommandListener |
commandInvoked |
Method Detail |
public CommandNodeFlavor getFlavor()
public void addNodeListener(CommandNodeListener listener)
listener
- listener to addpublic void removeNodeListener(CommandNodeListener listener)
listener
- listener to removepublic void addChild(CommandNode child)
child
- CommandNode to addpublic void insertChild(int index, CommandNode child)
index
- 0-based index indicating where to add the nodechild
- CommandNode to add
IndexOutOfBoundsException
- the index was out of boundspublic CommandNode getNthChild(int index)
index
- 0-based index indicating which child to get
IndexOutOfBoundsException
- the index was out of boundspublic int getNumChildren()
public void removeNthChild(int index)
index
- 0-based index indicating which child to remove
IndexOutOfBoundsException
- the index was out of boundspublic void removeAllChildren()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |