|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
com.imagero.gui.swing.tree.node.DMTreeNode
com.imagero.gui.swing.tree.node.HTreeNode
com.imagero.gui.swing.tree.node.DummyNode
| Field Summary |
| Fields inherited from class com.imagero.gui.swing.tree.node.HTreeNode |
stringComparator |
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, EMPTY_ENUMERATION, userObject |
| Constructor Summary | |
DummyNode(java.lang.Object userObject)
|
|
| Method Summary | |
java.util.Enumeration |
children()
Creates and returns a forward-order enumeration of this node's children. |
boolean |
getAllowsChildren()
Returns true if this node is allowed to have children. |
javax.swing.tree.TreeNode |
getChildAt(int childIndex)
Returns the child at the specified index in this node's child array. |
int |
getChildCount()
Returns the number of children of this node. |
int |
getIndex(javax.swing.tree.TreeNode node)
Returns the index of the specified child in this node's child array. |
javax.swing.tree.TreeNode |
getParent()
Returns this node's parent or null if this node has no parent. |
void |
insert(javax.swing.tree.MutableTreeNode child,
int index)
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.
|
boolean |
isLeaf()
Returns true if this node has no children. |
void |
remove(int index)
Removes the child at the specified index from this node's children and sets that node's parent to null. |
void |
remove(javax.swing.tree.MutableTreeNode node)
Removes aChild from this node's child array, giving it a
null parent. |
void |
removeFromParent()
Removes the subtree rooted at this node from the tree, giving this node a null parent. |
void |
setParent(javax.swing.tree.MutableTreeNode newParent)
Sets this node's parent to newParent but does not
change the parent's child array. |
void |
setUserObject(java.lang.Object object)
Sets the user object for this node to userObject. |
| Methods inherited from class com.imagero.gui.swing.tree.node.HTreeNode |
getHandler, isPopulated, populate, repopulate, setHandler, setPopulated, sort, toString |
| Methods inherited from class com.imagero.gui.swing.tree.node.DMTreeNode |
add, add, childIndex, createNode, sort |
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
add, breadthFirstEnumeration, clone, depthFirstEnumeration, getChildAfter, getChildBefore, getDepth, getFirstChild, getFirstLeaf, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, removeAllChildren, setAllowsChildren |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DummyNode(java.lang.Object userObject)
| Method Detail |
public java.util.Enumeration children()
javax.swing.tree.DefaultMutableTreeNode
public boolean getAllowsChildren()
javax.swing.tree.DefaultMutableTreeNode
getAllowsChildren in interface javax.swing.tree.TreeNodegetAllowsChildren in class HTreeNodepublic javax.swing.tree.TreeNode getChildAt(int childIndex)
javax.swing.tree.DefaultMutableTreeNode
childIndex - an index into this node's child array
public int getChildCount()
javax.swing.tree.DefaultMutableTreeNode
public int getIndex(javax.swing.tree.TreeNode node)
javax.swing.tree.DefaultMutableTreeNode-1. This method performs a linear search and is O(n)
where n is the number of children.
node - the TreeNode to search for among this node's children
-1 if the specified node is a not
a child of this nodepublic javax.swing.tree.TreeNode getParent()
javax.swing.tree.DefaultMutableTreeNode
public void insert(javax.swing.tree.MutableTreeNode child,
int index)
javax.swing.tree.DefaultMutableTreeNodenewChild 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.
newChild must not be null and must not be an ancestor of
this node.
child - the MutableTreeNode to insert under this nodeindex - the index in this node's child array
where this node is to be insertedDefaultMutableTreeNode.isNodeDescendant(javax.swing.tree.DefaultMutableTreeNode)public boolean isLeaf()
javax.swing.tree.DefaultMutableTreeNodegetAllowsChildren
isLeaf in interface javax.swing.tree.TreeNodeisLeaf in class HTreeNodepublic void remove(int index)
javax.swing.tree.DefaultMutableTreeNodeMutableTreeNode.
index - the index in this node's child array
of the child to removepublic void remove(javax.swing.tree.MutableTreeNode node)
javax.swing.tree.DefaultMutableTreeNodeaChild from this node's child array, giving it a
null parent.
node - a child of this node to removepublic void removeFromParent()
javax.swing.tree.DefaultMutableTreeNode
public void setParent(javax.swing.tree.MutableTreeNode newParent)
javax.swing.tree.DefaultMutableTreeNodenewParent but does not
change the parent's child array. This method is called from
insert() and remove() to
reassign a child's parent, it should not be messaged from anywhere
else.
newParent - this node's new parentpublic void setUserObject(java.lang.Object object)
javax.swing.tree.DefaultMutableTreeNodeuserObject.
object - the Object that constitutes this node's
user-specified dataDefaultMutableTreeNode.getUserObject(),
DefaultMutableTreeNode.toString()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||