charvax.swing.tree

Interface MutableTreeNode

All Superinterfaces:
TreeNode
Known Implementing Classes:
DefaultMutableTreeNode

public interface MutableTreeNode
extends TreeNode

Defines the requirements for a tree node object that can change -- by adding or removing child nodes, or by changing the contents of a user object stored in the node.

Method Summary

Object
getUserObject()
Returns the user object associated with this MutableTreeNode.
void
insert(MutableTreeNode child, int index)
Adds child to this MutableTreeNode at index.
void
remove(MutableTreeNode node)
Removes node from this MutableTreeNode.
void
remove(int index)
Removes the child at index from this MutableTreeNode.
void
removeFromParent()
Removes this MutableTreeNode from its parent.
void
setParent(MutableTreeNode newParent)
Sets the parent of this MutableTreeNode to newParent.
void
setUserObject(Object object)
Resets the user object of this MutableTreeNode to object.

Methods inherited from interface charvax.swing.tree.TreeNode

children, getAllowsChildren, getChildAt, getChildCount, getParent, isLeaf

Method Details

getUserObject

public Object getUserObject()
Returns the user object associated with this MutableTreeNode. (this method is not actually in java.swing.tree.MutableTreeNode).

insert

public void insert(MutableTreeNode child,
                   int index)
Adds child to this MutableTreeNode at index. The setParent() method of child will be called.

remove

public void remove(MutableTreeNode node)
Removes node from this MutableTreeNode. The setParent() method of "node" will be called.

remove

public void remove(int index)
Removes the child at index from this MutableTreeNode.

removeFromParent

public void removeFromParent()
Removes this MutableTreeNode from its parent.

setParent

public void setParent(MutableTreeNode newParent)
Sets the parent of this MutableTreeNode to newParent.

setUserObject

public void setUserObject(Object object)
Resets the user object of this MutableTreeNode to object.