All Packages Class Hierarchy This Package Previous Next Index
Class Tree.DefaultMutableTreeNode
java.lang.Object
|
+----Tree.DefaultMutableTreeNode
- public class DefaultMutableTreeNode
- extends Object
This class provides an updatable tree node. In order to be compatible
with the largest possible number of browsers we can't use Swing, since
it is Java 1.1+. However, to ease any future upgrading, we have created
this class to mirror that of a Swing class. It's methods are a subset
of those in the Swing class.
-
children
-
-
parent
-
-
userObject
-
-
DefaultMutableTreeNode()
-
-
DefaultMutableTreeNode(Object)
-
-
add(DefaultMutableTreeNode)
- Removes newChild from its parent and makes it a child of this node
by adding it to the end of this node's child array.
-
children()
-
-
getParent()
-
-
getUserObject()
-
-
insert(DefaultMutableTreeNode, int)
- Removes newChild from its present parent (if it has a parent), sets
the child's parent to this node, and then adds the child to this
node's child array at index childIndex.
-
preorderEnumeration()
- Creates and returns an enumeration that traverses the subtree
rooted at this node in preorder.
-
remove(DefaultMutableTreeNode)
-
-
remove(int)
-
-
setParent(DefaultMutableTreeNode)
- Sets this node's parent to newParent but does not change the
parent's child array.
-
setUserObject(Object)
-
children
protected Vector children
parent
protected DefaultMutableTreeNode parent
userObject
protected Object userObject
DefaultMutableTreeNode
public DefaultMutableTreeNode()
DefaultMutableTreeNode
public DefaultMutableTreeNode(Object userObject)
add
public void add(DefaultMutableTreeNode newChild)
- Removes newChild from its parent and makes it a child of this node
by adding it to the end of this node's child array.
children
public Enumeration children()
getParent
public DefaultMutableTreeNode getParent()
insert
public void insert(DefaultMutableTreeNode newChild,
int childIndex)
- Removes newChild from its present parent (if it has a parent), sets
the child's parent to this node, and then adds the child to this
node's child array at index childIndex.
remove
public void remove(int childIndex)
remove
public void remove(DefaultMutableTreeNode aChild)
setParent
public void setParent(DefaultMutableTreeNode newParent)
- Sets this node's parent to newParent but does not change the
parent's child array.
getUserObject
public Object getUserObject()
setUserObject
public void setUserObject(Object userObject)
preorderEnumeration
public Enumeration preorderEnumeration()
- Creates and returns an enumeration that traverses the subtree
rooted at this node in preorder.
All Packages Class Hierarchy This Package Previous Next Index