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:
UMLActivatorListModel, UMLAssociationEndListModel, UMLBinaryRelationListModel, UMLClientDependencyListModel, 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
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.  
 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(MModelElement 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.List moveUpUtil(java.util.Collection oldCollection, int index)
          Deprecated. This utility function may be called in the implemention of an MoveUp action.
 void navigateTo(MModelElement modelElement)
          Deprecated.  
 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

_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(MModelElement)

formatElement

public java.lang.Object formatElement(MModelElement 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.

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(MModelElement modelElement)
Deprecated.  

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. 

moveUpUtil

public static java.util.List 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:
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-2003 (20030919)ArgoUML Project HomeArgoUML Cookbook