|
Préférences
Moteurs de recherche
|
|||||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.5.0
javax.swing
|
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 | |
---|---|
JTree.DynamicUtilTreeNode(Object value,
Object children)
Creates a node with the specified object as its value and with the specified children. |
Method Summary | |
---|---|
Enumeration |
children()
Subclassed to load the children, if necessary. |
static void |
createChildren(DefaultMutableTreeNode parent,
Object children)
Adds to parent all the children in children . |
TreeNode |
getChildAt(int index)
Subclassed to load the children, if necessary. |
int |
getChildCount()
Returns the number of child nodes. |
boolean |
isLeaf()
Returns true if this node allows children. |
protected void |
loadChildren()
Loads the children based on childValue . |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean hasChildren
JTree
have children?
This property is currently not implemented.
protected Object childValue
protected boolean loadedChildren
Constructor Detail |
---|
public JTree.DynamicUtilTreeNode(Object value, Object children)
Vector
, or a Hashtable
-- even
if empty. Otherwise, the node is not
allowed to have children.
value
- the Object
that is the value for the
new nodechildren
- an array of Object
s, 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 childrenMethod Detail |
---|
public static void createChildren(DefaultMutableTreeNode parent, Object children)
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.
public boolean isLeaf()
isLeaf
in interface TreeNode
isLeaf
in class DefaultMutableTreeNode
JTree.DynamicUtilTreeNode(java.lang.Object, java.lang.Object)
public int getChildCount()
getChildCount
in interface TreeNode
getChildCount
in class DefaultMutableTreeNode
protected void loadChildren()
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.
public TreeNode getChildAt(int index)
getChildAt
in interface TreeNode
getChildAt
in class DefaultMutableTreeNode
index
- an index into this node's child array
public Enumeration children()
children
in interface TreeNode
children
in class DefaultMutableTreeNode