Dresden OCL Toolkit

tudresden.ocl.sql
Class SimpleOCLEditorModel

java.lang.Object
  extended bytudresden.ocl.sql.SimpleOCLEditorModel
All Implemented Interfaces:
OCLEditorModel, Serializable

public class SimpleOCLEditorModel
extends Object
implements OCLEditorModel, Serializable

A simple implementation of the OCLEditorModel interface to serve the requirements of the OCL2SQL tool.

Author:
Sten Loecher
See Also:
Serialized Form

Nested Class Summary
 class SimpleOCLEditorModel.SimpleConstraintRepresentation
          A simple implementation of the ConstraintRepresentation interface.
 
Field Summary
(package private) static long serialVersionUID
          To control serialization.
private  List theConstraints
          List of all constraints.
private  EventListenerList theEventListeners
          List of listeners.
private  ModelFacade theModelFacade
          A ModelFacade for typechecking.
 
Constructor Summary
SimpleOCLEditorModel()
          Creates new SimpleOCLEditorModel.
 
Method Summary
 void addConstraint()
          Add a fresh constraint to the model.
 void addConstraintChangeListener(ConstraintChangeListener ccl)
          Add a listener to be informed of changes in the model.
protected  void fireConstraintAdded()
           
protected  void fireConstraintDataChanged(int nIdx, ConstraintRepresentation crOld, ConstraintRepresentation crNew)
           
protected  void fireConstraintNameChanged(int nIdx, ConstraintRepresentation crOld, ConstraintRepresentation crNew)
           
protected  void fireConstraintRemoved(ConstraintRepresentation mc, int nIdx)
           
 ConstraintRepresentation getConstraintAt(int nIdx)
          Return the constraint with the specified index.
 int getConstraintCount()
          Return the number of constraints in this model.
private  void readObject(ObjectInputStream in)
          Implementation of the Serialization interface to avoid the serialization of the event listeners.
 void removeConstraintAt(int nIdx)
          Remove the specified constraint from the model.
 void removeConstraintChangeListener(ConstraintChangeListener ccl)
          Remove a listener to be informed of changes in the model.
 void setModelFacade(ModelFacade mf)
          A ModelFacade for the OCL compiler.
private  void writeObject(ObjectOutputStream out)
          Implementation of the Serialization interface to avoid the serialization of the event listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
To control serialization.

See Also:
Constant Field Values

theConstraints

private List theConstraints
List of all constraints.


theEventListeners

private EventListenerList theEventListeners
List of listeners.


theModelFacade

private ModelFacade theModelFacade
A ModelFacade for typechecking.

Constructor Detail

SimpleOCLEditorModel

public SimpleOCLEditorModel()
Creates new SimpleOCLEditorModel.

Method Detail

addConstraint

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

Specified by:
addConstraint in interface OCLEditorModel

addConstraintChangeListener

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

Specified by:
addConstraintChangeListener in interface OCLEditorModel
Parameters:
ccl - the new listener

getConstraintAt

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

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

getConstraintCount

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

Specified by:
getConstraintCount in interface OCLEditorModel

removeConstraintAt

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

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

removeConstraintChangeListener

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

Specified by:
removeConstraintChangeListener in interface OCLEditorModel
Parameters:
ccl - the listener to be removed

fireConstraintRemoved

protected void fireConstraintRemoved(ConstraintRepresentation mc,
                                     int nIdx)

fireConstraintAdded

protected void fireConstraintAdded()

fireConstraintDataChanged

protected void fireConstraintDataChanged(int nIdx,
                                         ConstraintRepresentation crOld,
                                         ConstraintRepresentation crNew)

fireConstraintNameChanged

protected void fireConstraintNameChanged(int nIdx,
                                         ConstraintRepresentation crOld,
                                         ConstraintRepresentation crNew)

writeObject

private void writeObject(ObjectOutputStream out)
                  throws IOException
Implementation of the Serialization interface to avoid the serialization of the event listeners.

Throws:
IOException

readObject

private void readObject(ObjectInputStream in)
                 throws IOException,
                        ClassNotFoundException
Implementation of the Serialization interface to avoid the serialization of the event listeners.

Throws:
IOException
ClassNotFoundException

setModelFacade

public void setModelFacade(ModelFacade mf)
A ModelFacade for the OCL compiler. If no ModelFacade will be specified, no typechecking will be done.


Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.