Class OntologySolverGraphModel

  • All Implemented Interfaces:
    GraphModel, ChangeListener

    public class OntologySolverGraphModel
    extends AbstractBasicGraphModel
    A graph model for graphically manipulating ontology solver models.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Charles Shelton, Edward A. Lee
    Pt.AcceptedRating:
    Red (cshelton)
    Pt.ProposedRating:
    Red (cshelton)
    • Constructor Detail

      • OntologySolverGraphModel

        public OntologySolverGraphModel​(CompositeEntity composite)
        Construct a new graph model whose root is the given composite entity. This should always be an OntologySolverModel composite entity.
        Parameters:
        composite - The top-level composite entity for the model.
    • Method Detail

      • disconnectEdge

        public void disconnectEdge​(java.lang.Object eventSource,
                                   java.lang.Object edge)
        Disconnect an edge object. In an ontology solver model there are no edges in the graph, so this method does nothing.
        Specified by:
        disconnectEdge in class AbstractBasicGraphModel
        Parameters:
        eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
        edge - The edge to be disconnected.
      • getOntologyModel

        public OntologySolverGraphModel.OntologyModel getOntologyModel()
        Get the ontology model which maps all ontology nodes in the graph to the Ontology elements in then ontology solver model.
        Returns:
        The concept model.
      • getDeleteEdgeMoML

        public java.lang.String getDeleteEdgeMoML​(java.lang.Object edge)
        Return a MoML String that will delete the given edge from the Ptolemy model. Since there are no edges in an ontology solver model, this method always returns the empty string.
        Specified by:
        getDeleteEdgeMoML in class AbstractBasicGraphModel
        Parameters:
        edge - The edge.
        Returns:
        The empty string.
      • getDeleteNodeMoML

        public java.lang.String getDeleteNodeMoML​(java.lang.Object node)
        Return a MoML String that will delete the given node from the Ptolemy model.
        Specified by:
        getDeleteNodeMoML in class AbstractBasicGraphModel
        Parameters:
        node - The node.
        Returns:
        A valid MoML string.
      • getEdgeModel

        public EdgeModel getEdgeModel​(java.lang.Object edge)
        Return the edge controller appropriate for the given edge. In the ontology solver editor, there are no edges in the model, so this method returns null.
        Specified by:
        getEdgeModel in class ModularGraphModel
        Parameters:
        edge - The given edge in the ontology solver model editor. No edges exist in the ontology solver model.
        Returns:
        null.
      • getNodeModel

        public NodeModel getNodeModel​(java.lang.Object node)
        Return the node model for the given object. If the object is not a node, then return null. The nodes in an ontology solver model should be either Ontology entities or Ptolemy attributes that contain concept functions or actor constraint definitions.
        Overrides:
        getNodeModel in class AbstractBasicGraphModel
        Parameters:
        node - An object which is assumed to be in this graph model.
        Returns:
        The node model for the specified node, or null if there is none.
      • removeNode

        public void removeNode​(java.lang.Object eventSource,
                               java.lang.Object node)
        Delete a node from its parent graph and notify graph listeners with a NODE_REMOVED event.
        Specified by:
        removeNode in class AbstractBasicGraphModel
        Parameters:
        eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
        node - The node to be removed.