EDU.utwente.CoCompose.lang
Class Concept

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

public class Concept
extends AbstractConcept

The CoCompose design language primitive Concept.

Version:
0.1.20, 2 April 2004
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
Concept()
          Constructs a Concept.
 
Method Summary
 void accept(ModelVisitor visitor)
          Accepts a ModelVisitor.
 void addImplementation(Implementation implementation)
          Adds an implementation for this concept.
 void copyAttributes(Concept fromConcept)
          Copies attributes from fromConcept to self.
 void copyConstraints(Concept fromConcept)
          Copies implementation constraints from fromConcept to self.
 java.lang.String getForm()
          Gets the concept form, if determined.
 int getImplementationCount()
          Gets the amount of implementations this concept has.
 java.util.Enumeration getImplementations()
          Gets the implementations for this concept.
 java.util.Enumeration getImplementations(java.lang.String language)
          Gets the implementations for this concept given the language.
 java.util.Set getNeighbourConcepts(Logger logger)
          Retrieves all Concepts linked to this Concept through a composite.
protected  void implementationsToXML(org.xml.sax.helpers.DefaultHandler handler)
          Create XML from the implementations using a SAX DefaultHandler.
 void insertImplementation(Implementation implementation, int index)
          Inserts an implementation for this concept on a given index.
 void removeImplementation(Implementation implementation)
          Removes an implementation for this concept.
 void setForm(java.lang.String form)
          Sets the concept form, if determined.
 void setLabel()
          Sets the label using the object attributes.
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.
 
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, 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

Concept

public Concept()
Constructs a Concept.

Method Detail

implementationsToXML

protected void implementationsToXML(org.xml.sax.helpers.DefaultHandler handler)
                             throws org.xml.sax.SAXException
Create XML from the implementations 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 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.

setLabel

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

Overrides:
setLabel in class AbstractConcept

addImplementation

public void addImplementation(Implementation implementation)
Adds an implementation for this concept.

Parameters:
implementation - The implementation to add.

insertImplementation

public void insertImplementation(Implementation implementation,
                                 int index)
Inserts an implementation for this concept on a given index.

Parameters:
implementation - The implementation to insert.
index - The index on which to insert the implementation.

removeImplementation

public void removeImplementation(Implementation implementation)
Removes an implementation for this concept.

Parameters:
implementation - The implementation to remove.

getImplementations

public java.util.Enumeration getImplementations()
Gets the implementations for this concept.

Returns:
The implementations for this concept.

getImplementations

public java.util.Enumeration getImplementations(java.lang.String language)
Gets the implementations for this concept given the language.

Parameters:
language - The language in which the implementations should be expressed.
Returns:
The implementations in the given language for this concept.

getImplementationCount

public int getImplementationCount()
Gets the amount of implementations this concept has.

Returns:
The amount of implementations.

getForm

public java.lang.String getForm()
Gets the concept form, if determined.

Returns:
The concept form, if determined.

setForm

public void setForm(java.lang.String form)
Sets the concept form, if determined.

Parameters:
form - The concept form.

copyAttributes

public void copyAttributes(Concept fromConcept)
Copies attributes from fromConcept to self. Inherited Node attributes are NOT copied.

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

copyConstraints

public void copyConstraints(Concept fromConcept)
                     throws CoComposeException
Copies implementation constraints from fromConcept to self.

Parameters:
fromConcept - the Concept to copy the constraints from.
Throws:
CoComposeException - - if one or more constraints could not be copied.

getNeighbourConcepts

public java.util.Set getNeighbourConcepts(Logger logger)
                                   throws java.lang.Exception
Retrieves all Concepts linked to this Concept through a composite.

Parameters:
logger - The object to log to.
Returns:
The collection of neighbour concepts.
Throws:
java.lang.Exception - if neighbours could not be retrieved.

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.