org.argouml.uml.ui
Class UMLAttributesListModel

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byorg.argouml.uml.ui.UMLModelElementListModel
          extended byorg.argouml.uml.ui.UMLModelElementCachedListModel
              extended byorg.argouml.uml.ui.UMLAttributesListModel
All Implemented Interfaces:
java.util.EventListener, javax.swing.ListModel, ru.novosoft.uml.MElementListener, NotationContext, java.io.Serializable, UMLUserInterfaceComponent

Deprecated. as of ArgoUml 0.13.5 (10-may-2003), replaced by UMLClassAttributeListModel, this class is part of the 'old'(pre 0.13.*) implementation of proppanels that used reflection a lot.

public class UMLAttributesListModel
extends UMLModelElementCachedListModel

This class implements a list model for the attributes of a classifier. Used with a UMLList to display a list of attributes. Since attributes may be mixed with other model elements in the features of a classifier, this class implements a cache of attributes that are keep synchronized with the features of the current classifier.

See Also:
UMLModelElementListModel, UMLList, Serialized Form

Field Summary
private  java.util.List _attributes
          Deprecated.  
private static java.lang.String _nullLabel
          Deprecated.  
 
Fields inherited from class org.argouml.uml.ui.UMLModelElementListModel
_upper, NO_LIMIT
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
UMLAttributesListModel(UMLUserInterfaceContainer container, java.lang.String property, boolean showNone)
          Deprecated. Creates a new attribute list model
 
Method Summary
 void add(int index)
          Deprecated. Adds a new attribute, updating both the cache and underlying collection and navigating to new attribute.
 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. Deletes a specific attribute from both the cache and underlying collection.
protected  java.util.List getCache()
          Deprecated. returns the cache of model elements, rebuilding the cache if invalidated.
 java.util.Collection getRawCollection()
          Deprecated. returns the raw underlying collection from the current target of the container.
 boolean isProperClass(java.lang.Object obj)
          Deprecated. Called to determine if a particular feauture of the underlying collection should be in the cached list of model elements.
 void moveDown(int index)
          Deprecated. Moves an attribute down in the underlying collection.
 void moveUp(int index)
          Deprecated. Moves attribute up in the underlying collection.
protected  void resetCache()
          Deprecated. Called to indicate that the cache of attributes may have become invalid.
 
Methods inherited from class org.argouml.uml.ui.UMLModelElementCachedListModel
addElement, buildCache, createCollection, getModelElementAt, listRoleItemSet, propertySet, recalcModelElementSize, recovered, removed, roleAdded, roleRemoved, swap, targetChanged
 
Methods inherited from class org.argouml.uml.ui.UMLModelElementListModel
addAtUtil, 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, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_nullLabel

private static final java.lang.String _nullLabel
Deprecated. 
See Also:
Constant Field Values

_attributes

private java.util.List _attributes
Deprecated. 
Constructor Detail

UMLAttributesListModel

public UMLAttributesListModel(UMLUserInterfaceContainer container,
                              java.lang.String property,
                              boolean showNone)
Deprecated. 
Creates a new attribute list model

Parameters:
container - the container (typically a PropPanelClass or PropPanelInterface) 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.
Method Detail

resetCache

protected void resetCache()
Deprecated. 
Called to indicate that the cache of attributes may have become invalid.

Specified by:
resetCache in class UMLModelElementCachedListModel

isProperClass

public boolean isProperClass(java.lang.Object obj)
Deprecated. 
Called to determine if a particular feauture of the underlying collection should be in the cached list of model elements.

Specified by:
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()
Deprecated. 
returns the raw underlying collection from the current target of the container.

Specified by:
getRawCollection in class UMLModelElementCachedListModel
Returns:
underlying collection.

getCache

protected java.util.List getCache()
Deprecated. 
returns the cache of model elements, rebuilding the cache if invalidated.

Specified by:
getCache in class UMLModelElementCachedListModel
Returns:
cache of model elements

add

public void add(int index)
Deprecated. 
Adds a new attribute, updating both the cache and underlying collection and navigating to new attribute. Called by "Add" popup menu item.

Parameters:
index - position of new attribute (zero-based) but only refers to the index position in the particular list box, not the collection.

delete

public void delete(int index)
Deprecated. 
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)
Deprecated. 
Moves attribute up in the underlying collection.

Parameters:
index - element to move up

moveDown

public void moveDown(int index)
Deprecated. 
Moves an attribute down in the underlying collection.

Parameters:
index - element to move down.

buildPopup

public boolean buildPopup(javax.swing.JPopupMenu popup,
                          int index)
Deprecated. 
This method builds a context (pop-up) menu for the list.

Overrides:
buildPopup in class UMLModelElementListModel
Parameters:
popup - popup menu
index - index of selected list item
Returns:
"true" if popup menu should be displayed


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