|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractListModel
javax.swing.DefaultListModel
org.argouml.uml.ui.UMLModelElementListModel2
public abstract class UMLModelElementListModel2
The model for a list that contains ModelElements. The state of the Element is still kept in the model subsystem itself. This list is only to be used as the model for some GUI element like UMLLinkedList.
Field Summary |
---|
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
UMLModelElementListModel2()
Constructor to be used if the subclass does not depend on the MELementListener methods and setTarget method implemented in this class. |
|
UMLModelElementListModel2(java.lang.String name)
Constructor for UMLModelElementListModel2. |
|
UMLModelElementListModel2(java.lang.String name,
java.lang.Object theMetaType)
Constructor for UMLModelElementListModel2. |
|
UMLModelElementListModel2(java.lang.String name,
java.lang.Object theMetaType,
boolean reverseTheDropConnection)
Constructor for UMLModelElementListModel2. |
Method Summary | |
---|---|
protected void |
addAll(java.util.Collection col)
Utility method to add a collection of elements to the model |
void |
addElement(java.lang.Object obj)
|
protected void |
addOtherModelEventListeners(java.lang.Object newTarget)
This function allows subclasses to listen to more modelelements. |
protected abstract void |
buildModelList()
Builds the list of elements. |
boolean |
buildPopup(javax.swing.JPopupMenu popup,
int index)
Override this if you want a popup menu. |
boolean |
contains(java.lang.Object elem)
|
protected void |
fireContentsChanged(java.lang.Object source,
int index0,
int index1)
|
protected void |
fireIntervalAdded(java.lang.Object source,
int index0,
int index1)
|
protected void |
fireIntervalRemoved(java.lang.Object source,
int index0,
int index1)
|
protected java.lang.Object |
getChangedElement(java.beans.PropertyChangeEvent e)
Utility method to get the changed element from some event e |
java.lang.Object |
getMetaType()
Get the type of objects that this list model is designed to contain. |
java.lang.Object |
getTarget()
Utility method to get the target. |
protected boolean |
hasPopup()
|
boolean |
isReverseDropConnection()
|
protected abstract boolean |
isValidElement(java.lang.Object element)
Returns true if the given element is valid, i.e. |
protected boolean |
isValidEvent(java.beans.PropertyChangeEvent e)
Returns true if some event is valid. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
|
protected void |
removeOtherModelEventListeners(java.lang.Object oldTarget)
This function allows subclasses to listen to more modelelements. |
protected void |
setAllElements(java.util.Collection col)
Utility method to set the elements of this list to the contents of the given collection. |
protected void |
setBuildingModel(boolean building)
|
protected void |
setEventName(java.lang.String theEventName)
Sets the eventName. |
protected void |
setListTarget(java.lang.Object t)
|
void |
setTarget(java.lang.Object theNewTarget)
Sets the target. |
void |
targetAdded(TargetEvent e)
Fired when a target is added to the list of targets. |
void |
targetRemoved(TargetEvent e)
Fired when a target is removed from the list of targets |
void |
targetSet(TargetEvent e)
Fired when a total new set of targets is set |
Methods inherited from class javax.swing.DefaultListModel |
---|
add, capacity, clear, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getElementAt, getSize, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSize |
Methods inherited from class javax.swing.AbstractListModel |
---|
addListDataListener, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UMLModelElementListModel2()
public UMLModelElementListModel2(java.lang.String name)
name
- the name of the event to listen to, which triggers us
to update the list model from the UML datapublic UMLModelElementListModel2(java.lang.String name, java.lang.Object theMetaType)
name
- the name of the event to listen to, which triggers us
to update the list model from the UML datatheMetaType
- the type of model element that the list model
is designed to contain.public UMLModelElementListModel2(java.lang.String name, java.lang.Object theMetaType, boolean reverseTheDropConnection)
name
- the name of the event to listen to, which triggers us
to update the list model from the UML datatheMetaType
- the type of model element that the list model
is designed to contain.reverseTheDropConnection
- tells the JList to reverse the
connection made and drop during dnd.Method Detail |
---|
public java.lang.Object getMetaType()
public boolean isReverseDropConnection()
protected void setBuildingModel(boolean building)
building
- The buildingModel to set.protected void setListTarget(java.lang.Object t)
t
- the list target to setpublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
protected abstract void buildModelList()
protected void setAllElements(java.util.Collection col)
col
- the given collectionprotected void addAll(java.util.Collection col)
col
- the given collectionpublic java.lang.Object getTarget()
protected java.lang.Object getChangedElement(java.beans.PropertyChangeEvent e)
e
- the event
public boolean contains(java.lang.Object elem)
contains
in class javax.swing.DefaultListModel
public void setTarget(java.lang.Object theNewTarget)
This function is called when the user changes the target. Hence, this shall not result in any UML model changes. Hence, we block firing list events completely by setting buildingModel to true for the duration of this function.
This function looks a lot like the one in UMLComboBoxModel2.
theNewTarget
- the new targetprotected void removeOtherModelEventListeners(java.lang.Object oldTarget)
oldTarget
- the UML modelelementprotected void addOtherModelEventListeners(java.lang.Object newTarget)
newTarget
- the UML modelelementprotected abstract boolean isValidElement(java.lang.Object element)
element
- the element to be tested
protected boolean isValidEvent(java.beans.PropertyChangeEvent e)
e
- the event
public void addElement(java.lang.Object obj)
addElement
in class javax.swing.DefaultListModel
protected void setEventName(java.lang.String theEventName)
theEventName
- The eventName to setpublic void targetAdded(TargetEvent e)
TargetListener
targetAdded
in interface TargetListener
e
- The targetevent, name will be TARGET_ADDEDpublic void targetRemoved(TargetEvent e)
TargetListener
targetRemoved
in interface TargetListener
e
- The targetevent, name will be TARGET_REMOVEDpublic void targetSet(TargetEvent e)
TargetListener
targetSet
in interface TargetListener
e
- The targetevent, name will be TARGET_SETprotected void fireContentsChanged(java.lang.Object source, int index0, int index1)
fireContentsChanged
in class javax.swing.AbstractListModel
protected void fireIntervalAdded(java.lang.Object source, int index0, int index1)
fireIntervalAdded
in class javax.swing.AbstractListModel
protected void fireIntervalRemoved(java.lang.Object source, int index0, int index1)
fireIntervalRemoved
in class javax.swing.AbstractListModel
public boolean buildPopup(javax.swing.JPopupMenu popup, int index)
popup
- the popup menuindex
- the selected item in the list at the moment
the mouse was clicked
protected boolean hasPopup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2006 | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |