uchicago.src.sim.gui
Interface DrawableEdge

All Superinterfaces:
Edge
All Known Implementing Classes:
DefaultDrawableEdge, HyperCycleLink, HyperLink, JainEdge, JiggleEdge, JinGirNewEdge

public interface DrawableEdge
extends Edge

Edges that wish to be drawn must implement this interface.

Version:
$Revision: 1.4 $ $Date: 2004/11/03 19:50:59 $
Author:
Nick Collier

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.
 
Methods inherited from interface uchicago.src.sim.network.Edge
getFrom, getLabel, getStrength, getTo, getType, setFrom, setLabel, setStrength, setTo, setType
 

Method Detail

draw

void draw(SimGraphics g,
          int fromX,
          int toX,
          int fromY,
          int toY)
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.