org.argouml.uml.ui.behavior.collaborations
Class UMLMessageActivatorComboBoxModel

java.lang.Object
  |
  +--javax.swing.AbstractListModel
        |
        +--org.argouml.uml.ui.UMLComboBoxModel2
              |
              +--org.argouml.uml.ui.behavior.collaborations.UMLMessageActivatorComboBoxModel
All Implemented Interfaces:
javax.swing.ComboBoxModel, java.util.EventListener, javax.swing.ListModel, java.io.Serializable, TargetListener

public class UMLMessageActivatorComboBoxModel
extends UMLComboBoxModel2

The model behind the UMLMessageActivatorComboBox. I don't use the UMLComboBoxModel since this mixes the GUI and the model too much and is much more maintainance intensive then this implementation.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.argouml.uml.ui.UMLComboBoxModel2
_fireListEvents, _propertySetName, _target
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
UMLMessageActivatorComboBoxModel()
          Constructor for UMLMessageActivatorComboBoxModel.
 
Method Summary
protected  void buildModelList()
          Builds the list of elements and sets the selectedIndex to the currently selected item if there is one.
protected  java.lang.Object getSelectedModelElement()
          Gets the modelelement that is selected in the NSUML model.
protected  boolean isValidElement(java.lang.Object m)
          Returns true if the given element is valid, i.e.
protected  void setTarget(java.lang.Object target)
          Sets the target.
 
Methods inherited from class org.argouml.uml.ui.UMLComboBoxModel2
addAll, addElement, contains, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getChangedElement, getElementAt, getIndexOf, getSelectedItem, getSize, getTarget, isValidEvent, listRoleItemSet, propertySet, recovered, removeAll, removeAllElements, removed, removeElement, roleAdded, roleRemoved, setElements, setSelectedItem, 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

UMLMessageActivatorComboBoxModel

public UMLMessageActivatorComboBoxModel()
Constructor for UMLMessageActivatorComboBoxModel.

Method Detail

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()

isValidElement

protected boolean isValidElement(java.lang.Object m)
Description copied from class: UMLComboBoxModel2
Returns true if the given element is valid, i.e. it may be added to the list of elements.

Specified by:
isValidElement in class UMLComboBoxModel2
Parameters:
m -
See Also:
UMLComboBoxModel2.isValidElement(Object)

getSelectedModelElement

protected java.lang.Object getSelectedModelElement()
Description copied from class: UMLComboBoxModel2
Gets the modelelement that is selected in the NSUML 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()

setTarget

protected void setTarget(java.lang.Object target)
Description copied from class: UMLComboBoxModel2
Sets the target. If the old target is instanceof MBase, it also removes the model from the element listener list of the target. If the new target is instanceof MBase, the model is added as element listener to the new target.

Overrides:
setTarget in class UMLComboBoxModel2
Parameters:
target -
See Also:
UMLComboBoxModel2.setTarget(java.lang.Object)


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