org.argouml.uml.ui
Class UMLOwnedElementListModel
java.lang.Object
|
+--javax.swing.AbstractListModel
|
+--org.argouml.uml.ui.UMLModelElementListModel
|
+--org.argouml.uml.ui.UMLModelElementCachedListModel
|
+--org.argouml.uml.ui.UMLOwnedElementListModel
- All Implemented Interfaces:
- java.util.EventListener, javax.swing.ListModel, ru.novosoft.uml.MElementListener, NotationContext, java.io.Serializable, UMLUserInterfaceComponent
- Direct Known Subclasses:
- UMLAssociationsListModel, UMLClassifiersListModel, UMLGeneralizationsListModel, UMLPackagesListModel
- public abstract class UMLOwnedElementListModel
- extends UMLModelElementCachedListModel
This class implements is a abstract base for UMLPackagesListModel,
UMLClassifiersListModel and other classes that display a subset
of the owned elements of a namespace.
- See Also:
UMLModelElementListModel
,
UMLList
, Serialized Form
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Method Summary |
void |
add(int index)
Adds a new element, updating both the cache and underlying collection
and navigating to new attribute. |
void |
addElement(ru.novosoft.uml.foundation.core.MModelElement element,
int index)
|
void |
delete(int index)
Deletes a specific attribute from both the cache and underlying
collection. |
protected java.util.List |
getCache()
returns the cache of model elements, rebuilding the cache if invalidated. |
java.util.Collection |
getRawCollection()
returns the raw underlying collection from the current target
of the container. |
boolean |
isProperClass(java.lang.Object obj)
Called to determine if a particular feauture of the underlying collection
should be in the cached list of model elements. |
void |
moveDown(int index)
Moves an attribute down in the underlying collection. |
void |
moveUp(int index)
Moves attribute up in the underlying collection. |
protected void |
resetCache()
Called to indicate that the cache of attributes may have become invalid. |
Methods inherited from class org.argouml.uml.ui.UMLModelElementCachedListModel |
addElement, buildCache, getModelElementAt, listRoleItemSet, propertySet, recalcModelElementSize, recovered, removed, roleAdded, roleRemoved, swap, targetChanged |
Methods inherited from class org.argouml.uml.ui.UMLModelElementListModel |
addAtUtil, buildPopup, elementAtUtil, formatElement, getContainer, getContextNotation, getElementAt, getModelElementSize, getProperty, getSize, getTarget, getUpperBound, moveDownUtil, moveUpUtil, navigateTo, open, resetSize, setUpperBound, targetReasserted |
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UMLOwnedElementListModel
public UMLOwnedElementListModel(UMLUserInterfaceContainer container,
java.lang.String property,
boolean showNone)
- Creates a new packages list model
- Parameters:
container
- the container (typically a PropPanelPackage)
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.
resetCache
protected void resetCache()
- Called to indicate that the cache of attributes may have become invalid.
- Overrides:
resetCache
in class UMLModelElementCachedListModel
isProperClass
public boolean isProperClass(java.lang.Object obj)
- Called to determine if a particular feauture of the underlying collection
should be in the cached list of model elements.
- Overrides:
isProperClass
in class UMLModelElementCachedListModel
- Parameters:
obj
- object to be considered.- Returns:
- true if object is appropriate for this list.
getRawCollection
public java.util.Collection getRawCollection()
- returns the raw underlying collection from the current target
of the container.
- Returns:
- underlying collection.
getCache
protected java.util.List getCache()
- returns the cache of model elements, rebuilding the cache if invalidated.
- Overrides:
getCache
in class UMLModelElementCachedListModel
- Returns:
- cache of model elements
add
public void add(int index)
- Adds a new element, updating both the cache and underlying collection
and navigating to new attribute. Called by "Add" popup menu item.
Modified: July 20, 2001 - psager
- Parameters:
index
- position of new attribute (zero-based)
delete
public void delete(int index)
- Deletes a specific attribute from both the cache and underlying
collection.
- Overrides:
delete
in class UMLModelElementListModel
- Parameters:
index
- position of attribute to be deleted.
moveUp
public void moveUp(int index)
- Moves attribute up in the underlying collection.
- Parameters:
index
- element to move up
moveDown
public void moveDown(int index)
- Moves an attribute down in the underlying collection.
- Parameters:
index
- element to move down.
addElement
public void addElement(ru.novosoft.uml.foundation.core.MModelElement element,
int index)