org.springframework.richclient.tree
Class AbstractTreeModel

java.lang.Object
  extended by org.springframework.richclient.tree.AbstractTreeModel
All Implemented Interfaces:
TreeModel

public abstract class AbstractTreeModel
extends Object
implements TreeModel

Author:
Keith Donald

Constructor Summary
protected AbstractTreeModel(Object root)
           
protected AbstractTreeModel(ValueModel rootHolder)
           
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
          Adds a listener for the TreeModelEvent posted after the tree changes.
protected  void fireRootNodeChanged(Object previousRoot)
          The only event raised by this model is TreeStructureChanged with the root as path, i.e.
protected  void fireRootTreeStructureChanged(Object previousRoot)
          The only event raised by this model is TreeStructureChanged with the root as path, i.e.
protected  void fireTreeNodeChanged(Object[] path, int index, Object child)
           
protected  void fireTreeNodeInserted(Object[] path, int index, Object child)
           
protected  void fireTreeNodeRemoved(Object[] path, int index, Object child)
           
protected  void fireTreeNodesChanged(Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
protected  void fireTreeNodesInserted(Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
protected  void fireTreeNodesRemoved(Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
protected  void fireTreeStructureChanged(Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
protected  void fireTreeStructureChanged(Object[] path, int index, Object child)
           
 Object getRoot()
           
protected  ValueModel getRootHolder()
           
 TreeModelListener[] getTreeModelListeners()
          Returns an array of all the tree model listeners registered on this model.
 void removeTreeModelListener(TreeModelListener l)
          Removes a listener previously added with addTreeModelListener() .
 
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, isLeaf, valueForPathChanged
 

Constructor Detail

AbstractTreeModel

protected AbstractTreeModel(Object root)

AbstractTreeModel

protected AbstractTreeModel(ValueModel rootHolder)
Method Detail

getRoot

public Object getRoot()
Specified by:
getRoot in interface TreeModel

getRootHolder

protected ValueModel getRootHolder()

addTreeModelListener

public void addTreeModelListener(TreeModelListener l)
Adds a listener for the TreeModelEvent posted after the tree changes.

Specified by:
addTreeModelListener in interface TreeModel
Parameters:
l - the listener to add
See Also:
removeTreeModelListener(javax.swing.event.TreeModelListener)

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)
Removes a listener previously added with addTreeModelListener() .

Specified by:
removeTreeModelListener in interface TreeModel
Parameters:
l - the listener to remove
See Also:
addTreeModelListener(javax.swing.event.TreeModelListener)

getTreeModelListeners

public TreeModelListener[] getTreeModelListeners()
Returns an array of all the tree model listeners registered on this model.

Returns:
all of this model's TreeModelListener s or an empty array if no tree model listeners are currently registered
See Also:
addTreeModelListener(javax.swing.event.TreeModelListener), removeTreeModelListener(javax.swing.event.TreeModelListener)

fireTreeNodesChanged

protected void fireTreeNodesChanged(Object[] path,
                                    int[] childIndices,
                                    Object[] children)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Parameters:
source - the node being changed
path - the path to the root node
childIndices - the indices of the changed elements
children - the changed elements
See Also:
EventListenerList

fireTreeNodesInserted

protected void fireTreeNodesInserted(Object[] path,
                                     int[] childIndices,
                                     Object[] children)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Parameters:
source - the node where new elements are being inserted
path - the path to the root node
childIndices - the indices of the new elements
children - the new elements
See Also:
EventListenerList

fireTreeNodesRemoved

protected void fireTreeNodesRemoved(Object[] path,
                                    int[] childIndices,
                                    Object[] children)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Parameters:
source - the node where elements are being removed
path - the path to the root node
childIndices - the indices of the removed elements
children - the removed elements
See Also:
EventListenerList

fireTreeStructureChanged

protected void fireTreeStructureChanged(Object[] path,
                                        int[] childIndices,
                                        Object[] children)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Parameters:
source - the node where the tree model has changed
path - the path to the root node
childIndices - the indices of the affected elements
children - the affected elements
See Also:
EventListenerList

fireRootNodeChanged

protected void fireRootNodeChanged(Object previousRoot)
The only event raised by this model is TreeStructureChanged with the root as path, i.e. the whole tree has changed.


fireRootTreeStructureChanged

protected void fireRootTreeStructureChanged(Object previousRoot)
The only event raised by this model is TreeStructureChanged with the root as path, i.e. the whole tree has changed.


fireTreeNodeRemoved

protected void fireTreeNodeRemoved(Object[] path,
                                   int index,
                                   Object child)

fireTreeNodeInserted

protected void fireTreeNodeInserted(Object[] path,
                                    int index,
                                    Object child)

fireTreeStructureChanged

protected void fireTreeStructureChanged(Object[] path,
                                        int index,
                                        Object child)

fireTreeNodeChanged

protected void fireTreeNodeChanged(Object[] path,
                                   int index,
                                   Object child)


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.