|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractListModel | +--org.argouml.uml.ui.UMLModelElementListModel | +--org.argouml.uml.ui.behavior.use_cases.UMLIncludeListModel
A list model for the include relationship on use case property panels.
Supports the full menu (Open, Add, Delete, Move Up, Move Down). Provides its own formatElement routine, to use the name of the base use case (where the container is a use case) or the extension use case (where the container is an extension point, rather than name of the extend relationship itself.
Note. There is a bug in NSUML, where the "include" and "include2" associations of a use case are back to front, i.e "include" is used as the opposite end of "addition" to point to an including use case, rather than an included use case. Fixed within the include relationship, rather than the use case, by reversing the use of access functions for the "base" and "addition" associations in the code.
Field Summary | |
protected static Category |
cat
Deprecated. |
Fields inherited from class org.argouml.uml.ui.UMLModelElementListModel |
_upper, NO_LIMIT |
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Constructor Summary | |
UMLIncludeListModel(UMLUserInterfaceContainer container,
java.lang.String property,
boolean showNone)
Deprecated. Create a new list model. |
Method Summary | |
void |
add(int index)
Deprecated. Implement the "add" function of the pop up menu. |
boolean |
buildPopup(javax.swing.JPopupMenu popup,
int index)
Deprecated. This method builds a context (pop-up) menu for the list. |
void |
delete(int index)
Deprecated. Implement the "delete" function of the pop up menu. |
java.lang.Object |
formatElement(MModelElement element)
Deprecated. Format a given model element. |
protected MModelElement |
getModelElementAt(int index)
Deprecated. Get the element at a given offset in the model This method must be provided to override the abstract method in the parent. |
void |
moveDown(int index)
Deprecated. The action that occurs with the "MoveDown" pop up. |
void |
moveUp(int index)
Deprecated. Implement the action that occurs with the "MoveUp" pop up. |
protected int |
recalcModelElementSize()
Deprecated. Compute the size of the list model. |
Methods inherited from class org.argouml.uml.ui.UMLModelElementListModel |
addAtUtil, elementAtUtil, getContainer, getContextNotation, getElementAt, getModelElementSize, getProperty, getSize, getTarget, getUpperBound, listRoleItemSet, moveDownUtil, moveUpUtil, navigateTo, open, propertySet, recovered, removed, resetSize, roleAdded, roleRemoved, setUpperBound, targetChanged, targetReasserted |
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static Category cat
Constructor Detail |
public UMLIncludeListModel(UMLUserInterfaceContainer container, java.lang.String property, boolean showNone)
Create a new list model.
Implementation is just an invocation of the parent constructor.
container
- The container for this list - the use case property
panel.property
- The name associated with the NSUML MElementEvent
that we are tracking or
null
if we track them all. We
probably want to just track the "include" event.showNone
- True if an empty list is represented by the keyword
"none"Method Detail |
protected int recalcModelElementSize()
Compute the size of the list model. This method must be provided to override the abstract method in the parent.
recalcModelElementSize
in class UMLModelElementListModel
protected MModelElement getModelElementAt(int index)
Get the element at a given offset in the model This method must be provided to override the abstract method in the parent.
The implementation makes use of the UMLModelElementListModel.elementAtUtil(java.util.Collection, int, java.lang.Class)
method,
which takes care of all unusual cases.
getModelElementAt
in class UMLModelElementListModel
index
- index of model element (zero based).
null
.public java.lang.Object formatElement(MModelElement element)
Format a given model element.
If there is no addition use case, use the default text
("(anon)"). Otherwise use the parent formatElement on the use case
attached as addition to the extend relationship , which will
ultimately invoke the format element method of PropPanel
.
In this current implementation, more rigorously checks it is formatting an extend relationship.
Note. There is a bug in NSUML, where the "include" and "include2" associations of a use case are back to front, i.e "include" is used as the opposite end of "addition" to point to an including use case, rather than an included use case. Fixed within the include relationship, rather than the use case, by reversing the meaning of the "base" and "association" associations in the code.
formatElement
in class UMLModelElementListModel
element
- the model element to format
public void add(int index)
Implement the "add" function of the pop up menu.
Pops up the UMLAddDialog. The user can include existing usecases to this model's target.
Note. There is a bug in NSUML, where the "include" and "include2" associations of a use case are back to front, i.e "include" is used as the opposite end of "addition" to point to an including use case, rather than an included use case. Fixed within the include relationship, rather than the use case, by reversing the use of access functions for the "base" and "addition" associations in the code.
index
- Offset in the list of the element at which the pop-up was
invoked.public void delete(int index)
Implement the "delete" function of the pop up menu. Delete the element at the given index.
Find the use cases at each end (note that NSUML uses the name "include2" for the use case doing the included, since it is unnamed in the standard). Delete their references to this include relationship. Also remove from the namespace.
Note. We don't actually need to check the target PropPanel is a use case—given an include relationship we can delete it.
Note. There is a bug in NSUML, where the "include" and "include2" associations of a use case are back to front, i.e "include" is used as the opposite end of "addition" to point to an including use case, rather than an included use case. Fixed within the include relationship, rather than the use case, by reversing the use of access functions for the "base" and "addition" associations in the code.
delete
in class UMLModelElementListModel
index
- Offset in the list of the element at which the pop-up was
invoked and which is to be deleted.public void moveUp(int index)
Implement the action that occurs with the "MoveUp" pop up.
Move the include relationship at the given index in the list up one
(unless it is already at the top). Since we use UMLModelElementListModel.moveUpUtil(java.util.Collection, int)
there is no need to test for unusual cases.
Note. There is a bug in NSUML, where the "include" and "include2" associations of a use case are back to front, i.e "include" is used as the opposite end of "addition" to point to an including use case, rather than an included use case. Fixed within the include relationship, rather than the use case, by reversing the use of access functions for the "base" and "addition" associations in the code.
index
- the index in the list of the include relationship to move
up.public void moveDown(int index)
The action that occurs with the "MoveDown" pop up.
Move the include relationship at the given index in the list down one
(unless it is already at the bottom). Since we use UMLModelElementListModel.moveUpUtil(java.util.Collection, int)
there is no need to test for unusual cases.
Note. There is a bug in NSUML, where the "include" and "include2" associations of a use case are back to front, i.e "include" is used as the opposite end of "addition" to point to an including use case, rather than an included use case. Fixed within the include relationship, rather than the use case, by reversing the use of access functions for the "base" and "addition" associations in the code.
index
- the index in the list of the include relationship to move
down.public boolean buildPopup(javax.swing.JPopupMenu popup, int index)
UMLModelElementListModel
buildPopup
in class UMLModelElementListModel
popup
- popup menuindex
- index of selected list item
UMLModelElementListModel.buildPopup(JPopupMenu, int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2003 (20030919) | ArgoUML Project Home | ArgoUML Cookbook |