org.argouml.uml.ui
Class UMLModelElementListModel

java.lang.Object
  |
  +--javax.swing.AbstractListModel
        |
        +--org.argouml.uml.ui.UMLModelElementListModel
All Implemented Interfaces:
javax.swing.ListModel, NotationContext, java.io.Serializable, UMLUserInterfaceComponent
Direct Known Subclasses:
UMLBinaryRelationListModel, UMLIncludeListModel, UMLModelElementCachedListModel, UMLReflectionListModel, UMLStimulusListModel

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

public abstract class UMLModelElementListModel
extends javax.swing.AbstractListModel
implements UMLUserInterfaceComponent, NotationContext

This class is an abstract superclass for classes that provide a list of UML model elements.

See Also:
Serialized Form

Field Summary
private  UMLUserInterfaceContainer _container
          Deprecated. The container that provides the "target" model element.
private  int _currentModelElementSize
          Deprecated. The number of actual entries in the list.
private  java.lang.String _none
          Deprecated. The string used to indicate no actual entries in the list.
private  java.lang.String _property
          Deprecated. A string indicating an NSUML event name that indicates that list may need to be updated.
private  boolean _recalcSize
          Deprecated. Set to true when an event suggests that the size needs to be recalculated.
private  boolean _showNone
          Deprecated. If "true" then a list entry (typically labelled "none") will be displayed when there are no actual entries in the list.
protected  int _upper
          Deprecated. upper bound of length of list.
 int NO_LIMIT
          Deprecated.  
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
UMLModelElementListModel(UMLUserInterfaceContainer container, java.lang.String property, boolean showNone)
          Deprecated. Creates a new list model.
 
Method Summary
static java.util.List addAtUtil(java.util.Collection oldCollection, java.lang.Object newItem, int index)
          Deprecated. This utility function may be called in the implemention of an Add action.
 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. Standard delete method.
static MModelElement elementAtUtil(java.util.Collection collection, int index, java.lang.Class requiredClass)
          Deprecated. This utility function may be called in the implemention of getElementAt.
 java.lang.Object formatElement(java.lang.Object element)
          Deprecated. This method returns a rendering (typically a String) of the model element for the list.
protected  UMLUserInterfaceContainer getContainer()
          Deprecated. This method returns the container passed as an argument to the constructor
 NotationName getContextNotation()
          Deprecated. Gives a notation name, so subclasses can use the Notation package.
 java.lang.Object getElementAt(int index)
          Deprecated. This method returns an object (typically a String) to represent a particular element in this list (including any element for "none").
protected abstract  MModelElement getModelElementAt(int index)
          Deprecated. This method returns the model element that corresponds to to the specific index.
protected  int getModelElementSize()
          Deprecated. Determines the number of "actual" entries in the list.
 java.lang.String getProperty()
          Deprecated. Returns NSUML event name that is monitored, may be null.
 int getSize()
          Deprecated. This method returns the size of the list (including any element for none).
protected  java.lang.Object getTarget()
          Deprecated. This method returns the current "target" of the container.
 int getUpperBound()
          Deprecated.  
 void listRoleItemSet(MElementEvent p1)
          Deprecated.  
static java.util.List moveDownUtil(java.util.Collection oldCollection, int index)
          Deprecated. This utility function may be called in the implemention of an MoveDown action.
static java.util.Collection moveUpUtil(java.util.Collection oldCollection, int index)
          Deprecated. This utility function may be called in the implemention of an MoveUp action.
 void navigateTo(java.lang.Object modelElement)
          Deprecated. TODO: by whom? When? Why? What is this replaced by?
 void open(int index)
          Deprecated. This method is called in response to selecting "Open" from a context (pop-up) menu on this list.
 void propertySet(MElementEvent p1)
          Deprecated.  
