Package ptolemy.vergil.actor
Class ActorGraphModel.IconModel
- java.lang.Object
-
- ptolemy.vergil.basic.NamedObjNodeModel
-
- ptolemy.vergil.actor.ActorGraphModel.IconModel
-
- All Implemented Interfaces:
CompositeModel
,CompositeNodeModel
,NodeModel
- Enclosing class:
- ActorGraphModel
public static class ActorGraphModel.IconModel extends NamedObjNodeModel implements CompositeNodeModel
The model for an icon that contains ports.
-
-
Constructor Summary
Constructors Constructor Description IconModel()
-
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.int
getNodeCount(java.lang.Object composite)
Return the number of nodes contained in this graph or composite node.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
nodes(java.lang.Object composite)
Provide an iterator over the nodes in the given graph or composite node.java.util.Iterator
nodesAfterEdges(java.lang.Object composite)
Provide an iterator over the nodes that should be rendered after to the edges.java.util.Iterator
nodesBeforeEdges(java.lang.Object composite)
Provide an iterator over the nodes that should be rendered prior to the edges.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. The returned string assumes that the context is the container of the object with an icon.- Specified by:
getDeleteNodeMoML
in classNamedObjNodeModel
- Parameters:
node
- The node.- Returns:
- A valid MoML string.
-
getNodeCount
public int getNodeCount(java.lang.Object composite)
Return the number of nodes contained in this graph or composite node.- Specified by:
getNodeCount
in interfaceCompositeModel
- Parameters:
composite
- The composite, which is assumed to be an icon.- Returns:
- The number of ports contained in the container of the icon.
-
getParent
public java.lang.Object getParent(java.lang.Object node)
Return the graph parent of the given node.
-
inEdges
public java.util.Iterator inEdges(java.lang.Object node)
Return an iterator over the edges coming into the given node.
-
nodes
public java.util.Iterator nodes(java.lang.Object composite)
Provide an iterator over the nodes in the given graph or composite node. The nodes are ports, so if the container of the node is not an entity, then an empty iterator is returned. This iterator does not necessarily support removal operations.- Specified by:
nodes
in interfaceCompositeModel
- Parameters:
composite
- The composite, which is assumed to be an icon.- Returns:
- An iterator over the ports contained in the container of the icon.
-
nodesBeforeEdges
public java.util.Iterator nodesBeforeEdges(java.lang.Object composite)
Provide an iterator over the nodes that should be rendered prior to the edges. This iterator does not necessarily support removal operations. In this base class, this returns the same iterator as the nodes(Object) method.- Specified by:
nodesBeforeEdges
in interfaceCompositeModel
- Parameters:
composite
- The composite, which is assumed to be an icon.- Returns:
- An iterator of nodes that should be rendered before the edges.
-
nodesAfterEdges
public java.util.Iterator nodesAfterEdges(java.lang.Object composite)
Provide an iterator over the nodes that should be rendered after to the edges. This iterator does not necessarily support removal operations. In this base class, this returns an iterator over nothing.- Specified by:
nodesAfterEdges
in interfaceCompositeModel
- Parameters:
composite
- The composite, which is assumed to be an icon.- Returns:
- An iterator of nodes that should be rendered after the edges.
-
outEdges
public java.util.Iterator outEdges(java.lang.Object node)
Return an iterator over the edges coming out of 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 an icon.- 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.
-
-