KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > tree > MutableTreeNode


1 /*
2  * @(#)MutableTreeNode.java 1.11 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing.tree;
9
10 /**
11  * Defines the requirements for a tree node object that can change --
12  * by adding or removing child nodes, or by changing the contents
13  * of a user object stored in the node.
14  *
15  * @see DefaultMutableTreeNode
16  * @see javax.swing.JTree
17  *
18  * @version 1.11 12/19/03
19  * @author Rob Davis
20  * @author Scott Violet
21  */

22
23 public interface MutableTreeNode extends TreeNode JavaDoc
24 {
25     /**
26      * Adds <code>child</code> to the receiver at <code>index</code>.
27      * <code>child</code> will be messaged with <code>setParent</code>.
28      */

29     void insert(MutableTreeNode JavaDoc child, int index);
30
31     /**
32      * Removes the child at <code>index</code> from the receiver.
33      */

34     void remove(int index);
35
36     /**
37      * Removes <code>node</code> from the receiver. <code>setParent</code>
38      * will be messaged on <code>node</code>.
39      */

40     void remove(MutableTreeNode JavaDoc node);
41
42     /**
43      * Resets the user object of the receiver to <code>object</code>.
44      */

45     void setUserObject(Object JavaDoc object);
46
47     /**
48      * Removes the receiver from its parent.
49      */

50     void removeFromParent();
51
52     /**
53      * Sets the parent of the receiver to <code>newParent</code>.
54      */

55     void setParent(MutableTreeNode JavaDoc newParent);
56 }
57
Popular Tags