charvax.swing.tree
Interface MutableTreeNode
- TreeNode
- DefaultMutableTreeNode
public interface MutableTreeNode
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.
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.
|
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.