org.argouml.ui.explorer
Class ExplorerEventAdaptor

java.lang.Object
  extended byorg.argouml.ui.explorer.ExplorerEventAdaptor
All Implemented Interfaces:
EventListener, PropertyChangeListener

public final class ExplorerEventAdaptor
extends Object
implements PropertyChangeListener

All events going to the Explorer must pass through here first!

Most will come from the uml model via ExplorerNSUMLEventAdaptor.

TODO: In some cases (test cases) this object is created without setting the treeModel. I (Linus) will add tests for this now. It would be better if this is created only when the Explorer is created.

Since:
0.15.2, Created on 16 September 2003, 23:13

Field Summary
private static ExplorerEventAdaptor instance
          The singleton instance.
private  TreeModelUMLEventListener treeModel
          The tree model to update.
 
Constructor Summary
private ExplorerEventAdaptor()
          Creates a new instance of ExplorerUMLEventAdaptor.
 
Method Summary
static ExplorerEventAdaptor getInstance()
           
 void modelElementAdded(Object source)
          forwards this event to the tree model.
 void modelElementChanged(Object source)
          forwards this event to the tree model.
 void modelElementRemoved(Object source)
          forwards this event to the tree model.
 void propertyChange(PropertyChangeEvent pce)
          Listens to events coming from the project manager, config manager, and uml model, passes those events on to the explorer model.
 void setTreeModelUMLEventListener(TreeModelUMLEventListener newTreeModel)
          sets the tree model that will receive events.
 void structureChanged()
          forwards this event to the tree model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static ExplorerEventAdaptor instance
The singleton instance. TODO: Why is this a singleton? Wouldn't it be better to have exactly one for every Explorer?


treeModel

private TreeModelUMLEventListener treeModel
The tree model to update.

Constructor Detail

ExplorerEventAdaptor

private ExplorerEventAdaptor()
Creates a new instance of ExplorerUMLEventAdaptor.

Method Detail

getInstance

public static ExplorerEventAdaptor getInstance()
Returns:
the instance (singleton)

structureChanged

public void structureChanged()
forwards this event to the tree model.


modelElementRemoved

public void modelElementRemoved(Object source)
forwards this event to the tree model.

Parameters:
source - the modelelement to be removed

modelElementAdded

public void modelElementAdded(Object source)
forwards this event to the tree model.

Parameters:
source - the modelelement to be added

modelElementChanged

public void modelElementChanged(Object source)
forwards this event to the tree model.

Parameters:
source - the modelelement to be changed

setTreeModelUMLEventListener

public void setTreeModelUMLEventListener(TreeModelUMLEventListener newTreeModel)
sets the tree model that will receive events.

Parameters:
newTreeModel - the tree model to be used

propertyChange

public void propertyChange(PropertyChangeEvent pce)
Listens to events coming from the project manager, config manager, and uml model, passes those events on to the explorer model.

Specified by:
propertyChange in interface PropertyChangeListener
Since:
ARGO0.11.2
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook