|
|||||||||
| Home >> All >> com >> virtuosotechnologies >> lib >> basiccommand >> [ builder overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.virtuosotechnologies.lib.basiccommand.builder
Class AbstractBranchBuilderNode

java.lang.Objectcom.virtuosotechnologies.lib.basiccommand.builder.AbstractBuilderNode
com.virtuosotechnologies.lib.basiccommand.builder.AbstractBranchBuilderNode
- All Implemented Interfaces:
- com.virtuosotechnologies.lib.command.CommandNodeListener, java.util.EventListener, com.virtuosotechnologies.lib.propertyset.PropertySetListener
- Direct Known Subclasses:
- AbstractContainerElementBuilderNode, AbstractGroupBuilderNode
- public abstract class AbstractBranchBuilderNode
- extends AbstractBuilderNode
- implements com.virtuosotechnologies.lib.command.CommandNodeListener
- extends AbstractBuilderNode
A skeletal implementation for builder nodes with children. Provides accessors for children as well as position finding. Subclasses need to implement createChildNode() to create child nodes corresponding to child CommandNodes. Subclasses also need to implement the add/set/removeElements methods, as well as getCardinality().
| Field Summary | |
private java.util.List |
children_
|
| Fields inherited from class com.virtuosotechnologies.lib.basiccommand.builder.AbstractBuilderNode |
END_POSITION |
| Fields inherited from interface com.virtuosotechnologies.lib.command.CommandNodeListener |
ALL_CHILDREN_REMOVED_METHOD, CHILD_ADDED_METHOD, CHILD_REMOVED_METHOD |
| Fields inherited from interface com.virtuosotechnologies.lib.propertyset.PropertySetListener |
PROPERTYSET_CHANGED_METHOD |
| Constructor Summary | |
protected |
AbstractBranchBuilderNode(com.virtuosotechnologies.lib.command.CommandNode commandNode,
AbstractBranchBuilderNode parent,
int index)
Constructor |
| Method Summary | |
protected abstract void |
addElementAt(int pos,
java.lang.Object element)
Override this to insert a element at a position. |
void |
allChildrenRemoved(com.virtuosotechnologies.lib.command.AllChildrenRemovedEvent ev)
All children removed. |
protected void |
buildChildren()
Build children. |
void |
childAdded(com.virtuosotechnologies.lib.command.ChildAddedEvent ev)
Child added. |
void |
childRemoved(com.virtuosotechnologies.lib.command.ChildRemovedEvent ev)
Child removed. |
protected abstract AbstractBuilderNode |
createChildNode(com.virtuosotechnologies.lib.command.CommandNode cn,
int index)
Create a child node. |
protected AbstractBuilderNode |
getChild(com.virtuosotechnologies.lib.command.CommandNode cn)
Get a child given a CommandNode |
protected AbstractBuilderNode |
getChild(int index)
Get a child given an index |
protected java.util.List |
getChildren()
Get an unmodifiable view of the list of children |
protected int |
getNumChildren()
Get number of children |
protected int |
getPosition(AbstractBuilderNode child)
Get the starting position of a particular child |
protected int |
getPosition(int index)
Get the starting position at a particular index |
(package private) void |
internalAddChild(AbstractBuilderNode node)
Used only by AbstractBuilderNode |
(package private) void |
internalAddChild(int index,
AbstractBuilderNode node)
Used only by AbstractBuilderNode |
protected abstract void |
removeAllElements()
Override this to remove all child elements. |
protected void |
removeChildElements(AbstractBuilderNode child)
Helper method that removes elements within the specified child's area of influence (position and cardinality) |
protected abstract void |
removeElementAt(int pos)
Override this to remove an indexed element. |
protected void |
setElementAt(int pos,
java.lang.Object element)
Override this to set the element at a position. |
| Methods inherited from class com.virtuosotechnologies.lib.basiccommand.builder.AbstractBuilderNode |
decGrayLevel, decMaskLevel, disabledStateChanged, dump, getCardinality, getCommandNode, getParent, hiddenStateChanged, incGrayLevel, incMaskLevel, isDisabled, isHidden, propertySetChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
children_
private java.util.List children_
| Constructor Detail |
AbstractBranchBuilderNode
protected AbstractBranchBuilderNode(com.virtuosotechnologies.lib.command.CommandNode commandNode, AbstractBranchBuilderNode parent, int index)
- Constructor
| Method Detail |
internalAddChild
final void internalAddChild(AbstractBuilderNode node)
- Used only by AbstractBuilderNode
internalAddChild
final void internalAddChild(int index,
AbstractBuilderNode node)
- Used only by AbstractBuilderNode
buildChildren
protected final void buildChildren()
- Build children. Call this from the constructor of nodes that
can have children. Assumes that the node has no children to start off.
getPosition
protected final int getPosition(AbstractBuilderNode child)
- Get the starting position of a particular child
getPosition
protected final int getPosition(int index)
- Get the starting position at a particular index
getChild
protected final AbstractBuilderNode getChild(int index)
- Get a child given an index
getChild
protected final AbstractBuilderNode getChild(com.virtuosotechnologies.lib.command.CommandNode cn)
- Get a child given a CommandNode
getNumChildren
protected final int getNumChildren()
- Get number of children
getChildren
protected final java.util.List getChildren()
- Get an unmodifiable view of the list of children
removeChildElements
protected final void removeChildElements(AbstractBuilderNode child)
- Helper method that removes elements within the specified
child's area of influence (position and cardinality)
createChildNode
protected abstract AbstractBuilderNode createChildNode(com.virtuosotechnologies.lib.command.CommandNode cn, int index)
- Create a child node. Return null if no child is to be created.
addElementAt
protected abstract void addElementAt(int pos,
java.lang.Object element)
- Override this to insert a element at a position.
setElementAt
protected void setElementAt(int pos,
java.lang.Object element)
- Override this to set the element at a position. Default
implementation calls removeElementAt followed by addElementAt.
removeElementAt
protected abstract void removeElementAt(int pos)
- Override this to remove an indexed element.
removeAllElements
protected abstract void removeAllElements()
- Override this to remove all child elements.
childAdded
public void childAdded(com.virtuosotechnologies.lib.command.ChildAddedEvent ev)
- Child added.
Default method creates a child node, which may result in elements
being added.
- Specified by:
childAddedin interfacecom.virtuosotechnologies.lib.command.CommandNodeListener
childRemoved
public void childRemoved(com.virtuosotechnologies.lib.command.ChildRemovedEvent ev)
- Child removed.
Default method removes the child node and removes the elements
within the child's area of influence.
- Specified by:
childRemovedin interfacecom.virtuosotechnologies.lib.command.CommandNodeListener
allChildrenRemoved
public void allChildrenRemoved(com.virtuosotechnologies.lib.command.AllChildrenRemovedEvent ev)
- All children removed.
Default method removes all children and all elements under this node.
- Specified by:
allChildrenRemovedin interfacecom.virtuosotechnologies.lib.command.CommandNodeListener
|
|||||||||
| Home >> All >> com >> virtuosotechnologies >> lib >> basiccommand >> [ builder overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC