EDU.utwente.CoCompose.lang
Class SolutionRole

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

public class SolutionRole
extends AbstractConcept

The CoCompose design language primitive SolutionRole. It is used to represent composite roles in design language solution patterns.

Version:
0.1.21, 6 April 2004
Author:
Dennis Wagelaar

Field Summary
protected static java.lang.String DefaultLabelPos
          Default label position.
protected static java.awt.Color[] FILL_COLORS
          The list of colors for identifying individual roles.
 
Fields inherited from class EDU.utwente.CoCompose.lang.AbstractConcept
changeListeners, DEFAULT_EDGE_COLOR, DEFAULT_FILL_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
SolutionRole()
          Constructs a SolutionRole.
 
Method Summary
 void accept(ModelVisitor visitor)
          Accepts a ModelVisitor.
 void addConcept(AbstractConcept concept)
          Adds a concept to this role part.
 java.util.Iterator getConcepts()
          Gets an Iterator over all concepts belonging to this role part.
 java.awt.Color getDefaultFillColor()
          Gets default fill color.
 AbstractConcept getFilledBy()
          Gets the concept that fills the role described by this solution role.
 SolutionRole getPartOf()
          Overriden method stub, since a role concept can never be part of another role concept.
 void removeConcept(AbstractConcept concept)
          Removes a concept from this role part.
 void scale(double scalex, double scaley, double scalez)
          Overwritten scale method to disallow scaling of this object.
 void setDefaultFillColor(java.awt.Color color)
          Sets the default fill color.
 void setDefaults()
          Sets the defaults for this solution role.
 void setFilledBy(AbstractConcept filled_by)
          Sets the concept that fills the role described by this solution role.
 void setModel(Model model)
          Sets the model this concept is part of and determines the fill color.
 void setPartOf(SolutionRole role)
          Overriden method stub, since a role concept can never be part of another role concept.
 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.AbstractConcept
addPropertyChangeListener, alignToGrid, alignToGrid, commentsToXML, copyAttributes, draw, drawLabel, drawSelected, drawShape, endXML, getComments, getCopiedFrom, getDrawBounds, getEdgeColor, getFillColor, getFirstCopiedFrom, getFontColor, getInstantiatedBy, getLastCopiedFrom, getModel, getName, getPublicName, getSelectColor, getSpecification, getSpecificationLang, getTargetLanguage, getUniqueRealm, gmlToXML, isCopiedFrom, notifyListeners, notifyNameChange, notifyRemovedFromModel, removePropertyChangeListener, scaleBounds, setComments, setEdgeColor, setFillColor, setFontColor, setId, setInstantiatedBy, setLabel, setName, setPosition, setPosition, setPosition, setPosition, setSelectColor, setSpecification, setSpecificationLang, setUniqueRealm, slide, specToXML, startXML, 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

FILL_COLORS

protected static final java.awt.Color[] FILL_COLORS
The list of colors for identifying individual roles.

Constructor Detail

SolutionRole

public SolutionRole()
Constructs a SolutionRole.

Method Detail

setDefaults

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

Overrides:
setDefaults in class AbstractConcept

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.

getConcepts

public java.util.Iterator getConcepts()
Gets an Iterator over all concepts belonging to this role part.


addConcept

public void addConcept(AbstractConcept concept)
Adds a concept to this role part.

Parameters:
concept - The concept to add.

removeConcept

public void removeConcept(AbstractConcept concept)
Removes a concept from this role part.

Parameters:
concept - The concept to remove.

setModel

public void setModel(Model model)
Sets the model this concept is part of and determines the fill color.

Overrides:
setModel in class AbstractConcept
Parameters:
model - The model this concept is part of.

getPartOf

public SolutionRole getPartOf()
Overriden method stub, since a role concept can never be part of another role concept.

Overrides:
getPartOf in class AbstractConcept
Returns:
This role concept.

setPartOf

public void setPartOf(SolutionRole role)
Overriden method stub, since a role concept can never be part of another role concept.

Overrides:
setPartOf in class AbstractConcept
Parameters:
role - The solution role this concept is part of.

getDefaultFillColor

public java.awt.Color getDefaultFillColor()
Gets default fill color.

Overrides:
getDefaultFillColor in class AbstractConcept
Returns:
The default fill color.

setDefaultFillColor

public void setDefaultFillColor(java.awt.Color color)
Sets the default fill color.

Parameters:
color - The default fill color.

getFilledBy

public AbstractConcept getFilledBy()
Gets the concept that fills the role described by this solution role. Note that this is a volatile property that is only valid during flattening.

Returns:
filledBy_;

setFilledBy

public void setFilledBy(AbstractConcept filled_by)
Sets the concept that fills the role described by this solution role. Note that this is a volatile property that is only valid during flattening. It should be unset (set to null) after applying a role part during flattening.

Returns:
filledBy_;

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.

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.