Package ptolemy.vergil.ontologies
Class OntologyGraphController
- java.lang.Object
-
- diva.graph.AbstractGraphController
-
- ptolemy.vergil.basic.BasicGraphController
-
- ptolemy.vergil.basic.WithIconGraphController
-
- ptolemy.vergil.ontologies.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)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.vergil.basic.WithIconGraphController
WithIconGraphController.NewPortAction
-
Nested classes/interfaces inherited from class ptolemy.vergil.basic.BasicGraphController
BasicGraphController.OpenBaseClassAction, BasicGraphController.SchematicContextMenuFactory, BasicGraphController.UnitSolverDialogAction
-
-
Field Summary
Fields Modifier and Type Field Description protected AttributeInOntologyController
_attributeController
The controller for attribute objects in the model.protected ConceptController
_conceptController
The controller for concepts in the ontology model.protected ConceptRelationController
_relationController
The controller for relations in the ontology model.-
Fields inherited from class ptolemy.vergil.basic.WithIconGraphController
_editIconAction, _portController, _removeIconAction
-
Fields inherited from class ptolemy.vergil.basic.BasicGraphController
_animated, _animationRenderer, _configureAction, _configureMenuFactory, _menuCreator, _menuFactory, _openBaseClassAction, _unitSolverDialogAction
-
-
Constructor Summary
Constructors Constructor Description OntologyGraphController()
Create a new ontology graph controller object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_addHotKeys(JGraph jgraph)
Add hot keys to the actions in the given JGraph.protected void
_createControllers()
Initialize all the controller objects for elements in the ontology editor.protected void
_initializeInteraction(NamedObjController controller)
Initialize interactions for the specified controller.void
addToMenuAndToolbar(javax.swing.JMenu menu, javax.swing.JToolBar toolbar)
Add commands to the specified menu and toolbar, as appropriate for this controller.EdgeController
getEdgeController(java.lang.Object object)
Return the edge controller appropriate for the given edge.NodeController
getNodeController(java.lang.Object object)
Return the node controller appropriate for the given node object.protected void
initializeInteraction()
Initialize interaction on the graph pane.void
setConfiguration(Configuration configuration)
Set the configuration.-
Methods inherited from class ptolemy.vergil.basic.WithIconGraphController
getNewPortLocation
-
Methods inherited from class ptolemy.vergil.basic.BasicGraphController
_areThereActiveErrorHighlights, _getClearAllErrorHighlightsChangeRequest, clearAllErrorHighlights, clearAnimation, event, getAnimationDelay, getConfiguration, getConfigureMenuFactory, getFrame, highlightError, message, setAnimationDelay, setFigure, setFrame, valueChanged
-
Methods inherited from class diva.graph.AbstractGraphController
addEdge, addEdge, addGraphViewListener, addNode, addNode, addNode, addNode, clear, clearEdge, clearNode, dispatch, drawEdge, drawNode, drawNode, getFigure, getGraphModel, getGraphPane, getSelectionModel, removeEdge, removeGraphViewListener, removeNode, rerender, rerenderEdge, rerenderNode, setGraphModel, setGraphPane, setSelectionModel
-
-
-
-
Field Detail
-
_attributeController
protected AttributeInOntologyController _attributeController
The controller for attribute objects in the model.
-
_conceptController
protected ConceptController _conceptController
The controller for concepts in the ontology model.
-
_relationController
protected ConceptRelationController _relationController
The controller for relations in the ontology model.
-
-
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 classBasicGraphController
- 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 interfaceGraphController
- Specified by:
getEdgeController
in classAbstractGraphController
- 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 interfaceGraphController
- Overrides:
getNodeController
in classBasicGraphController
- Parameters:
object
- The given node in the ontology model editor.- Returns:
- Either a ConceptController object or an AttributeController object.
-
setConfiguration
public void setConfiguration(Configuration configuration)
Set the configuration. This is used by some of the controllers when opening files or URLs.- Overrides:
setConfiguration
in classWithIconGraphController
- Parameters:
configuration
- The configuration.- See Also:
BasicGraphController.getConfiguration()
-
_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 classBasicGraphController
- 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 classWithIconGraphController
-
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 classWithIconGraphController
-
_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 classBasicGraphController
- Parameters:
controller
- The controller for which to initialize interaction.
-
-