org.jdesktop.swingx.treetable
Class TreeModelSupport

java.lang.Object
  extended by org.jdesktop.swingx.treetable.TreeModelSupport

public final class TreeModelSupport
extends Object

Support for change notification, usable by TreeModels. The changed/inserted/removed is expressed in terms of a TreePath, it's up to the client model to build it as appropriate. This is inspired by AbstractTreeModel from Christian Kaufhold, www.chka.de.


Field Summary
protected  EventListenerList listeners
           
 
Constructor Summary
TreeModelSupport(TreeModel model)
          Creates the support class for the given TreeModel.
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
           
 void fireChildAdded(TreePath parentPath, int index, Object child)
           
 void fireChildChanged(TreePath parentPath, int index, Object child)
           
 void fireChildRemoved(TreePath parentPath, int index, Object child)
           
 void fireChildrenAdded(TreePath parentPath, int[] indices, Object[] children)
           
 void fireChildrenChanged(TreePath parentPath, int[] indices, Object[] children)
           
 void fireChildrenRemoved(TreePath parentPath, int[] indices, Object[] children)
           
 void fireNewRoot()
          Call when there is a new root, which may be null, i.e.
 void firePathChanged(TreePath path)
          Call when the path itself has changed, but no structure changes have occurred.
 void firePathLeafStateChanged(TreePath path)
          Call when a node has changed its leaf state.
 void fireStructureChanged()
          Call when everything but the root has changed.
 void fireTreeStructureChanged(TreePath parentPath)
          Call when the tree structure below the path has completely changed.
 TreeModelListener[] getTreeModelListeners()
           
 void removeTreeModelListener(TreeModelListener l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected EventListenerList listeners
Constructor Detail

TreeModelSupport

public TreeModelSupport(TreeModel model)
Creates the support class for the given TreeModel.

Parameters:
model - the model to support
Throws:
NullPointerException - if model is null
Method Detail

fireNewRoot

public void fireNewRoot()
Call when there is a new root, which may be null, i.e. not existent.


fireStructureChanged

public void fireStructureChanged()
Call when everything but the root has changed. Only may be called when the root is not null. Otherwise there isn't a structure to have changed.


firePathLeafStateChanged

public void firePathLeafStateChanged(TreePath path)
Call when a node has changed its leaf state.

Parameters:
path - a path ending in the (old) leaf

fireTreeStructureChanged

public void fireTreeStructureChanged(TreePath parentPath)
Call when the tree structure below the path has completely changed.

Parameters:
parentPath - the path to the node that changed

firePathChanged

public void firePathChanged(TreePath path)
Call when the path itself has changed, but no structure changes have occurred.


fireChildAdded

public void fireChildAdded(TreePath parentPath,
                           int index,
                           Object child)

fireChildChanged

public void fireChildChanged(TreePath parentPath,
                             int index,
                             Object child)

fireChildRemoved

public void fireChildRemoved(TreePath parentPath,
                             int index,
                             Object child)

fireChildrenAdded

public void fireChildrenAdded(TreePath parentPath,
                              int[] indices,
                              Object[] children)

fireChildrenChanged

public void fireChildrenChanged(TreePath parentPath,
                                int[] indices,
                                Object[] children)

fireChildrenRemoved

public void fireChildrenRemoved(TreePath parentPath,
                                int[] indices,
                                Object[] children)

addTreeModelListener

public void addTreeModelListener(TreeModelListener l)

getTreeModelListeners

public TreeModelListener[] getTreeModelListeners()

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)