This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing
class JTree.DynamicUtilTreeNode

java.lang.Object extended by javax.swing.tree.DefaultMutableTreeNode extended by javax.swing.JTree.DynamicUtilTreeNode
All Implemented Interfaces:
Serializable, Cloneable, MutableTreeNode
Enclosing class:
JTree

public static class JTree.DynamicUtilTreeNode
extends DefaultMutableTreeNode

DynamicUtilTreeNode can wrap vectors/hashtables/arrays/strings and create the appropriate children tree nodes as necessary. It is dynamic in that it will only create the children as necessary.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see {@link java.beans.XMLEncoder}.


Field Summary
protected Object childValue
          Value to create children with.
protected boolean hasChildren
          Does the this JTree have children? This property is currently not implemented.
protected boolean loadedChildren
          Have the children been loaded yet?
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary

          Creates a node with the specified object as its value and with the specified children.
 
Method Summary
 Enumeration

          Subclassed to load the children, if necessary.
static void

          Adds to parent all the children in children.
 TreeNode
getChildAt(int index)

          Subclassed to load the children, if necessary.
 int

          Returns the number of child nodes.
 boolean

          Returns true if this node allows children.
protected void

          Loads the children based on childValue.
 
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, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

childValue

protected Object childValue
Value to create children with.

hasChildren

protected boolean hasChildren
Does the this JTree have children? This property is currently not implemented.

loadedChildren

protected boolean loadedChildren
Have the children been loaded yet?
Constructor Detail

JTree.DynamicUtilTreeNode

public JTree.DynamicUtilTreeNode(Object value,
                                 Object children)
Creates a node with the specified object as its value and with the specified children. For the node to allow children, the children-object must be an array of objects, a Vector, or a Hashtable -- even if empty. Otherwise, the node is not allowed to have children.

Parameters:
value - the Object that is the value for the new node
children - an array of Objects, a Vector, or a Hashtable used to create the child nodes; if any other object is specified, or if the value is null, then the node is not allowed to have children
Method Detail

children

public Enumeration children()
Subclassed to load the children, if necessary.

Overrides:
children in class DefaultMutableTreeNode

createChildren

public static void createChildren(DefaultMutableTreeNode parent,
                                  Object children)
Adds to parent all the children in children. If children is an array or vector all of its elements are added is children, otherwise if children is a hashtable all the key/value pairs are added in the order Enumeration returns them.

Parameters:
parent
children

getChildAt

public TreeNode getChildAt(int index)
Subclassed to load the children, if necessary.

Overrides:
getChildAt in class DefaultMutableTreeNode
Parameters:
index

getChildCount

public int getChildCount()
Returns the number of child nodes.

Overrides:
getChildCount in class DefaultMutableTreeNode
Returns:
the number of child nodes

isLeaf

public boolean isLeaf()
Returns true if this node allows children. Whether the node allows children depends on how it was created.

Overrides:
isLeaf in class DefaultMutableTreeNode
Returns:
true if this node allows children, false otherwise

loadChildren

protected void loadChildren()
Loads the children based on childValue. If childValue is a Vector or array each element is added as a child, if childValue is a Hashtable each key/value pair is added in the order that Enumeration returns the keys.



This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.