uchicago.src.repastdemos.jain
Class JainEdge
java.lang.Object
uchicago.src.sim.network.DefaultEdge
uchicago.src.repastdemos.jain.JainEdge
- All Implemented Interfaces:
- DrawableEdge, Edge
public class JainEdge
- extends DefaultEdge
- implements DrawableEdge
|
Method Summary |
void |
draw(SimGraphics g,
int fromX,
int toX,
int fromY,
int toY)
Called by a Network*Display instructing the edge to draw itself. |
void |
setColor(java.awt.Color c)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JainEdge
public JainEdge()
JainEdge
public JainEdge(Node from,
Node to,
float strength,
java.awt.Color color)
setColor
public void setColor(java.awt.Color c)
draw
public void draw(SimGraphics g,
int fromX,
int toX,
int fromY,
int toY)
- Description copied from interface:
DrawableEdge
- Called by a Network*Display instructing the edge to draw itself.
The coordinates are screen coordinates and correspond to the center of
the nodes. Edges to be drawn by a Network*Display must implement this
interface. Typicaly, some line drawing method in SimGraphics is called,
passing the remaining arguments to that method. For example
public void draw(SimGraphics g, int fromX, int toX, int fromY, int toY) {
g.drawLink(Color.red, fromX, toX, fromY, toY);
}
The x and y coordinates are calculated by the Display from the position
of the nodes to which this is an edge.
- Specified by:
draw in interface DrawableEdge