javax.swing.tree
Interface MutableTreeNode
- TreeNode
- DefaultMutableTreeNode, JMeterTreeNode, JTree.DynamicUtilTreeNode
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.
insert
public void insert(MutableTreeNode child,
int index) Adds child to the receiver at index.
child will be messaged with setParent.
View More Examples of insert(MutableTreeNode child,int index)
1: public static void main(String[] args) {
2: MutableTreeNode root = new DefaultMutableTreeNode("Parts");
3: ...
4: MutableTreeNode beams = new DefaultMutableTreeNode("Beams");
5: ...
6: MutableTreeNode gears = new DefaultMutableTreeNode("Gears");
7: ...
8: root.insert(beams, 0);
View Full Code Here
1: import ;
2: import ;
3: import ;
4: ...
5: data.setNamespaces(action.namespaces);
6: MutableTreeNode parent = new DefaultMutableTreeNode(name);
7: ...
8: MutableTreeNode inputNode = new DefaultMutableTreeNode("Feeds into");
9: MutableTreeNode outputNode = new DefaultMutableTreeNode("Produced by");
10: ...
11:
12: parent.insert(inputNode, 0);
View Full Code Here
remove
public void remove(int index)
Removes the child at index from the receiver.
View More Examples of remove(int index)
1: import ;
2: import ;
3: import ;
4: ...
5: String hostID = cap.getHostID();
6: MutableTreeNode hostTreeNode =
7: ...
8: (MutableTreeNode) capabilityTrees.get(hostID);
9: if (hostTreeNode == null) {
10: ...
11:
12: capabilityNodeMap.remove(id);
View Full Code Here
remove
public void remove(MutableTreeNode node)
Removes node from the receiver. setParent
will be messaged on node.
View More Examples of remove(MutableTreeNode node)
1: import ;
2: import ;
3: import ;
4: ...
5: String hostID = cap.getHostID();
6: MutableTreeNode hostTreeNode =
7: ...
8: (MutableTreeNode) capabilityTrees.get(hostID);
9: if (hostTreeNode == null) {
10: ...
11:
12: capabilityNodeMap.remove(id);
View Full Code Here
removeFromParent
public void removeFromParent()
Removes the receiver from its parent.
View More Examples of removeFromParent()
1:
2: MutableTreeNode node = tree.getSelectedNode();
3: if( node == null )
4: ...
5: {
6: MutableTreeNode node = tree.getSelectedNode();
7: if( node == null )
8: ...
9: {
10: node.removeFromParent();
11: tree.removeSelectedNode();
View Full Code Here
1: ParentMap.Entry entry = (ParentMap.Entry)iterator.next();
2: MutableTreeNode mutabletreenode = (MutableTreeNode)entry.getChild();
3: DefaultMutableTreeNode defaultmutabletreenode = (DefaultMutableTreeNode)entry.getParent();
4: ...
5: parentmap1.addEntry(mutabletreenode, getParent(mutabletreenode));
6: if(defaultmutabletreenode == null)
7: ...
8: {
9: mutabletreenode.removeFromParent();
10: } else
View Full Code Here
View More Examples of setParent(MutableTreeNode newParent)
1:
2: public class JDOMElementTreeNode implements MutableTreeNode
3: {
4: ...
5:
6: final private List<MutableTreeNode> children ;
7:
8: ...
9:
10: this.children = new ArrayList<MutableTreeNode>() ;
11:
12: ...
13: if (oldParent!=null) oldParent.remove(child);
14: child.setParent(this);
View Full Code Here
1: extends NodeCompass
2: implements Cloneable, MutableTreeNode, Serializable {
3:
4: ...
5:
6: public void insert(MutableTreeNode newChild, int childIndex)
7: {
8: ...
9:
10: MutableTreeNode oldParent = (MutableTreeNode)newChild.getParent();
11:
12: ...
13: }
14: newChild.setParent(this);
View Full Code Here
1: public class NodeDD
2: implements Cloneable, MutableTreeNode, Serializable, FileRenamable {
3:
4: ...
5:
6: public void insert(MutableTreeNode newChild, int childIndex)
7: {
8: ...
9:
10: MutableTreeNode oldParent = (MutableTreeNode)newChild.getParent();
11:
12: ...
13: }
14: newChild.setParent(this);
View Full Code Here
1: public class NodeGroup
2: implements Cloneable, MutableTreeNode, Serializable, FileRenamable {
3:
4: ...
5:
6: public void insert(MutableTreeNode newChild, int childIndex)
7: {
8: ...
9:
10: MutableTreeNode oldParent = (MutableTreeNode)newChild.getParent();
11:
12: ...
13: }
14: newChild.setParent(this);
View Full Code Here
1: extends NodeCompass
2: implements Cloneable, MutableTreeNode, Serializable {
3:
4: ...
5:
6: public void insert(MutableTreeNode newChild, int childIndex)
7: {
8: ...
9:
10: MutableTreeNode oldParent = (MutableTreeNode)newChild.getParent();
11:
12: ...
13: }
14: newChild.setParent(this);
View Full Code Here
setUserObject
public void setUserObject(Object object)
Resets the user object of the receiver to object.
View More Examples of setUserObject(Object object)
1: import ;
2: import ;
3: import ;
4: ...
5: {
6: MutableTreeNode aNode = (MutableTreeNode) path.getLastPathComponent();
7:
8: ...
9: aNode.setUserObject(newValue);
10: nodeChanged(aNode);
View Full Code Here
1:
2: MutableTreeNode mObjectNode = (MutableTreeNode)(nodeMap.get(mObject));
3: if( mObjectNode != null )
4: ...
5:
6: mObjectNode.setUserObject( mObject );
7:
8: treeModel.reload(mObjectNode);
9: }
View Full Code Here