org.argouml.uml.ui
Class UMLTreeModel

java.lang.Object
  |
  +--javax.swing.tree.DefaultTreeModel
        |
        +--org.argouml.uml.ui.UMLTreeModel
All Implemented Interfaces:
java.util.EventListener, ru.novosoft.uml.MElementListener, java.io.Serializable, javax.swing.tree.TreeModel, UMLUserInterfaceComponent

public class UMLTreeModel
extends javax.swing.tree.DefaultTreeModel
implements UMLUserInterfaceComponent

This class is an abstract superclass for classes that provide a tree model of UML model elements.

See Also:
Serialized Form

Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
UMLTreeModel(UMLUserInterfaceContainer container, UMLTreeRootNode root)
          Creates a new tree model
 
Method Summary
 boolean buildPopup(javax.swing.JPopupMenu popup, javax.swing.tree.TreePath path)
           
 void fireTreeStructureChanged()
           
 java.lang.Object formatElement(ru.novosoft.uml.foundation.core.MModelElement element)
          This method returns a rendering (typically a String) of the model element for the list.
 void listRoleItemSet(ru.novosoft.uml.MElementEvent mee)
           
 void navigateTo(ru.novosoft.uml.foundation.core.MModelElement modelElement)
          This method is called by context menu actions that desire to change to currently displayed object.
 void propertySet(ru.novosoft.uml.MElementEvent mee)
           
 void recovered(ru.novosoft.uml.MElementEvent mee)
           
 void removed(ru.novosoft.uml.MElementEvent mee)
           
 void roleAdded(ru.novosoft.uml.MElementEvent mee)
           
 void roleRemoved(ru.novosoft.uml.MElementEvent mee)
           
 void targetChanged()
          This method is called when the target of a UMLUserInterfaceContainer has been changed.
 void targetReasserted()
          This method is called when the navigation history has been changed (and navigation buttons may need to be updated). targetChanged implies navigationHistoryChanged, so this method will not be called after a targetChange.
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, 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
 

Constructor Detail

UMLTreeModel

public UMLTreeModel(UMLUserInterfaceContainer container,
                    UMLTreeRootNode root)
Creates a new tree model
Parameters:
container - the container (typically a PropPanelClass or PropPanelInterface) that provides access to the target classifier.
property - a string that specifies the name of an event that should force a refresh of the list model. A null value will cause all events to trigger a refresh.
showNone - if true, an element labelled "none" will be shown where there are no actual entries in the list.
Method Detail

formatElement

public java.lang.Object formatElement(ru.novosoft.uml.foundation.core.MModelElement element)
This method returns a rendering (typically a String) of the model element for the list. Default implementation defers to the current Profile of the container, but this method may be overriden.
Parameters:
@element - model element
Returns:
rendering of the ModelElement

targetChanged

public void targetChanged()
Description copied from interface: UMLUserInterfaceComponent
This method is called when the target of a UMLUserInterfaceContainer has been changed.
Specified by:
targetChanged in interface UMLUserInterfaceComponent

targetReasserted

public void targetReasserted()
Description copied from interface: UMLUserInterfaceComponent
This method is called when the navigation history has been changed (and navigation buttons may need to be updated). targetChanged implies navigationHistoryChanged, so this method will not be called after a targetChange.
Specified by:
targetReasserted in interface UMLUserInterfaceComponent

fireTreeStructureChanged

public void fireTreeStructureChanged()

propertySet

public void propertySet(ru.novosoft.uml.MElementEvent mee)
Specified by:
propertySet in interface ru.novosoft.uml.MElementListener

listRoleItemSet

public void listRoleItemSet(ru.novosoft.uml.MElementEvent mee)
Specified by:
listRoleItemSet in interface ru.novosoft.uml.MElementListener

recovered

public void recovered(ru.novosoft.uml.MElementEvent mee)
Specified by:
recovered in interface ru.novosoft.uml.MElementListener

removed

public void removed(ru.novosoft.uml.MElementEvent mee)
Specified by:
removed in interface ru.novosoft.uml.MElementListener

roleAdded

public void roleAdded(ru.novosoft.uml.MElementEvent mee)
Specified by:
roleAdded in interface ru.novosoft.uml.MElementListener

roleRemoved

public void roleRemoved(ru.novosoft.uml.MElementEvent mee)
Specified by:
roleRemoved in interface ru.novosoft.uml.MElementListener

navigateTo

public void navigateTo(ru.novosoft.uml.foundation.core.MModelElement modelElement)
This method is called by context menu actions that desire to change to currently displayed object.
Parameters:
modelElement - model element to display

buildPopup

public boolean buildPopup(javax.swing.JPopupMenu popup,
                          javax.swing.tree.TreePath path)


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook