EDU.utwente.CoCompose.lang
Class CompositePartConcept

java.lang.Object
  |
  +--EDU.auburn.VGJ.graph.Node
        |
        +--EDU.utwente.CoCompose.lang.AbstractConcept
              |
              +--EDU.utwente.CoCompose.lang.ConstrainedConcept
                    |
                    +--EDU.utwente.CoCompose.lang.CompositePartConcept
All Implemented Interfaces:
java.lang.Cloneable, java.awt.image.ImageObserver
Direct Known Subclasses:
CompositeRole, PublishedConcept

public abstract class CompositePartConcept
extends ConstrainedConcept

The abstract base class for concepts that are part of a composite.

Version:
0.1.10, 22 July 2003
Author:
Dennis Wagelaar

Field Summary
protected static java.awt.Color DEFAULT_FILL_COLOR
          Default shape filling color.
 
Fields inherited from class EDU.utwente.CoCompose.lang.AbstractConcept
changeListeners, DEFAULT_EDGE_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
CompositePartConcept()
          Constructs a CompositePartConcept.
 
Method Summary
 void accept(ModelVisitor visitor)
          Accepts a ModelVisitor.
protected  double boundDimension(double new_pos, double size, double bound_pos, double bound_size)
          Bounds one dimension of a position only.
protected  DPoint boundPosition(DPoint new_position)
          Bounds a new role position within the bounds of the composite.
protected  DPoint3 boundPosition(DPoint3 new_position)
          Bounds a new role position within the bounds of the composite.
 Composite getComposite()
          Gets the Composite this PublishedConcept is part of.
 java.awt.Color getDefaultFillColor()
          Gets default fill color.
 AbstractConcept getInstantiatedBy()
          When instantiated from a solution pattern role part, returns what concept instantiated the role part.
 SolutionRole getPartOf()
          Gets the solution role the Composite is part of.
 void restoreCompositeOffset()
          Restore the offset coordinates to the composite, if any.
 void saveCompositeOffset()
          Saves the relative offset coordinates to the parent composite, if any.
 void setComposite(Composite composite_in)
          Sets the Composite this PublishedConcept is part of.
 void setInstantiatedBy(AbstractConcept instantiatedBy)
          Sets what concept instantiated the role part to which this belongs.
 void setPartOf(SolutionRole role)
          Sets the solution role the Composite is part of.
 void setPosition(double new_x, double new_y)
          Clips and sets a new position in the model.
 void setPosition(double new_x, double new_y, double new_z)
          Clips and sets a new position in the model.
 void setPosition(DPoint new_position)
          Clips and sets a new position in the model.
 void setPosition(DPoint3 new_position)
          Clips and sets a new position in the model.
 
Methods inherited from class EDU.utwente.CoCompose.lang.ConstrainedConcept
checkCompleteness, checkConstraint, checkCorrectness, copyAttributes, getCompletenessConstraint, getCorrectnessConstraint, setCompletenessConstraint, setCorrectnessConstraint, startXML, 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, getFontColor, getModel, getName, getPublicName, getSelectColor, getSpecification, getSpecificationLang, getTargetLanguage, getUniqueRealm, gmlToXML, notifyListeners, notifyNameChange, notifyRemovedFromModel, removePropertyChangeListener, scaleBounds, setComments, setDefaults, setEdgeColor, setFillColor, setFontColor, setId, setLabel, setModel, setName, 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
 

Field Detail

DEFAULT_FILL_COLOR

protected static final java.awt.Color DEFAULT_FILL_COLOR
Default shape filling color.
Constructor Detail

CompositePartConcept

public CompositePartConcept()
Constructs a CompositePartConcept.
Method Detail

boundDimension

protected double boundDimension(double new_pos,
                                double size,
                                double bound_pos,
                                double bound_size)
Bounds one dimension of a position only.
Parameters:
new_pos - A new position coordinate dimension.
size - The corresponding dimension size.
bound_pos - The boundary position coordinate dimension.
bound_size - The corresponding dimension boundary size.
Returns:
The clipped position coordinate dimension.

boundPosition

protected DPoint boundPosition(DPoint new_position)
Bounds a new role position within the bounds of the composite.
Parameters:
new_position - The new position coordinate to clip.
Returns:
The clipped position coordinate.

boundPosition

protected DPoint3 boundPosition(DPoint3 new_position)
Bounds a new role position within the bounds of the composite.
Parameters:
new_position - The new position coordinate to clip.
Returns:
The clipped position coordinate.

getDefaultFillColor

public java.awt.Color getDefaultFillColor()
Gets default fill color.
Overrides:
getDefaultFillColor in class AbstractConcept
Returns:
The default fill color.

setComposite

public void setComposite(Composite composite_in)
Sets the Composite this PublishedConcept is part of.
Parameters:
composite_in - The Composite to link to.

getComposite

public Composite getComposite()
Gets the Composite this PublishedConcept is part of.
Returns:
The Composite this role is a part of.

saveCompositeOffset

public void saveCompositeOffset()
Saves the relative offset coordinates to the parent composite, if any.

restoreCompositeOffset

public void restoreCompositeOffset()
Restore the offset coordinates to the composite, if any.

setPartOf

public void setPartOf(SolutionRole role)
Sets the solution role the Composite is part of.
Overrides:
setPartOf in class AbstractConcept
Parameters:
role - The solution role the Composite is part of.

getPartOf

public SolutionRole getPartOf()
Gets the solution role the Composite is part of.
Overrides:
getPartOf in class AbstractConcept
Returns:
The solution role the Composite is part of.

setPosition

public void setPosition(double new_x,
                        double new_y)
Clips and sets a new position in the model.
Overrides:
setPosition in class AbstractConcept
Parameters:
new_x - The new X coordinate.
new_y - The new Y coordinate.

setPosition

public void setPosition(DPoint new_position)
Clips and sets a new position in the model.
Overrides:
setPosition in class AbstractConcept
Parameters:
new_position - The new coordinates.

setPosition

public void setPosition(double new_x,
                        double new_y,
                        double new_z)
Clips and sets a new position in the model.
Overrides:
setPosition in class AbstractConcept
Parameters:
new_x - The new X coordinate.
new_y - The new Y coordinate.
new_z - The new Z coordinate.

setPosition

public void setPosition(DPoint3 new_position)
Clips and sets a new position in the model.
Overrides:
setPosition in class AbstractConcept
Parameters:
new_position - The new coordinates.

accept

public void accept(ModelVisitor visitor)
            throws CoComposeException
Accepts a ModelVisitor.
Overrides:
accept in class ConstrainedConcept
Parameters:
visitor - The visitor object to accept.
Throws:
CoComposeException - if visiting operation failed.

getInstantiatedBy

public AbstractConcept getInstantiatedBy()
When instantiated from a solution pattern role part, returns what concept instantiated the role part. Otherwise returns null. This property is linked to the corresponding composite property.
Overrides:
getInstantiatedBy in class AbstractConcept
Returns:
The concept that instantiated this or null.

setInstantiatedBy

public void setInstantiatedBy(AbstractConcept instantiatedBy)
Sets what concept instantiated the role part to which this belongs. This property is linked to the corresponding composite property.
Overrides:
setInstantiatedBy in class AbstractConcept
Parameters:
instantiatedBy - The concept that instantiated this.