ehsbe CommonsTM
Version 1.1.0rc3

com.ehsbe.commons.gui.util
Class AbstractTreeModel

java.lang.Object
  extended by com.ehsbe.commons.gui.util.AbstractTreeModel
All Implemented Interfaces:
TreeModel

public abstract class AbstractTreeModel
extends Object
implements TreeModel

Version:
$Revision: 432 $
Author:
Jens Elkner

Field Summary
protected  CopyOnWriteArrayList<TreeModelListener> listenerList
          Listeners.
 
Constructor Summary
AbstractTreeModel()
           
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
          Adds a listener for the TreeModelEvent posted after the tree changes.
protected  void fireTreeNodesChanged(Object source, TreePath path, int[] childIndices, Object... children)
          Notifies all listeners that have registered interest for notification on this event type.
protected  void fireTreeNodesInserted(Object source, TreePath path, int[] childIndices, Object... children)
          Notifies all listeners that have registered interest for notification on this event type.
protected  void fireTreeNodesRemoved(Object source, TreePath path, int[] childIndices, Object... children)
          Notifies all listeners that have registered interest for notification on this event type.
protected  void fireTreeStructureChanged(Object source, TreePath path)
          Notifies all listeners that have registered interest for notification on this event type.
 TreeModelListener[] getListeners()
          Get a list of all tree listeners, which listen to this model changes.
 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, getRoot, isLeaf, valueForPathChanged
 

Field Detail

listenerList

protected CopyOnWriteArrayList<TreeModelListener> listenerList
Listeners.

Constructor Detail

AbstractTreeModel

public AbstractTreeModel()
Method Detail

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)

fireTreeNodesRemoved

protected void fireTreeNodesRemoved(Object source,
                                    TreePath 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

fireTreeNodesInserted

protected void fireTreeNodesInserted(Object source,
                                     TreePath 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

fireTreeNodesChanged

protected void fireTreeNodesChanged(Object source,
                                    TreePath 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

fireTreeStructureChanged

protected void fireTreeStructureChanged(Object source,
                                        TreePath path)
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

getListeners

public TreeModelListener[] getListeners()
Get a list of all tree listeners, which listen to this model changes.

Returns:
a possible empty list.

ehsbe CommonsTM
Version 1.1.0rc3

Copyright ©2005-2009 EHSBE, Walther-Rathenau-Str. 58, 39104 Magdeburg, Sachsen-Anhalt, Germany. All Rights Reserved.