org.argouml.uml.ui.foundation.extension_mechanisms
Class UMLTagDefinitionTypeComboBoxModel

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byorg.argouml.uml.ui.UMLComboBoxModel2
          extended byorg.argouml.uml.ui.foundation.extension_mechanisms.UMLTagDefinitionTypeComboBoxModel
All Implemented Interfaces:
ComboBoxModel, EventListener, ListModel, PropertyChangeListener, Serializable, TargetListener

public class UMLTagDefinitionTypeComboBoxModel
extends UMLComboBoxModel2

The combobox model for the type belonging to some attribute.

Since:
Nov 2, 2002
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.argouml.uml.ui.UMLComboBoxModel2
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
UMLTagDefinitionTypeComboBoxModel()
          Constructor for UMLTagDefinitionTypeComboBoxModel.
 
Method Summary
private static void addAllUniqueModelElementsFrom(Set elements, Set paths, Collection source)
          Helper method for buildModelList.
protected  void buildModelList()
          Builds the list of elements and sets the selectedIndex to the currently selected item if there is one.
protected  Object getSelectedModelElement()
          Gets the modelelement that is selected in the UML model.
protected  boolean isValidElement(Object element)
          Returns true if the given element is valid.
 void propertyChange(PropertyChangeEvent evt)
          If the property that this comboboxmodel depicts is changed in the UML model, this method will make sure that it is changed in the comboboxmodel too.
 
Methods inherited from class org.argouml.uml.ui.UMLComboBoxModel2
addAll, addElement, contains, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getChangedElement, getElementAt, getIndexOf, getPropertySetName, getSelectedItem, getSize, getTarget, isClearable, isFireListEvents, isValidEvent, removeAll, removeAllElements, removeElement, setElements, setFireListEvents, setSelectedItem, setTarget, targetAdded, targetRemoved, targetSet
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Constructor Detail

UMLTagDefinitionTypeComboBoxModel

public UMLTagDefinitionTypeComboBoxModel()
Constructor for UMLTagDefinitionTypeComboBoxModel.

Method Detail

isValidElement

protected boolean isValidElement(Object element)
Description copied from class: UMLComboBoxModel2
Returns true if the given element is valid.

It is valid if it may be added to the list of elements.

Specified by:
isValidElement in class UMLComboBoxModel2
Parameters:
element - the given element
Returns:
true if the given element is valid
See Also:
UMLComboBoxModel2.isValidElement(Object)

addAllUniqueModelElementsFrom

private static void addAllUniqueModelElementsFrom(Set elements,
                                                  Set paths,
                                                  Collection source)
Helper method for buildModelList.

Adds those elements from source that do not have the same path as any path in paths to elements, and its path to paths. Thus elements will never contain two objects with the same path, unless they are added by other means.


buildModelList

protected void buildModelList()
Description copied from class: UMLComboBoxModel2
Builds the list of elements and sets the selectedIndex to the currently selected item if there is one. Called from targetChanged every time the target of the proppanel is changed.

Specified by:
buildModelList in class UMLComboBoxModel2
See Also:
UMLComboBoxModel2.buildModelList()

getSelectedModelElement

protected Object getSelectedModelElement()
Description copied from class: UMLComboBoxModel2
Gets the modelelement that is selected in the UML model. For example, say that this ComboBoxmodel contains all namespaces (as in UMLNamespaceComboBoxmodel) , this method should return the namespace that owns the target then.

Specified by:
getSelectedModelElement in class UMLComboBoxModel2
Returns:
Object
See Also:
UMLComboBoxModel2.getSelectedModelElement()

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Description copied from class: UMLComboBoxModel2
If the property that this comboboxmodel depicts is changed in the UML model, this method will make sure that it is changed in the comboboxmodel too. TODO: This function is not yet completely written!

Specified by:
propertyChange in interface PropertyChangeListener
Overrides:
propertyChange in class UMLComboBoxModel2
See Also:
UMLComboBoxModel2.propertyChange(java.beans.PropertyChangeEvent)


ArgoUML © 1996-2005ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook