|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsim.animator.Graph
public class Graph
This class defines a Graph to be used with the Simulation package of JSIM. The Graph represents a skeleton of sources, sinks, and facilities along with interconnections between them.
Field Summary | |
---|---|
java.util.LinkedList<Edge> |
edges
|
java.util.LinkedList<AnimationEntity> |
nodes
|
double |
step
|
Constructor Summary | |
---|---|
Graph(java.util.LinkedList<AnimationEntity> nodes,
java.util.LinkedList<Edge> edges)
Constructor |
Method Summary | |
---|---|
void |
addEdge(Edge e)
Adds a new edge to the Graph |
void |
addNode(AnimationEntity ae)
Adds a new node to the Graph |
Edge |
getEdge(int id)
Returns the edge with the given id |
AnimationEntity |
getNode(int id)
Returns the node with the given id |
static void |
main(java.lang.String[] args)
Main function for testing |
void |
removeEdge(int id)
Removes an edge from the Graph |
void |
removeNode(int id)
Removes a node from the Graph |
void |
setEdgeLabel(int id)
Sets the label position for an edge |
void |
setEdges()
Sets the Edges of the Graph to connect the center of their respective endpoints Also calls all other initialization methods for the Graph |
void |
setIncrements(int id)
Sets the increments for an edge |
void |
setNodeLabel(int id)
Sets the label position for a node |
void |
setTokenLoc(int id)
Sets the token locations for a node |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.LinkedList<AnimationEntity> nodes
public java.util.LinkedList<Edge> edges
public double step
Constructor Detail |
---|
public Graph(java.util.LinkedList<AnimationEntity> nodes, java.util.LinkedList<Edge> edges)
nodes
- LinkedList of nodes for the Graphedges
- LinkedList of edges for the GraphMethod Detail |
---|
public void setEdges()
public void setNodeLabel(int id)
id
- id of nodepublic void setEdgeLabel(int id)
id
- id of edgepublic void setTokenLoc(int id)
public void setIncrements(int id)
id
- id of the edgepublic AnimationEntity getNode(int id)
id
- id of the node to removepublic Edge getEdge(int id)
id
- id of the node to removepublic void addNode(AnimationEntity ae)
ae
- AnimationEntity to add as a nodepublic void addEdge(Edge e)
e
- Edge to add to the Graphpublic void removeNode(int id)
id
- id of node to removepublic void removeEdge(int id)
id
- id of edge to removepublic static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |