EDU.utwente.CoCompose.lang
Class CompositeRole

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

public class CompositeRole
extends CompositePartConcept

The role class representing the roles of the CoCompose design language primitive Composite.

Version:
0.1.15, 20 October 2003
Author:
Dennis Wagelaar

Field Summary
protected static java.lang.String DefaultLabelPos
          Default label position.
static int MULT_MANY
          Multiplicity value many (n).
static int MULT_ONE
          Multiplicity value one (1).
static int MULT_ZERO
          Multiplicity value zero (0).
 
Fields inherited from class EDU.utwente.CoCompose.lang.CompositePartConcept
DEFAULT_FILL_COLOR
 
Fields inherited from class EDU.utwente.CoCompose.lang.AbstractConcept
changeListeners, DEFAULT_EDGE_COLOR, DEFAULT_FONT_COLOR, DEFAULT_SELECT_COLOR, defaultLabel_, 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
CompositeRole()
          Constructs a CompositeRole.
 
Method Summary
 void accept(ModelVisitor visitor)
          Accepts a ModelVisitor.
 void checkCompleteness()
          Checks the completeness of the composite role using default rules and the specific CompletenessConstraint, if it exists.
 void checkCorrectness()
          Checks the correctness of the composite role using the default rules and the specific CorrectnessConstraint, if it exists.
 void copyAttributes(CompositeRole fromRole)
          Copies attributes from fromRole to self.
 int getMultLowerBound()
          Gets multiplicity lower bound attribute.
 int getMultUpperBound()
          Gets multiplicity upper bound attribute.
protected  void multToXML(org.xml.sax.helpers.DefaultHandler handler)
          Create XML from the multiplicity attributes using a SAX DefaultHandler.
 void scale(double scalex, double scaley, double scalez)
          Overwritten scale method to disallow scaling of this object.
 void setDefaults()
          Sets the defaults for this composite role.
 void setLabel()
          Sets the label using the object attributes.
 void setMultLowerBound(int multLowerBound_in)
          Sets multiplicity lower bound attribute - updates label as well.
 void setMultUpperBound(int multUpperBound_in)
          Sets multiplicity upper bound attribute - updates label as well.
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 toXML(org.xml.sax.helpers.DefaultHandler handler)
          Create XML from this object using a SAX DefaultHandler.
 
Methods inherited from class EDU.utwente.CoCompose.lang.CompositePartConcept
boundDimension, boundPosition, boundPosition, getComposite, getDefaultFillColor, getInstantiatedBy, getPartOf, restoreCompositeOffset, saveCompositeOffset, setComposite, setInstantiatedBy, setPartOf, setPosition, setPosition, setPosition, setPosition
 
Methods inherited from class EDU.utwente.CoCompose.lang.ConstrainedConcept
checkConstraint, copyAttributes, getCompletenessConstraint, getCorrectnessConstraint, setCompletenessConstraint, setCorrectnessConstraint, updateAttributes
 
Methods inherited from class EDU.utwente.CoCompose.lang.AbstractConcept
addPropertyChangeListener, alignToGrid, alignToGrid, commentsToXML, copyAttributes, draw, drawLabel, drawSelected, drawShape, endXML, getComments, getCopiedFrom, getDrawBounds, getEdgeColor, getFillColor, getFirstCopiedFrom, getFontColor, getLastCopiedFrom, getModel, getName, getPublicName, getSelectColor, getSpecification, getSpecificationLang, getTargetLanguage, getUniqueRealm, gmlToXML, isCopiedFrom, notifyListeners, notifyNameChange, notifyRemovedFromModel, removePropertyChangeListener, scaleBounds, setComments, setEdgeColor, setFillColor, setFontColor, setId, setModel, setName, setSelectColor, setSpecification, setSpecificationLang, setUniqueRealm, slide, specToXML, toPS, toString, 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, 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
 

Field Detail

DefaultLabelPos

protected static final java.lang.String DefaultLabelPos
Default label position.

See Also:
Constant Field Values

MULT_ZERO

public static final int MULT_ZERO
Multiplicity value zero (0).

See Also:
Constant Field Values

MULT_ONE

public static final int MULT_ONE
Multiplicity value one (1).

See Also:
Constant Field Values

MULT_MANY

public static final int MULT_MANY
Multiplicity value many (n).

See Also:
Constant Field Values
Constructor Detail

CompositeRole

public CompositeRole()
Constructs a CompositeRole.

Method Detail

multToXML

protected void multToXML(org.xml.sax.helpers.DefaultHandler handler)
                  throws org.xml.sax.SAXException
Create XML from the multiplicity attributes using a SAX DefaultHandler.

Parameters:
handler - The SAX DefaultHandler.
Throws:
org.xml.sax.SAXException - if an XML handler error occurs.

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 ConstrainedConcept
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.

setDefaults

public void setDefaults()
Sets the defaults for this composite role.

Overrides:
setDefaults in class AbstractConcept

setLabel

public void setLabel()
Sets the label using the object attributes.

Overrides:
setLabel in class AbstractConcept

getMultLowerBound

public int getMultLowerBound()
Gets multiplicity lower bound attribute.

Returns:
The multiplicity lower bound attribute.

setMultLowerBound

public void setMultLowerBound(int multLowerBound_in)
Sets multiplicity lower bound attribute - updates label as well.
Precondition: MULT_ZERO <= multUpperBound <= MULT_ONE

Parameters:
multLowerBound_in - The new multiplicity lower bound.

getMultUpperBound

public int getMultUpperBound()
Gets multiplicity upper bound attribute.

Returns:
The multiplicity upper bound attribute.

setMultUpperBound

public void setMultUpperBound(int multUpperBound_in)
Sets multiplicity upper bound attribute - updates label as well.
Precondition: MULT_ONE <= multUpperBound <= MULT_MANY

Parameters:
multUpperBound_in - The new multiplicity upper bound.

copyAttributes

public void copyAttributes(CompositeRole fromRole)
Copies attributes from fromRole to self.

Parameters:
fromRole - The CompositeRole to copy the attributes from.

scale

public void scale(double scalex,
                  double scaley,
                  double scalez)
Overwritten scale method to disallow scaling of this object. There's no need to call this method, since it's a stub.

Overrides:
scale in class Node
Parameters:
scalex - The X axis scale multiplier.
scaley - The Y axis scale multiplier.
scalez - The Z axis scale multiplier.

toXML

public void toXML(org.xml.sax.helpers.DefaultHandler handler)
           throws org.xml.sax.SAXException
Create XML from this object using a SAX DefaultHandler.

Overrides:
toXML in class AbstractConcept
Parameters:
handler - The SAX DefaultHandler.
Throws:
org.xml.sax.SAXException - if an XML handler error occurs.

checkCompleteness

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

Overrides:
checkCompleteness in class ConstrainedConcept
Throws:
CoComposeException - if the composite role is not completely specified.

checkCorrectness

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

Overrides:
checkCorrectness in class ConstrainedConcept
Throws:
CoComposeException - if the composite is not correctly specified.

accept

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

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