ptolemy.vergil.fsm
Class FSMGraphModel.ArcModel

java.lang.Object
  extended byptolemy.vergil.fsm.FSMGraphModel.ArcModel
All Implemented Interfaces:
EdgeModel, MutableEdgeModel
Enclosing class:
FSMGraphModel

public class FSMGraphModel.ArcModel
extends java.lang.Object
implements MutableEdgeModel

The model for arcs between states.


Constructor Summary
FSMGraphModel.ArcModel()
           
 
Method Summary
 boolean acceptHead(java.lang.Object edge, java.lang.Object node)
          Return true if the head of the given edge can be attached to the given node.
 boolean acceptTail(java.lang.Object edge, java.lang.Object node)
          Return true if the tail of the given edge can be attached to the given node.
 java.lang.String getDeleteEdgeMoML(java.lang.Object edge)
          Return a MoML String that will delete the given edge from the Ptolemy model.
 java.lang.Object getHead(java.lang.Object edge)
          Return the head node of the given edge.
 java.lang.Object getTail(java.lang.Object edge)
          Return the tail node of the specified edge.
 boolean isDirected(java.lang.Object edge)
          Return true if this edge is directed.
 void removeEdge(java.lang.Object edge)
          Remove the given edge and delete its associated relation.
 void setHead(java.lang.Object edge, java.lang.Object newArcHead)
          Connect the given edge to the given head node.
 void setTail(java.lang.Object edge, java.lang.Object newArcTail)
          Connect the given edge to the given tail node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSMGraphModel.ArcModel

public FSMGraphModel.ArcModel()
Method Detail

acceptHead

public boolean acceptHead(java.lang.Object edge,
                          java.lang.Object node)
Return true if the head of the given edge can be attached to the given node.

Specified by:
acceptHead in interface MutableEdgeModel
Parameters:
edge - The edge to attach, which is assumed to be an arc.
node - The node to attach to.
Returns:
True if the node is an icon.

acceptTail

public boolean acceptTail(java.lang.Object edge,
                          java.lang.Object node)
Return true if the tail of the given edge can be attached to the given node.

Specified by:
acceptTail in interface MutableEdgeModel
Parameters:
edge - The edge to attach, which is assumed to be an arc.
node - The node to attach to.
Returns:
True if the node is an icon.

getHead

public java.lang.Object getHead(java.lang.Object edge)
Return the head node of the given edge.

Specified by:
getHead in interface EdgeModel
Parameters:
edge - The edge, which is assumed to be an instance of Arc.
Returns:
The node that is the head of the specified edge.

getDeleteEdgeMoML

public java.lang.String getDeleteEdgeMoML(java.lang.Object edge)
Return a MoML String that will delete the given edge from the Ptolemy model.

Returns:
A valid MoML string.

getTail

public java.lang.Object getTail(java.lang.Object edge)
Return the tail node of the specified edge.

Specified by:
getTail in interface EdgeModel
Parameters:
edge - The edge, which is assumed to be an instance of Arc.
Returns:
The node that is the tail of the specified edge.

isDirected

public boolean isDirected(java.lang.Object edge)
Return true if this edge is directed. All transitions are directed, so this always returns true.

Specified by:
isDirected in interface EdgeModel
Parameters:
edge - The edge, which is assumed to be an arc.
Returns:
True.

removeEdge

public void removeEdge(java.lang.Object edge)
Remove the given edge and delete its associated relation. This class queues a new change request with the ptolemy model to make this modification.

Parameters:
edge - The edge, which is assumed to be an arc.

setHead

public void setHead(java.lang.Object edge,
                    java.lang.Object newArcHead)
Connect the given edge to the given head node. If the specified head is null, then any pre-existing relation associated with this edge will be deleted. This class queues a new change request with the ptolemy model to make this modification.

Specified by:
setHead in interface MutableEdgeModel
Parameters:
edge - The edge, which is assumed to be an arc.
newArcHead - The new head for the edge, which is assumed to be an icon.

setTail

public void setTail(java.lang.Object edge,
                    java.lang.Object newArcTail)
Connect the given edge to the given tail node. If the specified tail is null, then any pre-existing relation associated with this edge will be deleted. This class queues a new change request with the ptolemy model to make this modification.

Specified by:
setTail in interface MutableEdgeModel
Parameters:
edge - The edge, which is assumed to be an arc.
newArcTail - The new tail for the edge, which is assumed to be an icon.