org.argouml.ui.explorer
Class ExplorerTreeModel

java.lang.Object
  extended byjavax.swing.tree.DefaultTreeModel
      extended byorg.argouml.ui.explorer.ExplorerTreeModel
All Implemented Interfaces:
java.util.EventListener, java.awt.event.ItemListener, java.io.Serializable, javax.swing.tree.TreeModel, TreeModelUMLEventListener

public class ExplorerTreeModel
extends javax.swing.tree.DefaultTreeModel
implements TreeModelUMLEventListener, java.awt.event.ItemListener

The model for the Explorer tree view of the uml model. provides: - receives events from the uml model and updates itself and the tree ui. - responds to changes in perspetive and ordering.

Since:
0.15.2
See Also:
Serialized Form

Field Summary
(package private)  java.util.Map modelElementMap
          a map used to resolve model elements to tree nodes when determining what effect a model event will have on the tree.
(package private)  java.util.Comparator order
          the global order for siblings in the tree.
(package private)  java.lang.Object[] rules
          an array of PerspectiveRules, that determine the tree view.
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
ExplorerTreeModel(java.lang.Object root)
          Creates a new instance of ExplorerTreeModel
 
Method Summary
 void addAllChildren(javax.swing.tree.TreePath path)
          builds the next level of the explorer tree for a given tree path.
private  void addToMap(java.lang.Object modelElement, javax.swing.tree.TreeNode node)
          adds a new tree node and model element to the map.
private  java.util.Collection findNodes(java.lang.Object modelElement)
          node lookup for a given model element.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Updates the explorer for new perspectives / orderings.
 void modelElementAdded(java.lang.Object node)
          a model element has been added to the model.
 void modelElementChanged(java.lang.Object node)
          a model element has changed in some way.
 void modelElementRemoved(java.lang.Object node)
          a model element has been removed from the model.
 void structureChanged()
          the model structure has changed, eg a new project.
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rules

java.lang.Object[] rules
an array of PerspectiveRules, that determine the tree view.


modelElementMap

java.util.Map modelElementMap
a map used to resolve model elements to tree nodes when determining what effect a model event will have on the tree.


order

java.util.Comparator order
the global order for siblings in the tree.

Constructor Detail

ExplorerTreeModel

public ExplorerTreeModel(java.lang.Object root)
Creates a new instance of ExplorerTreeModel

Method Detail

modelElementChanged

public void modelElementChanged(java.lang.Object node)
a model element has changed in some way.

Specified by:
modelElementChanged in interface TreeModelUMLEventListener

modelElementAdded

public void modelElementAdded(java.lang.Object node)
a model element has been added to the model.

Specified by:
modelElementAdded in interface TreeModelUMLEventListener

modelElementRemoved

public void modelElementRemoved(java.lang.Object node)
a model element has been removed from the model.

Specified by:
modelElementRemoved in interface TreeModelUMLEventListener

structureChanged

public void structureChanged()
the model structure has changed, eg a new project.

Specified by:
structureChanged in interface TreeModelUMLEventListener

addAllChildren

public void addAllChildren(javax.swing.tree.TreePath path)
builds the next level of the explorer tree for a given tree path.


addToMap

private void addToMap(java.lang.Object modelElement,
                      javax.swing.tree.TreeNode node)
adds a new tree node and model element to the map. nodes are removed from the map when a modelElementRemoved event is received.


findNodes

private java.util.Collection findNodes(java.lang.Object modelElement)
node lookup for a given model element.


itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Updates the explorer for new perspectives / orderings.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener


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