An abstract base implementation of the config tree node interface. The implementation
provides all base services needed to have an valid TreeNode.
| Method from org.jfree.report.modules.gui.config.model.AbstractConfigTreeNode Detail: |
public void add(ConfigTreeNode node) {
if (node == null)
{
throw new NullPointerException();
}
if (childs.contains(node) == false)
{
childs.add(node);
node.setParent(this);
}
}
Adds the given node to the tree model. |
public Enumeration children() {
return Collections.enumeration(childs);
}
Returns the children of the receiver as an Enumeration. |
public boolean getAllowsChildren() {
return true;
}
Returns true if the receiver allows children. |
public TreeNode getChildAt(int childIndex) {
return (TreeNode) childs.get(childIndex);
}
Returns the child TreeNode at index childIndex. |
public int getChildCount() {
return childs.size();
}
Returns the number of children TreeNodes the receiver contains. |
public int getIndex(TreeNode node) {
return childs.indexOf(node);
}
Returns the index of node in the receivers children. If the receiver
does not contain node, -1 will be returned. |
public String getName() {
return name;
}
Return the name of the node. |
public TreeNode getParent() {
return parent;
}
Return the parent of this node or null if there is no parent. |
public boolean isLeaf() {
return false;
}
Returns true if the receiver is a leaf. |
protected void reset() {
for (int i = 0; i < childs.size(); i++)
{
final ConfigTreeNode node = (ConfigTreeNode) childs.get(i);
node.setParent(null);
}
childs.clear();
}
|
public void setParent(TreeNode parent) {
this.parent = parent;
}
Defines the parent of this node, or null if the node should not have a parent. |