org.annotation.agschema.graphics.vtree
Class TreeMutationSupport

java.lang.Object
  extended byorg.annotation.agschema.graphics.vtree.TreeMutationSupport
All Implemented Interfaces:
java.util.EventListener, java.beans.PropertyChangeListener

public class TreeMutationSupport
extends java.lang.Object
implements java.beans.PropertyChangeListener

Convenience class that maintains a set of listeners and notifies them of the appropriate event. No order guarantees are made on the order in which the listeners are messaged.

Author:
nikhild

Constructor Summary
TreeMutationSupport(javax.swing.tree.TreeNode root)
          Creates a new instance of TreeMutationSupport
 
Method Summary
 void addListener(TreeMutationListener l)
           
 void fireChildAdded(javax.swing.tree.MutableTreeNode parent, int childIndex)
          Notifies the listeners of the childAdded event
 void fireChildRemoved(javax.swing.tree.MutableTreeNode parent, javax.swing.tree.MutableTreeNode child, int oldChildIndex)
          Notifies the listeners of the childRemoved event
 void fireNodeObjectChanged(javax.swing.tree.MutableTreeNode node, java.lang.Object oldUserObject)
          Notifies the listeners of the nodeObjectChanged event
 void fireSubtreeDamaged(javax.swing.tree.MutableTreeNode subtreeRoot)
          Notifies the listeners of the subtreeDamaged event
 javax.swing.tree.TreeNode getRoot()
          Convenience method to get the root
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void removeListener(TreeMutationListener l)
          The listener to remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeMutationSupport

public TreeMutationSupport(javax.swing.tree.TreeNode root)
Creates a new instance of TreeMutationSupport

Method Detail

getRoot

public javax.swing.tree.TreeNode getRoot()
Convenience method to get the root


addListener

public void addListener(TreeMutationListener l)

removeListener

public void removeListener(TreeMutationListener l)
The listener to remove

Parameters:
l - the listener to remove

fireChildAdded

public void fireChildAdded(javax.swing.tree.MutableTreeNode parent,
                           int childIndex)
Notifies the listeners of the childAdded event


fireChildRemoved

public void fireChildRemoved(javax.swing.tree.MutableTreeNode parent,
                             javax.swing.tree.MutableTreeNode child,
                             int oldChildIndex)
Notifies the listeners of the childRemoved event


fireNodeObjectChanged

public void fireNodeObjectChanged(javax.swing.tree.MutableTreeNode node,
                                  java.lang.Object oldUserObject)
Notifies the listeners of the nodeObjectChanged event


fireSubtreeDamaged

public void fireSubtreeDamaged(javax.swing.tree.MutableTreeNode subtreeRoot)
Notifies the listeners of the subtreeDamaged event


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener