|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ptolemy.vergil.basic.AbstractBasicGraphModel
This base class provides some common services for visual notations for Ptolemy II models. It assumes that the semantic object of a particular graph object is fixed, and provides facilities for making changes to the model via a change request. It supports visible attributes.
This class uses a change listener to detect changes to the Ptolemy model that do not originate from this class. These changes are propagated as structure changed graph events to all graphListeners registered with this model. This mechanism allows a graph visualization of a ptolemy model to remain synchronized with the state of a mutating model.
| Inner Class Summary | |
class |
AbstractBasicGraphModel.GraphChangeListener
Mutations may happen to the ptolemy model without the knowledge of this model. |
| Constructor Summary | |
AbstractBasicGraphModel(CompositeEntity composite)
Create a graph model for the specified Ptolemy II model. |
|
| Method Summary | |
protected static NamedObj |
_getChangeRequestParent(NamedObj object)
Return the context for which a change request concerning the given object should be made. |
protected Location |
_getLocation(NamedObj object)
Return the location attribute contained in the given object, or a new location contained in the given object if there was no location. |
protected boolean |
_update()
Update the graph model. |
abstract void |
disconnectEdge(java.lang.Object eventSource,
java.lang.Object edge)
Disconnect an edge from its two endpoints and notify graph listeners with an EDGE_HEAD_CHANGED and an EDGE_TAIL_CHANGED event whose source is the given source. |
diva.graph.modular.CompositeModel |
getCompositeModel(java.lang.Object composite)
Return the model for the given composite object. |
diva.graph.modular.NodeModel |
getNodeModel(java.lang.Object node)
Return the node model for the given object. |
java.lang.Object |
getProperty(java.lang.Object object,
java.lang.String propertyName)
Return the property of the object associated with the given property name. |
CompositeEntity |
getPtolemyModel()
Return the Ptolemy II model associated with this graph model. |
java.lang.Object |
getSemanticObject(java.lang.Object element)
Return the semantic object corresponding to the given node, edge, or composite. |
void |
removeListeners()
Remove any listeners we have created. |
abstract 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. |
void |
setProperty(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object value)
Set the property of the given graph object associated with the given property name to the given value. |
void |
setSemanticObject(java.lang.Object object,
java.lang.Object semantic)
Set the semantic object corresponding to the given node, edge, or composite. |
| Constructor Detail |
public AbstractBasicGraphModel(CompositeEntity composite)
composite - The Ptolemy II model.| Method Detail |
public abstract void disconnectEdge(java.lang.Object eventSource,
java.lang.Object edge)
eventSource - The source of the event that will be dispatched,
e.g. the view that made this call.GraphException - If the operation fails.public diva.graph.modular.CompositeModel getCompositeModel(java.lang.Object composite)
composite - A composite object.public diva.graph.modular.NodeModel getNodeModel(java.lang.Object node)
node - An object which is assumed to be in this graph model.
public java.lang.Object getProperty(java.lang.Object object,
java.lang.String propertyName)
object - The graph object, which is assumed to be an instance of
NamedObj.propertyName - The name of the new property.public CompositeEntity getPtolemyModel()
public java.lang.Object getSemanticObject(java.lang.Object element)
element - A graph element.
public abstract void removeNode(java.lang.Object eventSource,
java.lang.Object node)
eventSource - The source of the event that will be dispatched,
e.g. the view that made this call.GraphException - if the operation fails.
public void setProperty(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object value)
object - The graph object.propertyName - The property name.value - The new value of the property.
public void setSemanticObject(java.lang.Object object,
java.lang.Object semantic)
object - The graph object that represents a node or an edge.semantic - The semantic object to associate with the given
graph object.public void removeListeners()
protected static NamedObj _getChangeRequestParent(NamedObj object)
object - The object to change.protected Location _getLocation(NamedObj object)
object - The object for which a location is needed.protected boolean _update()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||