org.argouml.uml.ui.behavior.common_behavior
Class UMLLinkAssociationComboBoxModel
java.lang.Object
javax.swing.AbstractListModel
org.argouml.uml.ui.UMLComboBoxModel2
org.argouml.uml.ui.behavior.common_behavior.UMLLinkAssociationComboBoxModel
- All Implemented Interfaces:
- ComboBoxModel, EventListener, ListModel, PropertyChangeListener, Serializable, TargetListener
- class UMLLinkAssociationComboBoxModel
- extends UMLComboBoxModel2
The model for the combobox to show the Association of the Link.
|
Method Summary |
protected void |
buildModelList()
To simplify implementation, we list all associations
found with any of the Classifiers
represented by the linked Instances. |
protected Object |
getSelectedModelElement()
Gets the modelelement that is selected in the UML model. |
protected boolean |
isValidElement(Object o)
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UMLLinkAssociationComboBoxModel
public UMLLinkAssociationComboBoxModel()
- Constructor for UMLModelElementNamespaceComboBoxModel.
isValidElement
protected boolean isValidElement(Object o)
- 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:
o - the given element
- Returns:
- true if the given element is valid
- See Also:
UMLComboBoxModel2.isValidElement(Object)
buildModelList
protected void buildModelList()
- To simplify implementation, we list all associations
found with any of the Classifiers
represented by the linked Instances.
TODO: Make a foolproof algorithm that only allows selecting associations
that create a correct model. Also take into account n-ary associations
and associationclasses. This algo best goes in the model subsystem, e.g.
in a method getAllPossibleAssociationsForALink().
- 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:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)