org.geotools.gui.swing.tree
Class DefaultMutableTreeNode

Object
  extended by DefaultMutableTreeNode
      extended by DefaultMutableTreeNode
All Implemented Interfaces:
Serializable, Cloneable, MutableTreeNode, TreeNode
Direct Known Subclasses:
NamedTreeNode

public class DefaultMutableTreeNode
extends DefaultMutableTreeNode
implements MutableTreeNode

General-purpose node in a tree data structure. This default implementation implements Geotools MutableTreeNode interface, which inherits a getUserObject() method. This method is provided in Swing DefaultMutableTreeNode implementation but seems to have been forgotten in all Swing interfaces.

Since:
2.0
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form
Module:

Field Summary
 
Fields inherited from class DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
DefaultMutableTreeNode()
          Creates a tree node that has no parent and no children, but which allows children.
DefaultMutableTreeNode(Object userObject)
          Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object.
DefaultMutableTreeNode(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
 
Methods inherited from class 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, toString
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface MutableTreeNode
insert, remove, remove, removeFromParent, setParent, setUserObject
 
Methods inherited from interface TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 
Methods inherited from interface TreeNode
getUserObject
 
Methods inherited from interface TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 

Constructor Detail

DefaultMutableTreeNode

public DefaultMutableTreeNode()
Creates a tree node that has no parent and no children, but which allows children.


DefaultMutableTreeNode

public DefaultMutableTreeNode(Object userObject)
Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object.

Parameters:
userObject - an Object provided by the user that constitutes the node's data

DefaultMutableTreeNode

public DefaultMutableTreeNode(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.

Parameters:
userObject - an Object provided by the user that constitutes the node's data
allowsChildren - if true, the node is allowed to have child nodes -- otherwise, it is always a leaf node


Copyright © 1996-2009 Geotools. All Rights Reserved.