public abstract class AbstractTreeModel extends java.lang.Object implements Disposable, javax.swing.tree.TreeModel
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
protected boolean |
disposed |
protected TreeModelListenerList |
listeners |
Constructor and Description |
---|
AbstractTreeModel() |
Modifier and Type | Method and Description |
---|---|
void |
addTreeModelListener(javax.swing.event.TreeModelListener listener)
Adds a listener for changes in a tree model.
|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
removeTreeModelListener(javax.swing.event.TreeModelListener listener)
Removes a previously added listener.
|
protected void |
treeNodesChanged(javax.swing.tree.TreePath path,
int[] indices,
java.lang.Object[] children)
Notifies all added listeners that some nodes were changed.
|
protected void |
treeNodesInserted(javax.swing.tree.TreePath path,
int[] indices,
java.lang.Object[] children)
Notifies all added listeners that some nodes were inserted.
|
protected void |
treeNodesRemoved(javax.swing.tree.TreePath path,
int[] indices,
java.lang.Object[] children)
/**
Notifies all added listeners that some nodes were removed.
|
protected void |
treeStructureChanged(javax.swing.tree.TreePath path,
int[] indices,
java.lang.Object[] children)
Notifies all added listeners that a tree hierarchy was changed.
|
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object value) |
protected final TreeModelListenerList listeners
protected volatile boolean disposed
public void dispose()
Disposable
dispose
in interface Disposable
protected void treeStructureChanged(javax.swing.tree.TreePath path, int[] indices, java.lang.Object[] children)
path
- the path to the parent of the modified itemsindices
- index values of the modified itemschildren
- an array containing the inserted, removed, or changed objectsTreeModelListener.treeStructureChanged(TreeModelEvent)
protected void treeNodesChanged(javax.swing.tree.TreePath path, int[] indices, java.lang.Object[] children)
path
- the path to the parent of the modified itemsindices
- index values of the modified itemschildren
- an array containing the inserted, removed, or changed objectsTreeModelListener.treeNodesChanged(TreeModelEvent)
protected void treeNodesInserted(javax.swing.tree.TreePath path, int[] indices, java.lang.Object[] children)
path
- the path to the parent of the modified itemsindices
- index values of the modified itemschildren
- an array containing the inserted, removed, or changed objectsTreeModelListener.treeNodesInserted(TreeModelEvent)
protected void treeNodesRemoved(javax.swing.tree.TreePath path, int[] indices, java.lang.Object[] children)
path
- the path to the parent of the modified itemsindices
- index values of the modified itemschildren
- an array containing the inserted, removed, or changed objectsTreeModelListener.treeNodesRemoved(TreeModelEvent)
public void addTreeModelListener(javax.swing.event.TreeModelListener listener)
addTreeModelListener
in interface javax.swing.tree.TreeModel
listener
- a listener to addpublic void removeTreeModelListener(javax.swing.event.TreeModelListener listener)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
listener
- a listener to removepublic void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object value)
valueForPathChanged
in interface javax.swing.tree.TreeModel
path
- the path to the node that the user has alteredvalue
- the new value from the tree cell editorDefaultTreeModel.valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)