org.argouml.uml.ui
Class TabConstraints.ConstraintModel

java.lang.Object
  extended byorg.argouml.uml.ui.TabConstraints.ConstraintModel
All Implemented Interfaces:
tudresden.ocl.gui.OCLEditorModel
Enclosing class:
TabConstraints

private static class TabConstraints.ConstraintModel
extends Object
implements tudresden.ocl.gui.OCLEditorModel

Adapter to provide information and a manipulation interface for a target element's set of constraints to the constraint editor.


Nested Class Summary
private  class TabConstraints.ConstraintModel.CR
           
 
Field Summary
private  ArrayList theMAlConstraints
          A list of all the constraints in m_nmeiTarget.
private  EventListenerList theMEllListeners
          List of listeners.
private  Object theMMmeiTarget
          The target element being edited.
 
Constructor Summary
TabConstraints.ConstraintModel(Object mmeiTarget)
          Construct a new ConstraintModel.
 
Method Summary
 void addConstraint()
          Add a fresh constraint to the model.
 void addConstraintChangeListener(tudresden.ocl.gui.events.ConstraintChangeListener ccl)
          Add a listener to be informed of changes in the model.
protected  void fireConstraintAdded()
           
protected  void fireConstraintDataChanged(int nIdx, Object mcOld, Object mcNew)
           
protected  void fireConstraintNameChanged(int nIdx, Object mcOld, Object mcNew)
           
protected  void fireConstraintRemoved(Object mc, int nIdx)
           
 tudresden.ocl.gui.ConstraintRepresentation getConstraintAt(int nIdx)
          Return the constraint with the specified index.
 int getConstraintCount()
          Return the number of constraints in this model.
 void removeConstraintAt(int nIdx)
          Remove the specified constraint from the model.
 void removeConstraintChangeListener(tudresden.ocl.gui.events.ConstraintChangeListener ccl)
          Remove a listener to be informed of changes in the model.
private  TabConstraints.ConstraintModel.CR representationFor(int nIdx)
          Create a representation adapter for the given constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theMMmeiTarget

private Object theMMmeiTarget
The target element being edited.


theMAlConstraints

private ArrayList theMAlConstraints
A list of all the constraints in m_nmeiTarget. This is necessary to induce a consistent order on the constraints.


theMEllListeners

private EventListenerList theMEllListeners
List of listeners.

Constructor Detail

TabConstraints.ConstraintModel

public TabConstraints.ConstraintModel(Object mmeiTarget)
Construct a new ConstraintModel.

Method Detail

getConstraintCount

public int getConstraintCount()
Return the number of constraints in this model.

Specified by:
getConstraintCount in interface tudresden.ocl.gui.OCLEditorModel

getConstraintAt

public tudresden.ocl.gui.ConstraintRepresentation getConstraintAt(int nIdx)
Return the constraint with the specified index.

Specified by:
getConstraintAt in interface tudresden.ocl.gui.OCLEditorModel
Parameters:
nIdx - the index of the constraint to be returned. 0 <= nIdx < getConstraintCount()

removeConstraintAt

public void removeConstraintAt(int nIdx)
Remove the specified constraint from the model.

Specified by:
removeConstraintAt in interface tudresden.ocl.gui.OCLEditorModel
Parameters:
nIdx - the index of the constraint to be removed. 0 <= nIdx < getConstraintCount()

addConstraint

public void addConstraint()
Add a fresh constraint to the model.

There are 2 restrictions on what can be parsed, given the current OCL grammar:

  1. Class names must have a capital first letter.
  2. Feature name must have a lower case first letter.

Specified by:
addConstraint in interface tudresden.ocl.gui.OCLEditorModel

representationFor

private TabConstraints.ConstraintModel.CR representationFor(int nIdx)
Create a representation adapter for the given constraint.


addConstraintChangeListener

public void addConstraintChangeListener(tudresden.ocl.gui.events.ConstraintChangeListener ccl)
Add a listener to be informed of changes in the model.

Specified by:
addConstraintChangeListener in interface tudresden.ocl.gui.OCLEditorModel
Parameters:
ccl - the new listener

removeConstraintChangeListener

public void removeConstraintChangeListener(tudresden.ocl.gui.events.ConstraintChangeListener ccl)
Remove a listener to be informed of changes in the model.

Specified by:
removeConstraintChangeListener in interface tudresden.ocl.gui.OCLEditorModel
Parameters:
ccl - the listener to be removed

fireConstraintRemoved

protected void fireConstraintRemoved(Object mc,
                                     int nIdx)

fireConstraintAdded

protected void fireConstraintAdded()

fireConstraintDataChanged

protected void fireConstraintDataChanged(int nIdx,
                                         Object mcOld,
                                         Object mcNew)

fireConstraintNameChanged

protected void fireConstraintNameChanged(int nIdx,
                                         Object mcOld,
                                         Object mcNew)


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