Package ptolemy.vergil.ontologies
Class OntologySolverGraphModel
- java.lang.Object
-
- diva.graph.AbstractGraphModel
-
- diva.graph.modular.ModularGraphModel
-
- ptolemy.vergil.basic.AbstractBasicGraphModel
-
- ptolemy.vergil.ontologies.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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
OntologySolverGraphModel.OntologyModel
The model for an icon that represents ontologies in the ontology solver model.
-
Field Summary
-
Fields inherited from class diva.graph.AbstractGraphModel
_graphListeners
-
-
Constructor Summary
Constructors Constructor Description OntologySolverGraphModel(CompositeEntity composite)
Construct a new graph model whose root is the given composite entity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disconnectEdge(java.lang.Object eventSource, java.lang.Object edge)
Disconnect an edge object.java.lang.String
getDeleteEdgeMoML(java.lang.Object edge)
Return a MoML String that will delete the given edge from the Ptolemy model.java.lang.String
getDeleteNodeMoML(java.lang.Object node)
Return a MoML String that will delete the given node from the Ptolemy model.EdgeModel
getEdgeModel(java.lang.Object edge)
Return the edge controller appropriate for the given edge.NodeModel
getNodeModel(java.lang.Object node)
Return the node model for the given object.OntologySolverGraphModel.OntologyModel
getOntologyModel()
Get the ontology model which maps all ontology nodes in the graph to theOntology
elements in then ontology solver model.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.-
Methods inherited from class ptolemy.vergil.basic.AbstractBasicGraphModel
_getLocation, _update, changeExecuted, changeFailed, getCompositeModel, getProperty, getPtolemyModel, getSemanticObject, isNode, removeListeners, setProperty, setSemanticObject
-
Methods inherited from class diva.graph.modular.ModularGraphModel
containsNode, getHead, getNodeCount, getParent, getRoot, getTail, inEdges, isComposite, isDirected, isEdge, nodes, nodesAfterEdges, nodesBeforeEdges, outEdges
-
Methods inherited from class diva.graph.AbstractGraphModel
addGraphListener, dispatchGraphEvent, removeGraphListener, setDispatchEnabled
-
-
-
-
Constructor Detail
-
OntologySolverGraphModel
public OntologySolverGraphModel(CompositeEntity composite)
Construct a new graph model whose root is the given composite entity. This should always be anOntologySolverModel
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 classAbstractBasicGraphModel
- 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 theOntology
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 classAbstractBasicGraphModel
- 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 classAbstractBasicGraphModel
- 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 classModularGraphModel
- 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 eitherOntology
entities or Ptolemy attributes that contain concept functions or actor constraint definitions.- Overrides:
getNodeModel
in classAbstractBasicGraphModel
- 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 classAbstractBasicGraphModel
- 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.
-
-