|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultMutableTreeNode org.geotools.gui.swing.tree.DefaultMutableTreeNode org.geotools.gui.swing.tree.NamedTreeNode
A tree node with a name which may be different than the user object. The JTree
component invokes the toString()
method for populating the tree widget. This class
overrides the default implementation (
)
with a custom label.
userObject
.toString
Field Summary |
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
NamedTreeNode(java.lang.String name)
Creates a tree node that has no parent and no children, but which allows children. |
|
NamedTreeNode(java.lang.String name,
java.lang.Object userObject)
Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object. |
|
NamedTreeNode(java.lang.String name,
java.lang.Object userObject,
boolean allowsChildren)
Creates a tree node with no parent, no children, initialized with the specified user object, and that allows children only if specified. |
Method Summary | |
java.lang.String |
toString()
Returns this node label. |
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.swing.tree.MutableTreeNode |
insert, remove, remove, removeFromParent, setParent, setUserObject |
Methods inherited from interface javax.swing.tree.TreeNode |
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf |
Methods inherited from interface org.geotools.gui.swing.tree.TreeNode |
getUserObject |
Constructor Detail |
public NamedTreeNode(java.lang.String name)
name
- The node name to be returned by toString()
.public NamedTreeNode(java.lang.String name, java.lang.Object userObject)
name
- The node name to be returned by toString()
.userObject
- an Object provided by the user that constitutes the node's datapublic NamedTreeNode(java.lang.String name, java.lang.Object userObject, boolean allowsChildren)
name
- The node name to be returned by toString()
.userObject
- an Object provided by the user that constitutes the node's dataallowsChildren
- if true, the node is allowed to have child nodes -- otherwise,
it is always a leaf nodeMethod Detail |
public java.lang.String toString()
JTree
for populating
the tree widget.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |