be.ac.vub.cocompose.lang.impl.core
Class DefaultConcept

java.lang.Object
  extended bybe.ac.vub.cocompose.lang.impl.DefaultElement
      extended bybe.ac.vub.cocompose.lang.impl.core.DefaultModelElement
          extended bybe.ac.vub.cocompose.lang.impl.core.DefaultNamespace
              extended bybe.ac.vub.cocompose.lang.impl.core.DefaultRelationElement
                  extended bybe.ac.vub.cocompose.lang.impl.core.DefaultRefinedElement
                      extended bybe.ac.vub.cocompose.lang.impl.core.DefaultConcept
All Implemented Interfaces:
Cloneable, Concept, Element, ModelElement, Namespace, RefinedElement, RelationElement, VisitedElement
Direct Known Subclasses:
EclipseConcept

public class DefaultConcept
extends DefaultRefinedElement
implements Concept

The Concept language element default implementation.

Since:
0.2.0
Version:
0.2.5, 03/03/2004
Author:
Dennis Wagelaar

Constructor Summary
DefaultConcept()
           
 
Method Summary
 void accept(ModelVisitor modelVisitor)
          Accepts a visitor.
 void addPartOf(int index, Role partOf)
          Adds a role of which this concept is a part.
 void addPartOf(Role partOf)
          Adds a role of which this concept is a part.
 Color getBackgroundColor()
          Gets the background color.
 Model getDefaultConceptOf()
          Gets the model of which this concept is the default concept, if any.
 List getPartOf()
          Gets the roles of which this concept is a part.
 void removePartOf(Role partOf)
          Removes a role of which this concept is a part.
 void setDefaultConceptOf(Model model)
          Sets the model of which this concept is the default concept, if any.
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.core.DefaultRefinedElement
addInheritsFrom, addInheritsFrom, addOwnedElement, addSuperimposesOn, addSuperimposesOn, getIconUri, getInheritsFrom, getRefinements, getSuperimposesOn, removeInheritsFrom, removeOwnedElement, removeSuperimposesOn, setIconUri
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.core.DefaultRelationElement
addRelationship, addRelationship, fireBackgroundColorUpdate, getDefaultBackgroundColor, getPosition, getRelationships, getSourceRelationships, getTargetRelationships, removeRelationship, setBackgroundColor, setPosition
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.core.DefaultNamespace
addOwnedElement, getDeepOwnedElements, getOwnedElement, getOwnedElementId, getOwnedElements, getOwnedElements, isRegistered, registerNameChange, translateIndex, translateIndex
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.core.DefaultModelElement
getId, getModel, getName, getNamespace, setId, setName, setNamespace, toString
 
Methods inherited from class be.ac.vub.cocompose.lang.impl.DefaultElement
addPropertyChangeListener, firePropertyChange, fireStructureChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface be.ac.vub.cocompose.lang.core.RefinedElement
addInheritsFrom, addInheritsFrom, addSuperimposesOn, addSuperimposesOn, getIconUri, getInheritsFrom, getRefinements, getSuperimposesOn, removeInheritsFrom, removeSuperimposesOn, setIconUri
 
Methods inherited from interface be.ac.vub.cocompose.lang.core.RelationElement
addRelationship, addRelationship, getPosition, getRelationships, getSourceRelationships, getTargetRelationships, removeRelationship, setBackgroundColor, setPosition
 
Methods inherited from interface be.ac.vub.cocompose.lang.core.Namespace
addOwnedElement, addOwnedElement, getDeepOwnedElements, getOwnedElement, getOwnedElementId, getOwnedElements, getOwnedElements, isRegistered, registerNameChange, removeOwnedElement
 
Methods inherited from interface be.ac.vub.cocompose.lang.core.ModelElement
getId, getModel, getName, getNamespace, setId, setName, setNamespace
 
Methods inherited from interface be.ac.vub.cocompose.lang.Element
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

DefaultConcept

public DefaultConcept()
Method Detail

accept

public void accept(ModelVisitor modelVisitor)
            throws ModelElementException
Accepts a visitor.

Specified by:
accept in interface VisitedElement
Overrides:
accept in class DefaultRefinedElement
Parameters:
modelVisitor - The visitor to accept.
Throws:
ModelElementException

getPartOf

public List getPartOf()
Gets the roles of which this concept is a part.

Specified by:
getPartOf in interface Concept
Returns:
the roles.

addPartOf

public void addPartOf(Role partOf)
Adds a role of which this concept is a part.

Specified by:
addPartOf in interface Concept
Parameters:
partOf - the role.

addPartOf

public void addPartOf(int index,
                      Role partOf)
Adds a role of which this concept is a part.

Specified by:
addPartOf in interface Concept
Parameters:
index - the index at which to add the element.
partOf - the role.

removePartOf

public void removePartOf(Role partOf)
Removes a role of which this concept is a part.

Specified by:
removePartOf in interface Concept
Parameters:
partOf - the role.

getBackgroundColor

public Color getBackgroundColor()
Gets the background color. Returns the background color of the partOf role, if only one partOf role exists. Returns the color of the parent namespace if it is a RefinedElement.

Specified by:
getBackgroundColor in interface RelationElement
Overrides:
getBackgroundColor in class DefaultRelationElement
Returns:
the background color.
See Also:
RefinedElement

getDefaultConceptOf

public Model getDefaultConceptOf()
Gets the model of which this concept is the default concept, if any.

Specified by:
getDefaultConceptOf in interface Concept
Returns:
the model of which this concept is the default concept, if any.

setDefaultConceptOf

public void setDefaultConceptOf(Model model)
Sets the model of which this concept is the default concept, if any.

Specified by:
setDefaultConceptOf in interface Concept
Parameters:
model - the model of which this concept is the default concept, if any.