protected abstract  int recalcModelElementSize()
          Deprecated. This method is called from getModelElementSize when the list size has been marked as invalid.
 void recovered(MElementEvent p1)
          Deprecated.  
 void removed(MElementEvent p1)
          Deprecated.  
 void resetSize()
          Deprecated. Called when an external event may have changed the size of the list to force recalculation of list size.
 void roleAdded(MElementEvent event)
          Deprecated.  
 void roleRemoved(MElementEvent event)
          Deprecated.  
 void setUpperBound(int newBound)
          Deprecated.  
 void targetChanged()
          Deprecated. This method is called when the target of a UMLUserInterfaceContainer has been changed.
 void targetReasserted()
          Deprecated. This method is called when the navigation history has been changed (and navigation buttons may need to be updated).
 
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

_container

private UMLUserInterfaceContainer _container
Deprecated. 
The container that provides the "target" model element.


_showNone

private boolean _showNone
Deprecated. 
If "true" then a list entry (typically labelled "none") will be displayed when there are no actual entries in the list.


_currentModelElementSize

private int _currentModelElementSize
Deprecated. 
The number of actual entries in the list.


_recalcSize

private boolean _recalcSize
Deprecated. 
Set to true when an event suggests that the size needs to be recalculated.


_property

private java.lang.String _property
Deprecated. 
A string indicating an NSUML event name that indicates that list may need to be updated.


_none

private java.lang.String _none
Deprecated. 
The string used to indicate no actual entries in the list. Eventually, should be part of the profile or localization.


_upper

protected int _upper
Deprecated. 
upper bound of length of list.


NO_LIMIT

public final int NO_LIMIT
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

UMLModelElementListModel

public UMLModelElementListModel(UMLUserInterfaceContainer container,
                                java.lang.String property,
                                boolean showNone)
Deprecated. 
Creates a new 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

getUpperBound

public int getUpperBound()
Deprecated. 

setUpperBound

public void setUpperBound(int newBound)
Deprecated. 

resetSize

public void resetSize()
Deprecated. 
Called when an external event may have changed the size of the list to force recalculation of list size.


getProperty

public final java.lang.String getProperty()
Deprecated. 
Returns NSUML event name that is monitored, may be null.


getModelElementSize

protected final int getModelElementSize()
Deprecated. 
Determines the number of "actual" entries in the list. May be overriden in combination with getModelElementAt, but typically recalcModelElementSize is overriden.

Returns:
number of "actual" list entries.

recalcModelElementSize

protected abstract int recalcModelElementSize()
Deprecated. 
This method is called from getModelElementSize when the list size has been marked as invalid.

Returns:
number of "actual" list entries.

getModelElementAt

protected abstract MModelElement getModelElementAt(int index)
Deprecated. 
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.

Parameters:
index - index of model element (zero based).
Returns:
corresponding model element

getTarget

protected final java.lang.Object getTarget()
Deprecated. 
This method returns the current "target" of the container.


getContainer

protected final UMLUserInterfaceContainer getContainer()
Deprecated. 
This method returns the container passed as an argument to the constructor


getSize

public int getSize()
Deprecated. 
This method returns the size of the list (including any element for none).

Specified by:
getSize in interface javax.swing.ListModel
Returns:
size of list
See Also:
getModelElementSize()

getElementAt

public java.lang.Object getElementAt(int index)
Deprecated. 
This method returns an object (typically a String) to represent a particular element in this list (including any element for "none").

Specified by:
getElementAt in interface javax.swing.ListModel
Parameters:
index - index for element (zero-based)
Returns:
representation of element
See Also:
getModelElementAt(int), formatElement(java.lang.Object)

formatElement

public java.lang.Object formatElement(java.lang.Object element)
Deprecated. 
This method returns a rendering (typically a String) of the model element for the list. Default implementation defers to the current Profile of the container, but this method may be overriden.

Parameters:
element - model element
Returns:
rendering of the ModelElement

targetChanged

public void targetChanged()
Deprecated. 
Description copied from interface: UMLUserInterfaceComponent
This method is called when the target of a UMLUserInterfaceContainer has been changed.

