Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.swing.tree.DefaultTreeModel
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 Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Field Summary | |
boolean | asksAllowsChildren
Determines how the isLeaf determines if
a node is a leaf node. |
EventListenerList | listenerList
Listeners. |
TreeNode | root
Root of the tree. |
Constructor Summary | |
DefaultTreeModel(TreeNode root)
|
|
DefaultTreeModel(TreeNode root,
boolean asksAllowsChildren)
|
Method Summary | |
void | addTreeModelListener(TreeModelListener l)
|
boolean | asksAllowsChildren()
Tells how leaf nodes are determined. |
void | fireTreeNodesChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
|
void | fireTreeNodesInserted(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
|
void | fireTreeNodesRemoved(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
|
void | fireTreeStructureChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
|
int | getChildCount(java.lang.Object parent)
|
java.lang.Object | getChild(java.lang.Object parent,
int index)
|
int | getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
|
TreeNode[] | getPathToRoot(TreeNode aNode)
Builds the parents of node up to and including the root node, where the original node is the last element in the returned array. |
TreeNode[] | getPathToRoot(TreeNode aNode,
int depth)
Builds the parents of node up to and including the root node, where the original node is the last element in the returned array. |
java.lang.Object | getRoot()
|
void | insertNodeInto(MutableTreeNode newChild,
MutableTreeNode parent,
int index)
Invoked this to insert newChild at location index in parents children. |
boolean | isLeaf(java.lang.Object node)
Returns whether the specified node is a leaf node. |
void | nodeChanged(TreeNode node)
Invoke this method after you've changed how node is to be represented in the tree. |
void | nodesChanged(TreeNode node,
int[] childIndices)
Invoke this method after you've changed how the children identified by childIndicies are to be represented in the tree. |
void | nodeStructureChanged(TreeNode node)
Invoke this method if you've totally changed the children of node and its childrens children... |
void | nodesWereInserted(TreeNode node,
int[] childIndices)
Invoke this method after you've inserted some TreeNodes into node. childIndices should be the index of the new elements and must be sorted in ascending order. |
void | nodesWereRemoved(TreeNode node,
int[] childIndices,
java.lang.Object[] removedChildren)
Invoke this method after you've removed some TreeNodes from node. childIndices should be the index of the removed elements and must be sorted in ascending order. |
void | reload()
Invoke this method if you've modified the TreeNodes upon which this model depends. |
void | reload(TreeNode node)
Invoke this method if you've modified the TreeNodes upon which this model depends. |
void | removeNodeFromParent(MutableTreeNode node)
Message this to remove node from its parent. |
void | removeTreeModelListener(TreeModelListener l)
|
void | setAsksAllowsChildren(boolean newValue)
Sets whether or not to test leafness by asking getAllowsChildren() or isLeaf() to the TreeNodes. |
void | valueForPathChanged(TreePath path,
java.lang.Object newValue)
This sets the user object of the TreeNode identified by path and posts a node changed. |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected TreeNode root
protected EventListenerList listenerList
protected boolean asksAllowsChildren
isLeaf
determines if
a node is a leaf node. If true, a node is a leaf
node if it does not allow children. (If it allows
children, it is not a leaf node, even if no children
are present.) If this value is false, then any node
which has no children is a leaf node.Constructor Detail |
public DefaultTreeModel(TreeNode root)
public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren)
Method Detail |
public void setAsksAllowsChildren(boolean newValue)
public boolean asksAllowsChildren()
public java.lang.Object getRoot()
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
public java.lang.Object getChild(java.lang.Object parent, int index)
public int getChildCount(java.lang.Object parent)
public boolean isLeaf(java.lang.Object node)
askAllowsChildren
setting.
node
- the node to checkpublic void reload()
public void valueForPathChanged(TreePath path, java.lang.Object newValue)
public void insertNodeInto(MutableTreeNode newChild, MutableTreeNode parent, int index)
public void removeNodeFromParent(MutableTreeNode node)
public void nodeChanged(TreeNode node)
public void reload(TreeNode node)
node
(PENDING).public void nodesWereInserted(TreeNode node, int[] childIndices)
public void nodesWereRemoved(TreeNode node, int[] childIndices, java.lang.Object[] removedChildren)
public void nodesChanged(TreeNode node, int[] childIndices)
public void nodeStructureChanged(TreeNode node)
public TreeNode[] getPathToRoot(TreeNode aNode)
aNode
- the TreeNode to get the path for
an
- array of TreeNodes giving the path from the root to the
specified node.protected TreeNode[] getPathToRoot(TreeNode aNode, int depth)
aNode
- the TreeNode to get the path for
depth
- an int giving the number of steps already taken towards
the root (on recursive calls), used to size the returned arraypublic void addTreeModelListener(TreeModelListener l)
public void removeTreeModelListener(TreeModelListener l)
protected void fireTreeNodesChanged(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
protected void fireTreeNodesInserted(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
protected void fireTreeNodesRemoved(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
protected void fireTreeStructureChanged(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |