org.argouml.uml.ui
Class UMLModelElementCachedListModel
java.lang.Object
|
+--javax.swing.AbstractListModel
|
+--org.argouml.uml.ui.UMLModelElementListModel
|
+--org.argouml.uml.ui.UMLModelElementCachedListModel
- All Implemented Interfaces:
- java.util.EventListener, javax.swing.ListModel, ru.novosoft.uml.MElementListener, NotationContext, java.io.Serializable, UMLUserInterfaceComponent
- Direct Known Subclasses:
- UMLAttributesListModel, UMLClassifierListModel, UMLOperationsListModel, UMLOwnedElementListModel
- public abstract class UMLModelElementCachedListModel
- extends UMLModelElementListModel
- See Also:
- Serialized Form
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Method Summary |
protected java.util.List |
addElement(java.util.Collection source,
int index,
ru.novosoft.uml.foundation.core.MModelElement newElement,
java.lang.Object element)
addElement method uses ListIterator and because we pass in the Object
element (name of the element after which we want to insert
the newElement) we can iterate down the list until we find the correct
insertion point. |
protected java.util.List |
buildCache()
|
protected abstract java.util.List |
getCache()
|
protected ru.novosoft.uml.foundation.core.MModelElement |
getModelElementAt(int index)
This method returns the model element that corresponds to
to the specific index. |
abstract boolean |
isProperClass(java.lang.Object obj)
|
void |
listRoleItemSet(ru.novosoft.uml.MElementEvent p1)
|
void |
propertySet(ru.novosoft.uml.MElementEvent event)
|
protected int |
recalcModelElementSize()
This method is called from getModelElementSize
when the list size has been marked as invalid. |
void |
recovered(ru.novosoft.uml.MElementEvent p1)
|
void |
removed(ru.novosoft.uml.MElementEvent event)
|
protected abstract void |
resetCache()
|
void |
roleAdded(ru.novosoft.uml.MElementEvent event)
|
void |
roleRemoved(ru.novosoft.uml.MElementEvent event)
|
protected java.util.List |
swap(java.util.Collection source,
int lowIndex,
java.lang.Object first,
java.lang.Object second)
Swap two items in a Collection. |
void |
targetChanged()
This method is called when the target of a UMLUserInterfaceContainer
has been changed. |
Methods inherited from class org.argouml.uml.ui.UMLModelElementListModel |
addAtUtil, buildPopup, delete, 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 |
UMLModelElementCachedListModel
public UMLModelElementCachedListModel(UMLUserInterfaceContainer container,
java.lang.String property,
boolean showNone)
resetCache
protected abstract void resetCache()
getCache
protected abstract java.util.List getCache()
isProperClass
public abstract boolean isProperClass(java.lang.Object obj)
recalcModelElementSize
protected int recalcModelElementSize()
- Description copied from class:
UMLModelElementListModel
- This method is called from getModelElementSize
when the list size has been marked as invalid.
- Overrides:
recalcModelElementSize
in class UMLModelElementListModel
- Following copied from class:
org.argouml.uml.ui.UMLModelElementListModel
- Returns:
- number of "actual" list entries.
getModelElementAt
protected ru.novosoft.uml.foundation.core.MModelElement getModelElementAt(int index)
- Description copied from class:
UMLModelElementListModel
- This method returns the model element that corresponds to
to the specific index. Called from getElementAt which handles
entries for "none" and formatting of elements.
- Overrides:
getModelElementAt
in class UMLModelElementListModel
- Following copied from class:
org.argouml.uml.ui.UMLModelElementListModel
- Parameters:
index
- index of model element (zero based).- Returns:
- corresponding model element
targetChanged
public void targetChanged()
- Description copied from interface:
UMLUserInterfaceComponent
- This method is called when the target of a UMLUserInterfaceContainer
has been changed.
- Overrides:
targetChanged
in class UMLModelElementListModel
- Following copied from class:
org.argouml.uml.ui.UMLModelElementListModel
- See Also:
UMLUserInterfaceComponent.targetChanged()
roleRemoved
public void roleRemoved(ru.novosoft.uml.MElementEvent event)
- Overrides:
roleRemoved
in class UMLModelElementListModel
roleAdded
public void roleAdded(ru.novosoft.uml.MElementEvent event)
- Overrides:
roleAdded
in class UMLModelElementListModel
- Following copied from class:
org.argouml.uml.ui.UMLModelElementListModel
- See Also:
MElementListener.roleAdded(MElementEvent)
recovered
public void recovered(ru.novosoft.uml.MElementEvent p1)
- Overrides:
recovered
in class UMLModelElementListModel
listRoleItemSet
public void listRoleItemSet(ru.novosoft.uml.MElementEvent p1)
- Overrides:
listRoleItemSet
in class UMLModelElementListModel
removed
public void removed(ru.novosoft.uml.MElementEvent event)
- Overrides:
removed
in class UMLModelElementListModel
propertySet
public void propertySet(ru.novosoft.uml.MElementEvent event)
- Overrides:
propertySet
in class UMLModelElementListModel
swap
protected java.util.List swap(java.util.Collection source,
int lowIndex,
java.lang.Object first,
java.lang.Object second)
- Swap two items in a Collection. The Collection contains the attributes list
and operations list together, however these items need to be swapped
independantly of each other so we must iterate through the list to find
a "value match". The parameter "lowIndex" is no longer needed, however I
left it in for compatability. The same operation is performed twice,
once for the source Collection, and again for the cache list.
addElement
protected java.util.List addElement(java.util.Collection source,
int index,
ru.novosoft.uml.foundation.core.MModelElement newElement,
java.lang.Object element)
- addElement method uses ListIterator and because we pass in the Object
element (name of the element after which we want to insert
the newElement) we can iterate down the list until we find the correct
insertion point. This iteration is necessary because elements of different
types are kept in the same collection. If element is null, the newElement
is put at the beginning of the list.
Modified: July 18, 2001 - psager
Modified: Dec 06, 2001 - thn
- Parameters:
source
- underlying collection of attributes and operations.index
- location of the element within the list box.newElement
- element to be added.element
- element at position before the add point (or null to add as first).- Returns:
- dest new collection as a ArrayList().
buildCache
protected java.util.List buildCache()