fireTreeNodesChanged
protected void fireTreeNodesChanged(Object source,
Object[] path,
int[] childIndices,
Object[] children)
Notify all listeners of a node change.
source
- the node being changedpath
- the path to the root nodechildIndices
- the indices of the changed elementschildren
- the changed elements
fireTreeNodesInserted
protected void fireTreeNodesInserted(Object source,
Object[] path,
int[] childIndices,
Object[] children)
Notify all listeners of structure change.
source
- the node where new elements are being insertedpath
- the path to the root nodechildIndices
- the indices of the new elementschildren
- the new elements
fireTreeNodesRemoved
protected void fireTreeNodesRemoved(Object source,
Object[] path,
int[] childIndices,
Object[] children)
Notify all listeners of structure change.
source
- the node where elements are being removedpath
- the path to the root nodechildIndices
- the indices of the removed elementschildren
- the removed elements
fireTreeStructureChanged
protected void fireTreeStructureChanged(Object source,
Object[] path,
int[] childIndices,
Object[] children)
Notify all listeners of structure change.
source
- the node where the tree model has changedpath
- the path to the root nodechildIndices
- the indices of the affected elementschildren
- the affected elements
fireTreeStructureChanged
protected void fireTreeStructureChanged(Object source,
TreePath path)
Notify all listeners of structure change.
source
- the node where the tree model has changedpath
- the path to the root node
getChild
public Object getChild(Object parent,
int index)
- getChild in interface TreeModel
getPathToRoot
public TreeNode[] getPathToRoot(TreeNode node)
Collect all parent nodes up to the root node.
node
- the TreeNode to get the path for
getPathToRoot
protected TreeNode[] getPathToRoot(TreeNode node,
int depth)
Recursivly collect parent nodes up the the root node.
node
- the TreeNode to get the path fordepth
- number of steps already taken towards the root (on recursive calls)
- an array giving the path from the root to the specified node
nodeChanged
public void nodeChanged(TreeNode node)
Invoke this method after you've changed how node is to be
represented in the tree.
nodeStructureChanged
public void nodeStructureChanged(TreeNode node)
Invoke this method if you've totally changed the children of
node and its childrens children... This will post a
treeStructureChanged event.
nodesChanged
public 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.
nodesWereInserted
public 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.
nodesWereRemoved
public void nodesWereRemoved(TreeNode node,
int[] childIndices,
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. And removedChildren should be
the array of the children objects that were removed.