Package ptolemy.vergil.actor
Class ActorGraphModel.PortModel
- java.lang.Object
-
- ptolemy.vergil.basic.NamedObjNodeModel
-
- ptolemy.vergil.actor.ActorGraphModel.PortModel
-
- All Implemented Interfaces:
NodeModel
- Enclosing class:
- ActorGraphModel
public class ActorGraphModel.PortModel extends NamedObjNodeModel
The model for ports that are contained in icons in this graph.
-
-
Constructor Summary
Constructors Constructor Description PortModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 node from the model.
-
-
-
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. This assumes that the context is the container of the port.- Specified by:
getDeleteNodeMoML
in classNamedObjNodeModel
- 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.- Returns:
- The (presumably unique) icon contained in the port's container.
-
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 their head as the given node.
-
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 node from the model. The node is assumed to be a port. This class queues a new change request with the ptolemy model to make this modification.- Specified by:
removeNode
in classNamedObjNodeModel
- Parameters:
eventSource
- The source of the event that will be dispatched, e.g. the view that made this call.node
- The node.
-
-