Package ptolemy.data.ontologies
Class OntologyMoMLHandler
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.data.ontologies.OntologyMoMLHandler
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class OntologyMoMLHandler extends Attribute
This is an attribute used by the OntologySolver to issue MoML requests and make changes to the model. These changes include addition, update, or deletion of concept annotations and display of the concept results. This is designed to be contained by an instance of OntologySolver or a subclass of OntologySolver. It contains parameters that allow users to configure the display of the concept annotation results.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Ben Lickly, Man-Kit Leung
- Pt.AcceptedRating:
- Red (mankit)
- Pt.ProposedRating:
- Red (mankit)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
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 OntologyMoMLHandler(NamedObj container, java.lang.String name)
Construct an OntologyMoMLHandler with the specified container and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearDisplay(boolean colors, boolean text)
Remove the highlighting and visible annotations for all property-able objects.void
highlightConcepts()
Highlight all property-able objects with the specified colors for their property values.void
highlightConcepts(java.util.Set<java.lang.Object> objects)
Highlight concepts that have already been resolved, but do not run solver.void
showConceptAnnotations()
Show all concept values as text annotations on each model element.-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _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
-
-
-
-
Constructor Detail
-
OntologyMoMLHandler
public OntologyMoMLHandler(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct an OntologyMoMLHandler with the specified container and name.- Parameters:
container
- The container which should be an instance of OntologySolver.name
- The name of the OntologyMoMLHandler.- Throws:
IllegalActionException
- If the OntologyMoMLHandler is not of an acceptable attribute for the container.NameDuplicationException
- If the name coincides with an attribute already in the container.
-
-
Method Detail
-
clearDisplay
public void clearDisplay(boolean colors, boolean text) throws IllegalActionException
Remove the highlighting and visible annotations for all property-able objects.- Parameters:
colors
- True if the highlight colors should be cleared.text
- True if the ontology concept annotation text should be cleared.- Throws:
IllegalActionException
- If getting the resolved concept fails.
-
highlightConcepts
public void highlightConcepts() throws IllegalActionException
Highlight all property-able objects with the specified colors for their property values.- Throws:
IllegalActionException
- If getting the resolved concept fails.
-
highlightConcepts
public void highlightConcepts(java.util.Set<java.lang.Object> objects) throws IllegalActionException
Highlight concepts that have already been resolved, but do not run solver. Otherwise, do nothing.- Parameters:
objects
- The set of objects to highlight.- Throws:
IllegalActionException
- Thrown if there is an error getting the colors for the resolved concept values.
-
showConceptAnnotations
public void showConceptAnnotations() throws IllegalActionException
Show all concept values as text annotations on each model element.- Throws:
IllegalActionException
- If getting the resolved concept fails.
-
-