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.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Charles Shelton, Man-Kit Leung
    Pt.AcceptedRating:
    Red (cshelton)
    Pt.ProposedRating:
    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.
        Overrides:
        addToMenuAndToolbar in class BasicGraphController
        Parameters:
        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
        Parameters:
        object - The given edge in the ontology model editor.
        Returns:
        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
        Overrides:
        getNodeController in class BasicGraphController
        Parameters:
        object - The given node in the ontology model editor.
        Returns:
        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.
        Overrides:
        _addHotKeys in class BasicGraphController
        Parameters:
        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.
        Overrides:
        _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.
        Overrides:
        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.
        Overrides:
        _initializeInteraction in class BasicGraphController
        Parameters:
        controller - The controller for which to initialize interaction.