ptolemy.vergil.actor
Class ActorGraphModel.ExternalPortModel

java.lang.Object
  extended by ptolemy.vergil.basic.NamedObjNodeModel
      extended by ptolemy.vergil.actor.ActorGraphModel.ExternalPortModel
All Implemented Interfaces:
NodeModel
Enclosing class:
ActorGraphModel

public class ActorGraphModel.ExternalPortModel
extends NamedObjNodeModel

The model for ports that make external connections to this graph. These ports are always contained by the root of this graph model.


Constructor Summary
ActorGraphModel.ExternalPortModel()
           
 
Method Summary
 java.lang.String getDeleteNodeMoML(java.lang.Object node)
          Return a MoML String that will delete the given node from the Ptolemy model.
 java.lang.Object getParent(java.lang.Object node)
          Return the graph parent of the given node.
 java.util.Iterator inEdges(java.lang.Object node)
          Return an iterator over the edges coming into the given node.
 java.util.Iterator outEdges(java.lang.Object node)
          Return an iterator over the edges coming out of the given node.
 void removeNode(java.lang.Object eventSource, java.lang.Object node)
          Remove the given edge from the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActorGraphModel.ExternalPortModel

public ActorGraphModel.ExternalPortModel()
Method Detail

getDeleteNodeMoML

public java.lang.String getDeleteNodeMoML(java.lang.Object node)
Return a MoML String that will delete the given node from the Ptolemy model. The MoML assumes a context that is the container of the port.

Specified by:
getDeleteNodeMoML in class NamedObjNodeModel
Parameters:
node - The node.
Returns:
A valid MoML string.

getParent

public java.lang.Object getParent(java.lang.Object node)
Return the graph parent of the given node.

Parameters:
node - The node, which is assumed to be a port contained in the root of this graph model.
Returns:
The root of this graph model.

inEdges

public java.util.Iterator inEdges(java.lang.Object node)
Return an iterator over the edges coming into the given node. This method first ensures that there is a link object for every link. Then the iterator is constructed by removing any links that do not have the given node as head.

Parameters:
node - The node, which is assumed to be a port contained in the root of this graph model.
Returns:
An iterator of Link objects, all of which have the given node as their head.

outEdges

public java.util.Iterator outEdges(java.lang.Object node)
Return an iterator over the edges coming out of the given node. This iterator is constructed by looping over all the relations that the port is connected to, and ensuring that there is a link object for every link. Then the iterator is constructed by removing any links that do not have the given node as tail.

Parameters:
node - The node, which is assumed to be a port contained in the root of this graph model.
Returns:
An iterator of Link objects, all of which have their tail as the given node.

removeNode

public void removeNode(java.lang.Object eventSource,
                       java.lang.Object node)
Remove the given edge from the model.

Specified by:
removeNode in class NamedObjNodeModel
Parameters:
eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
node - The node.