Class OntologyGraphController

  • All Implemented Interfaces:
    GraphController, DebugListener, ValueListener

    public class OntologyGraphController
    extends WithIconGraphController
    A Graph Controller for ontology models. This controller allows lattice elements to be dragged and dropped onto its graph. Arcs can be created by control-clicking and dragging from one element to another.
    Ptolemy II 10.0
    Charles Shelton, Man-Kit Leung
    Red (cshelton)
    Red (cshelton)
    • Field Detail

      • _conceptController

        protected ConceptController _conceptController
        The controller for concepts in the ontology model.
      • _relationController

        protected ConceptRelationController _relationController
        The controller for relations in the ontology model.
    • Constructor Detail

      • OntologyGraphController

        public OntologyGraphController()
        Create a new ontology graph controller object.
    • Method Detail

      • addToMenuAndToolbar

        public void addToMenuAndToolbar​(javax.swing.JMenu menu,
                                        javax.swing.JToolBar toolbar)
        Add commands to the specified menu and toolbar, as appropriate for this controller. For the ontology editor, a command is added to the graph menu to create a new ontology concept.
        addToMenuAndToolbar in class BasicGraphController
        menu - The menu to add to, or null if none.
        toolbar - The toolbar to add to, or null if none.
      • getEdgeController

        public EdgeController getEdgeController​(java.lang.Object object)
        Return the edge controller appropriate for the given edge. In the ontology editor, all edges are ontology relations, so the controller is always a RelationController object.
        Specified by:
        getEdgeController in interface GraphController
        Specified by:
        getEdgeController in class AbstractGraphController
        object - The given edge in the ontology model editor.
        The RelationController for all ontology relations in the ontology editor.
      • getNodeController

        public NodeController getNodeController​(java.lang.Object object)
        Return the node controller appropriate for the given node object. In the ontology editor, all nodes are ontology concepts, so the controller is always a ConceptController object or an AttributeController object for annotation attributes.
        Specified by:
        getNodeController in interface GraphController
        getNodeController in class BasicGraphController
        object - The given node in the ontology model editor.
        Either a ConceptController object or an AttributeController object.
      • _addHotKeys

        protected void _addHotKeys​(JGraph jgraph)
        Add hot keys to the actions in the given JGraph. For the ontology graph controller, add the hot keys for the concept controller and attribute controller.
        _addHotKeys in class BasicGraphController
        jgraph - The JGraph to which hot keys are to be added.
      • _createControllers

        protected void _createControllers()
        Initialize all the controller objects for elements in the ontology editor. This consists of a controller for attributes, concepts, and relations in the ontology. The parent class WithIconGraphController also references a port controller, so we must initialize it here even though the ontology model editor has no visible ports.
        _createControllers in class WithIconGraphController
      • initializeInteraction

        protected void initializeInteraction()
        Initialize interaction on the graph pane. This method is called by the setGraphPane() method of the superclass AbstractGraphController. This initialization cannot be done in the constructor because the controller does not yet have a reference to its pane at that time.
        initializeInteraction in class WithIconGraphController
      • _initializeInteraction

        protected void _initializeInteraction​(NamedObjController controller)
        Initialize interactions for the specified controller. This method is called when a new controller is constructed. In this class, this method attaches a relation creator to the controller if the controller is an instance of ConceptController.
        _initializeInteraction in class BasicGraphController
        controller - The controller for which to initialize interaction.