uchicago.src.repastdemos.jain
Class JainEdge

java.lang.Object
  extended by uchicago.src.sim.network.DefaultEdge
      extended by uchicago.src.repastdemos.jain.JainEdge
All Implemented Interfaces:
DrawableEdge, Edge

public class JainEdge
extends DefaultEdge
implements DrawableEdge


Field Summary
 
Fields inherited from class uchicago.src.sim.network.DefaultEdge
from, label, strength, to, type
 
Constructor Summary
JainEdge()
           
JainEdge(Node from, Node to, float strength, java.awt.Color color)
           
 
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 uchicago.src.sim.network.DefaultEdge
getFrom, getLabel, getStrength, getTo, getType, setFrom, setLabel, setStrength, setTo, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uchicago.src.sim.network.Edge
getFrom, getLabel, getStrength, getTo, getType, setFrom, setLabel, setStrength, setTo, setType
 

Constructor Detail

JainEdge

public JainEdge()

JainEdge

public JainEdge(Node from,
                Node to,
                float strength,
                java.awt.Color color)
Method Detail

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