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.


Variable Index

 o children
 o parent
 o userObject

Constructor Index

 o DefaultMutableTreeNode()
 o DefaultMutableTreeNode(Object)

Method Index

 o 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.
 o children()
 o getParent()
 o getUserObject()
 o 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.
 o preorderEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at this node in preorder.
 o remove(DefaultMutableTreeNode)
 o remove(int)
 o setParent(DefaultMutableTreeNode)
Sets this node's parent to newParent but does not change the parent's child array.
 o setUserObject(Object)

Variables

 o children
 protected Vector children
 o parent
 protected DefaultMutableTreeNode parent
 o userObject
 protected Object userObject

Constructors

 o DefaultMutableTreeNode
 public DefaultMutableTreeNode()
 o DefaultMutableTreeNode
 public DefaultMutableTreeNode(Object userObject)

Methods

 o 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.

 o children
 public Enumeration children()
 o getParent
 public DefaultMutableTreeNode getParent()
 o 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.

 o remove
 public void remove(int childIndex)
 o remove
 public void remove(DefaultMutableTreeNode aChild)
 o setParent
 public void setParent(DefaultMutableTreeNode newParent)
Sets this node's parent to newParent but does not change the parent's child array.

 o getUserObject
 public Object getUserObject()
 o setUserObject
 public void setUserObject(Object userObject)
 o 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