|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.ic.doc.automed.reps.Model
public class Model
Model.java
The Model class represents instances of conceptual modelling
languages, such as the relational model, ER, UML, XML, or ORM languages.
Each Model will have one or more Construct instances.
| Method Summary | |
|---|---|
boolean |
addModelChangeListener(ModelChangeListener scl)
|
static boolean |
addModelsListener(ModelsListener nl)
Add an instance of any class implementing interface ModelsListener such that it will be notified of any adding
or deleting of models that may occur. |
Construct |
createConstruct(java.lang.String cName,
int cClass,
boolean isRoot)
Creates a new construct and add to the model. |
static Model |
createModel(java.lang.String modelName)
Creates a new model with the given name. |
static boolean |
exists(int MID)
|
static boolean |
exists(java.lang.String modelName)
|
void |
exportConstructs(java.io.OutputStream os)
|
void |
exportConstructs(java.io.PrintWriter pw)
|
java.awt.Point |
getAbsolutePosition()
Same behaviour as getPosition() since Model instances
are not placed relative to other Positionables. |
java.awt.Color |
getBackgroundColor()
Return the default background colour to be used from drawing SchemaObjects of this Model. |
Construct |
getConstruct(java.lang.String name)
Returns the named construct in the model or throws an AutoMedException if the construct name doesn't exist in the model. |
Construct[] |
getConstructs()
Returns an array of all the constructs in the model. |
Construct[] |
getConstructs(boolean full)
Get a list of Construct objects associated to a Model
object for generating XML structure. |
java.awt.Color |
getForegroundColor()
Return the default foreground colour to be used from drawing SchemaObjects of this Model. |
PersistentKey |
getKey()
Implements the PersistentObject interface |
java.lang.String |
getLabel()
Get the text used to label this Model. |
java.awt.Point |
getLabelPosition()
|
int |
getLabelXPos()
|
int |
getLabelYPos()
|
int |
getMID()
Returns the repository identifer of the model. |
static Model |
getModel(int MID)
Returns a reference to the Model with the given MID. |
static Model |
getModel(java.lang.String name)
Returns a reference to the Model with the given modelName. |
java.lang.String |
getModelDescription()
Returns a description of the model, each construct along with their schemes is listed in a way suitable for printing. |
java.lang.String |
getModelDescription(boolean full)
Returns a description of the model, each construct along with its schemes are listed in a way suitable for printing. |
static Model[] |
getModels()
Returns an array of all models. |
java.lang.String |
getName()
Returns the name of the model. |
java.util.Map |
getPersistentAttributes()
Implements the PersistentObject interface |
java.awt.Point |
getPosition()
Return the Point that represents the position of this
Positionable in a Panel. |
Positionable |
getPositionedRelativeTo()
Return the Positionable this is relative to. |
java.lang.Object |
getRepObject()
|
java.awt.Color |
getTextColor()
Return the default text colour to be used from drawing SchemaObjects of this Model. |
TypeHierarchy |
getTypeHierarchy()
Return the type hierarchy for this model |
java.util.List |
getTypeObjects()
Get a list of TypeHierarchy objects associated to this model |
int |
getXPos()
|
int |
getYPos()
|
void |
importConstructs(java.io.InputStream is)
|
static Model |
read(java.io.InputStream is)
|
static Model |
read(java.io.InputStream is,
java.lang.String name)
|
static void |
reloadModels()
This method empties the cached model data and then reloads it from the MDR as if the class had just been loaded. |
void |
remove()
Removes the Model from the repository. |
protected void |
removeConstructFromMap(java.lang.String name)
THIS METHOD DOESN'T DO ANYTHING AT THE MOMENT Sets the content of a particular position of the model's constructs list. |
static void |
removeModel(java.lang.String modelName)
Removes the Model with the given modelName. |
boolean |
removeModelChangeListener(ModelChangeListener scl)
|
static boolean |
removeModelsListener(ModelsListener nl)
Remove an instance of any class implementing interface ModelsListener such that it will no longer
be notified of any adding
or deleting of models that may occur. |
void |
retract()
Removes the Model from the repository, together with all associated information --- in particular all Constructs belonging to the model are removed, and hence all SchemaObjects, and hence all Transformations on those objects. |
void |
setAbsolutePosition(int x,
int y)
Same behaviour as #setPosition() since Model instances
are not placed relative to other Positionables. |
void |
setBackgroundColor(java.awt.Color c)
Set the default background colour to be used from drawing SchemaObjects of this Model. |
void |
setForegroundColor(java.awt.Color c)
Set the default foreground colour to be used from drawing SchemaObjects of this Model. |
void |
setLabel(java.lang.String label)
|
void |
setLabelPosition(int x,
int y)
|
void |
setLabelXPos(int x)
|
void |
setLabelYPos(int y)
|
void |
setName(java.lang.String modelName)
Sets the model's name. |
void |
setPosition(int x,
int y)
|
void |
setTextColor(java.awt.Color c)
Set the default text colour to be used from drawing SchemaObjects of this Model. |
void |
setXPos(int x)
|
void |
setYPos(int y)
|
java.lang.String |
toString()
|
void |
write(java.io.OutputStream os)
|
void |
write(java.io.PrintWriter pw)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static void reloadModels()
public static Model createModel(java.lang.String modelName)
throws IntegrityException
modelName - name of the model.
IntegrityException - if model already exists
public static void removeModel(java.lang.String modelName)
throws IntegrityException
modelName - name of the model to be removed.
IntegrityException - if model does not exist
public void remove()
throws IntegrityException
IntegrityExceptionpublic void retract()
public static Model[] getModels()
public static boolean exists(java.lang.String modelName)
public static boolean exists(int MID)
public static Model getModel(java.lang.String name)
throws NotFoundException
Model with the given modelName.
modelName - name of the model.
NotFoundException
public static Model getModel(int MID)
throws NotFoundException
Model with the given MID.
MID - numeric identifier of the model.
NotFoundExceptionpublic TypeHierarchy getTypeHierarchy()
public Construct createConstruct(java.lang.String cName,
int cClass,
boolean isRoot)
cName - name of the construct.cClass - class of the construct (one of
CONSTRUCT_CLASS_NODAL,
CONSTRUCT_CLASS_LINK,
CONSTRUCT_CLASS_LINK_NODAL, and
CONSTRUCT_CLASS_CONSTRAINT, see Constants).isRoot - set to true if the construct is a
construct type of its underlying data model; false
otherwise.
public java.lang.String getName()
public int getMID()
public Construct getConstruct(java.lang.String name)
throws NotFoundException
NotFoundException - if the named construct doesn't exist in the
model.public Construct[] getConstructs()
public Construct[] getConstructs(boolean full)
Construct objects associated to a Model
object for generating XML structure. We are interested in having full
details about every Construct and its schemes.
full - a boolean flag indicating whether or not to get the full
construct details. If set to false, it calls getConstructs()
method.
public java.util.List getTypeObjects()
throws AutoMedException
TypeHierarchy objects associated to this model
AutoMedException
public void setName(java.lang.String modelName)
throws IntegrityException
modelName - new name of model.
MDRException
java.sql.SQLException
DSRException
java.io.IOException
IntegrityException
protected void removeConstructFromMap(java.lang.String name)
throws IntegrityException
position - the position in the model's list of constructs whose
content is to be set.con - the new construct to be inserted into the given position.
IntegrityExceptionpublic java.lang.String getModelDescription()
getModelDescription(boolean) passing it false to get the
shorter description.
public java.lang.String getModelDescription(boolean full)
full - If true, expand construct descriptions in scheme
public void importConstructs(java.io.InputStream is)
throws java.io.IOException,
AutoRepException,
AutoMedException,
java.sql.SQLException
java.io.IOException
AutoRepException
AutoMedException
java.sql.SQLExceptionpublic void exportConstructs(java.io.OutputStream os)
public void exportConstructs(java.io.PrintWriter pw)
public static Model read(java.io.InputStream is)
throws java.io.IOException,
AutoRepException,
AutoMedException,
java.sql.SQLException
java.io.IOException
AutoRepException
AutoMedException
java.sql.SQLException
public static Model read(java.io.InputStream is,
java.lang.String name)
throws java.io.IOException,
AutoRepException,
AutoMedException,
java.sql.SQLException
java.io.IOException
AutoRepException
AutoMedException
java.sql.SQLExceptionpublic void write(java.io.OutputStream os)
public void write(java.io.PrintWriter pw)
public int getXPos()
getXPos in interface Positionablepublic int getYPos()
getYPos in interface Positionablepublic void setXPos(int x)
setXPos in interface Positionablepublic void setYPos(int y)
setYPos in interface Positionable
public void setPosition(int x,
int y)
setPosition in interface Positionable
public void setAbsolutePosition(int x,
int y)
#setPosition() since Model instances
are not placed relative to other Positionables.
setAbsolutePosition in interface Positionablepublic java.awt.Point getPosition()
PositionablePoint that represents the position of this
Positionable in a Panel. Note that depending on
the implementation of the interface, this might a coordinate
relative to some other positionable
getPosition in interface Positionablepublic java.awt.Point getAbsolutePosition()
getPosition() since Model instances
are not placed relative to other Positionables.
getAbsolutePosition in interface Positionablepublic Positionable getPositionedRelativeTo()
PositionablePositionable this is relative to. If not relative
to some other Positionable then return null.
getPositionedRelativeTo in interface Positionablepublic int getLabelXPos()
getLabelXPos in interface Positionablepublic int getLabelYPos()
getLabelYPos in interface Positionablepublic java.awt.Point getLabelPosition()
getLabelPosition in interface Positionablepublic void setLabelXPos(int x)
setLabelXPos in interface Positionablepublic void setLabelYPos(int y)
setLabelYPos in interface Positionable
public void setLabelPosition(int x,
int y)
setLabelPosition in interface Positionablepublic java.awt.Color getForegroundColor()
SchemaObjects of this Model.
getForegroundColor in interface PositionableColor, or null if no default colour is set
for this Modelpublic void setForegroundColor(java.awt.Color c)
SchemaObjects of this Model.
setForegroundColor in interface PositionableA - Color that will be used when drawing
SchemaObjects of this Model where no
+ invidual foreground color has been set.public java.awt.Color getBackgroundColor()
SchemaObjects of this Model.
getBackgroundColor in interface PositionableColor, or null if no default colour is set
for this Modelpublic void setBackgroundColor(java.awt.Color c)
SchemaObjects of this Model.
setBackgroundColor in interface PositionableA - Color that will be used when drawing
SchemaObjects of this Model where no
+ invidual background color has been set.public java.awt.Color getTextColor()
SchemaObjects of this Model.
getTextColor in interface PositionableColor, or null if no default colour is set
for this Modelpublic void setTextColor(java.awt.Color c)
SchemaObjects of this Model.
setTextColor in interface PositionableA - Color that will be used when drawing
SchemaObjects of this Model where no
+ invidual text color has been set.public java.lang.String toString()
toString in class java.lang.Objectpublic PersistentKey getKey()
PersistentObject interface
getKey in interface PersistentObjectPersistentObject.getKey()public java.util.Map getPersistentAttributes()
PersistentObject interface
getPersistentAttributes in interface PersistentObjectPersistentObject.getPersistentAttributes()public java.lang.String getLabel()
getName() at least in that any characters that need escaping
for printing are escaped.
getLabel in interface Positionablepublic void setLabel(java.lang.String label)
setLabel in interface Positionablepublic java.lang.Object getRepObject()
getRepObject in interface Positionablepublic static boolean addModelsListener(ModelsListener nl)
ModelsListener such that it will be notified of any adding
or deleting of models that may occur.
public static boolean removeModelsListener(ModelsListener nl)
ModelsListener such that it will no longer
be notified of any adding
or deleting of models that may occur.
public boolean addModelChangeListener(ModelChangeListener scl)
public boolean removeModelChangeListener(ModelChangeListener scl)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||