EDU.utwente.CoCompose.lang
Class ConstrainedConcept

java.lang.Object
  extended byEDU.auburn.VGJ.graph.Node
      extended byEDU.utwente.CoCompose.lang.AbstractConcept
          extended byEDU.utwente.CoCompose.lang.ConstrainedConcept
All Implemented Interfaces:
java.lang.Cloneable, java.awt.image.ImageObserver
Direct Known Subclasses:
Composite, CompositePartConcept

public abstract class ConstrainedConcept
extends AbstractConcept

The abstract base class for concepts with completeness and correctness constraints.

Version:
0.1.18, 24 November 2003
Author:
Dennis Wagelaar

Field Summary
 
Fields inherited from class EDU.utwente.CoCompose.lang.AbstractConcept
changeListeners, DEFAULT_EDGE_COLOR, DEFAULT_FILL_COLOR, DEFAULT_FONT_COLOR, DEFAULT_SELECT_COLOR, defaultLabel_, DefaultLabelPos, DefaultShape, FONT_SIZE, realm_
 
Fields inherited from class EDU.auburn.VGJ.graph.Node
BELOW, CENTER, data, data_, defaultDataTypes_, defaults, depth_, groupActive_, groupbox_, groupNode_, groupNodeId_, grouppos_, haveId_, height_, id_, IN, inActiveGroup_, index_, isDummy_, isGroup_, label_, oldbox_, oldpos_, OVAL, RECTANGLE, shapeNames, width_, x_, y_, z_
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ConstrainedConcept()
          Constructs a ConstrainedConcept
 
Method Summary
 void accept(ModelVisitor visitor)
          Accepts a ModelVisitor.
 void checkCompleteness()
          Checks the completeness of this concept using default rules and the specific CompletenessConstraint, if it exists.
protected  void checkConstraint(java.lang.String constraintName)
          Checks a constraint of this concept, if it exists.
 void checkCorrectness()
          Checks the correctness of this concept using the default rules and the specific CorrectnessConstraint, if it exists.
 void copyAttributes(ConstrainedConcept fromConcept)
          Copies attributes from fromConcept to self.
 java.lang.String getCompletenessConstraint()
          Gets the completeness constraint filename.
 java.lang.String getCorrectnessConstraint()
          Gets the correctness constraint filename.
 void setCompletenessConstraint(java.lang.String constraint_in)
          Sets the completeness constraint filename.
 void setCorrectnessConstraint(java.lang.String constraint_in)
          Sets the correctness constraint filename.
protected  void startXML(org.xml.sax.helpers.DefaultHandler handler, java.lang.String element, org.xml.sax.helpers.AttributesImpl atts)
          Create XML start from this object using a SAX DefaultHandler, element name and given attributes.
 void updateAttributes(ConstrainedConcept fromConcept)
          Updates attributes from fromConcept to self.
 
Methods inherited from class EDU.utwente.CoCompose.lang.AbstractConcept
addPropertyChangeListener, alignToGrid, alignToGrid, commentsToXML, copyAttributes, draw, drawLabel, drawSelected, drawShape, endXML, getComments, getCopiedFrom, getDefaultFillColor, getDrawBounds, getEdgeColor, getFillColor, getFirstCopiedFrom, getFontColor, getInstantiatedBy, getLastCopiedFrom, getModel, getName, getPartOf, getPublicName, getSelectColor, getSpecification, getSpecificationLang, getTargetLanguage, getUniqueRealm, gmlToXML, isCopiedFrom, notifyListeners, notifyNameChange, notifyRemovedFromModel, removePropertyChangeListener, scaleBounds, setComments, setDefaults, setEdgeColor, setFillColor, setFontColor, setId, setInstantiatedBy, setLabel, setModel, setName, setPartOf, setPosition, setPosition, setPosition, setPosition, setSelectColor, setSpecification, setSpecificationLang, setUniqueRealm, slide, specToXML, toPS, toString, toXML, unRegister
 
Methods inherited from class EDU.auburn.VGJ.graph.Node
clearChild, clone, copyAttributes, firstChild, getBoundingBox, getBoundingBox3, getChildren, getDefaultLabel, getDrawBounds_, getId, getIdObject, getImage, getImagePixels, getImageSource, getImageType, getIndex, getLabel, getLabelPosition, getPosition, getPosition3, getSelected, getShape, getTemp, getVisibleGroupRoot, groupActive, hasChild, hasChild, imagePS, imageUpdate, inGroup, intersectWithLineTo, isGroup, isVisible, nextChild, numberOfChildren, PSnum_, psString_, saveState, scale, searchNextChild, setBoundingBox, setBoundingBox, setBoundingBox, setBoundingBox, setChild, setContext, setDefaultLabel, setGMLvalues, setGroup, setImage, setImageSource, setImageType, setLabel, setLabelPosition, setSelected, setShape, setTemp, setToolkit, toPSimage
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstrainedConcept

public ConstrainedConcept()
Constructs a ConstrainedConcept

Method Detail

checkConstraint

protected void checkConstraint(java.lang.String constraintName)
                        throws CoComposeException
Checks a constraint of this concept, if it exists.

Parameters:
constraintName - The class name of the constraint to check.
Throws:
CoComposeException - if the constraint is not fulfilled.

startXML

protected void startXML(org.xml.sax.helpers.DefaultHandler handler,
                        java.lang.String element,
                        org.xml.sax.helpers.AttributesImpl atts)
                 throws org.xml.sax.SAXException
Create XML start from this object using a SAX DefaultHandler, element name and given attributes.

Overrides:
startXML in class AbstractConcept
Parameters:
handler - The SAX DefaultHandler.
element - The XML element name.
atts - The XML element attributes.
Throws:
org.xml.sax.SAXException - if an XML handler error occurs.

getCompletenessConstraint

public java.lang.String getCompletenessConstraint()
Gets the completeness constraint filename.

Returns:
The completeness constraint filename.

setCompletenessConstraint

public void setCompletenessConstraint(java.lang.String constraint_in)
Sets the completeness constraint filename.

Parameters:
constraint_in - The completeness constraint filename.

getCorrectnessConstraint

public java.lang.String getCorrectnessConstraint()
Gets the correctness constraint filename.

Returns:
The correctness constraint filename.

setCorrectnessConstraint

public void setCorrectnessConstraint(java.lang.String constraint_in)
Sets the correctness constraint filename.

Parameters:
constraint_in - The correctness constraint filename.

checkCompleteness

public void checkCompleteness()
                       throws CoComposeException
Checks the completeness of this concept using default rules and the specific CompletenessConstraint, if it exists.

Throws:
CoComposeException - if this concept is not completely specified.

checkCorrectness

public void checkCorrectness()
                      throws CoComposeException
Checks the correctness of this concept using the default rules and the specific CorrectnessConstraint, if it exists.

Throws:
CoComposeException - if this concept is not correctly specified.

copyAttributes

public void copyAttributes(ConstrainedConcept fromConcept)
Copies attributes from fromConcept to self.

Parameters:
fromConcept - The Concept to copy the attributes from.

updateAttributes

public void updateAttributes(ConstrainedConcept fromConcept)
Updates attributes from fromConcept to self. Assumes this concept is already in use within a model and only needs the attributes copied, which are specific for this class.

Parameters:
fromConcept - The concept to copy the attributes from.

accept

public void accept(ModelVisitor visitor)
            throws CoComposeException
Accepts a ModelVisitor.

Overrides:
accept in class AbstractConcept
Parameters:
visitor - The visitor object to accept.
Throws:
CoComposeException - if visiting operation failed.