Specified by:
targetChanged in interface UMLUserInterfaceComponent
See Also:
UMLUserInterfaceComponent.targetChanged()

targetReasserted

public void targetReasserted()
Deprecated. 
Description copied from interface: UMLUserInterfaceComponent
This method is called when the navigation history has been changed (and navigation buttons may need to be updated). targetChanged implies navigationHistoryChanged, so this method will not be called after a targetChange.

Specified by:
targetReasserted in interface UMLUserInterfaceComponent

roleAdded

public void roleAdded(MElementEvent event)
Deprecated. 
See Also:
ru.novosoft.uml.MElementListener#roleAdded(MElementEvent)

roleRemoved

public void roleRemoved(MElementEvent event)
Deprecated. 

recovered

public void recovered(MElementEvent p1)
Deprecated. 

listRoleItemSet

public void listRoleItemSet(MElementEvent p1)
Deprecated. 

removed

public void removed(MElementEvent p1)
Deprecated. 

propertySet

public void propertySet(MElementEvent p1)
Deprecated. 

navigateTo

public void navigateTo(java.lang.Object modelElement)
Deprecated. TODO: by whom? When? Why? What is this replaced by?

This method is called by context menu actions that desire to change to currently displayed object.

Parameters:
modelElement - model element to display

open

public void open(int index)
Deprecated. 
This method is called in response to selecting "Open" from a context (pop-up) menu on this list.

Parameters:
index - index of item to open (zero-based).

buildPopup

public boolean buildPopup(javax.swing.JPopupMenu popup,
                          int index)
Deprecated. 
This method builds a context (pop-up) menu for the list. This method may be overriden for lists that have additional menu items or when the default list of actions is inappropriate.

Parameters:
popup - popup menu
index - index of selected list item
Returns:
"true" if popup menu should be displayed

addAtUtil

public static java.util.List addAtUtil(java.util.Collection oldCollection,
                                       java.lang.Object newItem,
                                       int index)
Deprecated. 
This utility function may be called in the implemention of an Add action. It creates a new collection by adding an element at a specific offset in the sequence of an old collection.

Historically this took as argument and returned result of type Collection. However this is not specifically an ordered interface. The current version returns a result of type List, which is the ordered sub-interface of Collection. This will keep some NSUML routines (which have ordered arguments, and expect a List object) happy.

Note. There are two List types in Java (the other is part of awt). This is java.util.List.

For compatibility with existing code, the argument is left as type Collection, although it would be wise to always use List in new code.

Parameters:
oldCollection - old collection
newItem - element to add to collection
index - position of element in new collection
Returns:
new list

moveUpUtil

public static java.util.Collection moveUpUtil(java.util.Collection oldCollection,
                                              int index)
Deprecated. 
This utility function may be called in the implemention of an MoveUp action. It creates a new collection by swapping the element at index with the element at index-1.

Parameters:
oldCollection - old collection
index - index of element to move up.
Returns:
new collection

moveDownUtil

public static java.util.List moveDownUtil(java.util.Collection oldCollection,
                                          int index)
Deprecated. 
This utility function may be called in the implemention of an MoveDown action. It creates a new collection by swapping the element at index with the element at index+1.

Parameters:
oldCollection - old collection
index - index of element to move down.
Returns:
new collection

elementAtUtil

public static MModelElement elementAtUtil(java.util.Collection collection,
                                          int index,
                                          java.lang.Class requiredClass)
Deprecated. 
This utility function may be called in the implemention of getElementAt. It determines the element at a specific index by brute iteration through a collection if necessary.

Parameters:
collection - old collection
index - index of element to move down.
Returns:
new collection

getContextNotation

public NotationName getContextNotation()
Deprecated. 

Gives a notation name, so subclasses can use the Notation package.

This default implementation simply requests the default notation.

Specified by:
getContextNotation in interface NotationContext
Returns:
The notation to use. In this implementation always null, meaning use the default notation.

delete

public void delete(int index)
Deprecated. 
Standard delete method.

Parameters:
index -


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