Class 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)
    • 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.