public interface TreeModel
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Return the child of
parent at index index
in the parent's child array. |
int |
getChildCount(java.lang.Object parent)
Answer the number of children of
parent. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
Return the index of child in parent.
|
java.lang.Object |
getRoot()
Return the root of the tree.
|
java.util.Collection |
getTreeModelListeners()
Answer the mutable collection of tree model listeners.
|
boolean |
isLeaf(java.lang.Object node)
Answer
true if node is a leaf. |
void |
valueForPathChanged(TreePath path,
java.lang.Object newValue)
Called when the value for the item identified
by
path has changed to newValue. |
java.lang.Object getRoot()
java.lang.Object getChild(java.lang.Object parent,
int index)
parent at index index
in the parent's child array.parent - a node in the treeparent at index indexint getChildCount(java.lang.Object parent)
parent.parent - a node in the treeparentboolean isLeaf(java.lang.Object node)
true if node is a leaf.node - a node in the treenode is a leafvoid valueForPathChanged(TreePath path, java.lang.Object newValue)
path has changed to newValue.
If newValue signifies a truly new value
the model should post a treeNodesChanged event.path - path to the node that has been alterednewValue - the new value from the TreeCellEditorint getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
parent - a node in the treechild - the node we are interested inchild or parent are nulljava.util.Collection getTreeModelListeners()