Package ptolemy.data.ontologies
Class ConceptRelation
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.Relation
-
- ptolemy.kernel.ComponentRelation
-
- ptolemy.data.ontologies.ConceptRelation
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class ConceptRelation extends ComponentRelation
A relation between concepts in an ontology. This class is really only used to connect the FiniteConcepts in the Ontology class, which corresponds to the relations that a user draws in the Ontology Editor in Vergil. This information is also then used to generate the ordering relations when a ConceptGraph is created.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Edward A. Lee, Ben Lickly
- See Also:
FiniteConcept
,Ontology
- Pt.AcceptedRating:
- Red (hyzheng)
- Pt.ProposedRating:
- Yellow (hyzheng)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description StringParameter
annotation
An annotation that describes the transition.ColorAttribute
color
Color in which to render this transition.Parameter
dashed
Indicator that this transition should be rendered as a dashed line.Parameter
exitAngle
Attribute the exit angle of a visual rendition.Parameter
gamma
Attribute giving the orientation of a self-loop.-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description ConceptRelation(Ontology container, java.lang.String name)
Construct a ConceptRelation with the given name contained by the specified entity.ConceptRelation(Workspace workspace)
Construct a ConceptRelation in the given workspace with an empty string as a name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_checkPort(Port port)
Throw an exception if the port cannot be linked to this relation.java.lang.String
getLabel()
Return the value of theannotation
parameter.void
setContainer(CompositeEntity container)
Override the base class to ensure that the proposed container is an instance ofOntology
or null.-
Methods inherited from class ptolemy.kernel.ComponentRelation
_checkContainer, _checkRelation, _propagateExistence, clone, deepLinkedPortList, deepLinkedPorts, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, unlinkAll
-
Methods inherited from class ptolemy.kernel.Relation
_description, _getContainedObject, link, linkedObjectsList, linkedPortList, linkedPortList, linkedPorts, linkedPorts, numLinks, relationGroupList, unlink
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Field Detail
-
annotation
public StringParameter annotation
An annotation that describes the transition. If this is non-empty, then a visual editor will be expected to put this annotation on or near the transition to document its function. This is a string that defaults to the empty string. Note that it can reference variables in scope using the notation $name.
-
color
public ColorAttribute color
Color in which to render this transition. The default color is black.
-
dashed
public Parameter dashed
Indicator that this transition should be rendered as a dashed line. This is a boolean that defaults to false.
-
exitAngle
public Parameter exitAngle
Attribute the exit angle of a visual rendition. This parameter contains a DoubleToken, initially with value 0.0. It must lie between -PI and PI. Otherwise, it will be truncated to lie within this range.
-
gamma
public Parameter gamma
Attribute giving the orientation of a self-loop. This is equal to the tangent at the midpoint (more or less). This parameter contains a DoubleToken, initially with value 0.0.
-
-
Constructor Detail
-
ConceptRelation
public ConceptRelation(Ontology container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a ConceptRelation with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This ConceptRelation will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string.- Parameters:
container
- The container.name
- The name of the ConceptRelation.- Throws:
IllegalActionException
- If the container is incompatible with this ConceptRelation.NameDuplicationException
- If the name coincides with any relation already in the container.
-
ConceptRelation
public ConceptRelation(Workspace workspace) throws IllegalActionException, NameDuplicationException
Construct a ConceptRelation in the given workspace with an empty string as a name. If the workspace argument is null, use the default workspace. The object is added to the workspace directory. Increment the version of the workspace.- Parameters:
workspace
- The workspace for synchronization and version tracking.- Throws:
IllegalActionException
- If the container is incompatible with this ConceptRelation.NameDuplicationException
- If the name coincides with any relation already in the container.
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
Return the value of theannotation
parameter.- Returns:
- The value of the annotation parameter, or a string "ERROR" if the parameter cannot be evaluated.
-
setContainer
public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException
Override the base class to ensure that the proposed container is an instance ofOntology
or null.- Overrides:
setContainer
in classComponentRelation
- Parameters:
container
- The proposed container.- Throws:
IllegalActionException
- If the argument is not an Ontology or null.NameDuplicationException
- If the container already has a relation with the name of this relation.- See Also:
ComponentRelation.getContainer()
-
_checkPort
protected void _checkPort(Port port) throws IllegalActionException
Throw an exception if the port cannot be linked to this relation.- Overrides:
_checkPort
in classComponentRelation
- Parameters:
port
- The port to be checked to see if the relation can be attached- Throws:
IllegalActionException
- If the port's container is not aFiniteConcept
.
-
-