uchicago.src.repastdemos.jiggle
Class JiggleEdge
java.lang.Object
uchicago.src.sim.network.DefaultEdge
uchicago.src.repastdemos.jiggle.JiggleEdge
- All Implemented Interfaces:
- DrawableEdge, Edge
public class JiggleEdge
- extends DefaultEdge
- implements DrawableEdge
The link between JiggleNodes. Edges are objects and thus can act as agents,
although this is not the case here. JiggleEdge can draw itself and
keep track of the nodes on its ends.
- Version:
- $Revision: 1.1 $ $Date: 2005/08/12 20:04:51 $
- 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. |
void |
setColor(java.awt.Color c)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JiggleEdge
public JiggleEdge()
JiggleEdge
public JiggleEdge(Node from,
Node to,
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