|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.tree.AbstractTreeModel
public abstract class AbstractTreeModel
This abstract class provides default implementations for some of the methods in the TreeModel
interface.
It takes care of the management of listeners and provides some conveniences for generating
TreeModelEvents
and dispatching them to the listeners.
Field Summary | |
---|---|
protected EventListenerList |
listenerList
|
Constructor Summary | |
---|---|
AbstractTreeModel()
|
Method Summary | |
---|---|
void |
addTreeModelListener(TreeModelListener l)
|
protected void |
fireTreeNodesChanged(Object source,
Object[] path,
int[] childIndices,
Object[] children)
Fires events to notify the parties who listener to TreeModelEvent about tree nodes are changed. |
protected void |
fireTreeNodesInserted(Object source,
Object[] path,
int[] childIndices,
Object[] children)
Fires events to notify the parties who listener to TreeModelEvent about tree nodes are inserted. |
protected void |
fireTreeNodesRemoved(Object source,
Object[] path,
int[] childIndices,
Object[] children)
Fires events to notify the parties who listener to TreeModelEvent about tree nodes are removed. |
protected void |
fireTreeStructureChanged(Object source,
Object[] path,
int[] childIndices,
Object[] children)
Fires events to notify the parties who listener to TreeModelEvent about tree structure changed. |
protected void |
fireTreeStructureChanged(Object source,
TreePath path)
|
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. |
protected 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. |
TreeModelListener[] |
getTreeModelListeners()
|
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 |
removeTreeModelListener(TreeModelListener l)
|
void |
valueForPathChanged(TreePath path,
Object newValue)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.tree.TreeModel |
---|
getChild, getChildCount, getIndexOfChild, getRoot, isLeaf |
Field Detail |
---|
protected EventListenerList listenerList
Constructor Detail |
---|
public AbstractTreeModel()
Method Detail |
---|
public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel
public void addTreeModelListener(TreeModelListener l)
addTreeModelListener
in interface TreeModel
public void removeTreeModelListener(TreeModelListener l)
removeTreeModelListener
in interface TreeModel
public TreeModelListener[] getTreeModelListeners()
public void nodeChanged(TreeNode node)
node
- the changing tree nodepublic void nodesChanged(TreeNode node, int[] childIndices)
node
- the changing tree nodechildIndices
- the changing child indicespublic TreeNode[] getPathToRoot(TreeNode aNode)
aNode
- the TreeNode to get the path for
protected TreeNode[] getPathToRoot(TreeNode aNode, int depth)
aNode
- the TreeNode to get the path fordepth
- an int giving the number of steps already taken towards the root (on recursive calls), used to size
the returned array
protected void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children)
source
- the Object responsible for generating the event (typically the creator of the event object
passes this
for its value)path
- an array of Object identifying the path to the parent of the modified item(s), where the
first element of the array is the Object stored at the root node and the last element is the
Object stored at the parent nodechildIndices
- an array of int
that specifies the index values of the changed items. The
indices must be in sorted order, from lowest to highestchildren
- an array of Object containing the inserted, removed, or changed objectsprotected void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
source
- the Object responsible for generating the event (typically the creator of the event object
passes this
for its value)path
- an array of Object identifying the path to the parent of the modified item(s), where the
first element of the array is the Object stored at the root node and the last element is the
Object stored at the parent nodechildIndices
- an array of int
that specifies the index values of the inserted items. The
indices must be in sorted order, from lowest to highestchildren
- an array of Object containing the inserted, removed, or changed objectsprotected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
source
- the Object responsible for generating the event (typically the creator of the event object
passes this
for its value)path
- an array of Object identifying the path to the parent of the modified item(s), where the
first element of the array is the Object stored at the root node and the last element is the
Object stored at the parent nodechildIndices
- an array of int
that specifies the index values of the removed items. The
indices must be in sorted order, from lowest to highestchildren
- an array of Object containing the inserted, removed, or changed objectsprotected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
source
- the Object responsible for generating the event (typically the creator of the event object
passes this
for its value)path
- an array of Object identifying the path to the parent of the modified item(s), where the
first element of the array is the Object stored at the root node and the last element is the
Object stored at the parent nodechildIndices
- an array of int
that specifies the index values of the changed items. The
indices must be in sorted order, from lowest to highestchildren
- an array of Object containing the inserted, removed, or changed objectsprotected void fireTreeStructureChanged(Object source, TreePath path)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |