uchicago.src.sim.network
Class DefaultDrawableEdge

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

public class DefaultDrawableEdge
extends DefaultEdge
implements DrawableEdge

A drawable edge between two nodes. A DefaultEdge implementing DrawableEdge.

Version:
$Revision: 1.4 $ $Date: 2004/11/03 19:51:01 $
Author:
Nick Collier
See Also:
Node

Field Summary
 
Fields inherited from class uchicago.src.sim.network.DefaultEdge
from, label, strength, to, type
 
Constructor Summary
DefaultDrawableEdge()
          Constructs a DefaultDrawableEdge without any connecting Nodes.
DefaultDrawableEdge(Node from, Node to)
          Construct an edge from the specified to node to the specified node with a blank label.
DefaultDrawableEdge(Node from, Node to, java.lang.String label)
          Construct an edge from the specified to node to the specified node with the specified label, and a default strength of 1.0.
DefaultDrawableEdge(Node from, Node to, java.lang.String label, float strength)
          Construct an edge from the specified to node to the specified node with the specified label, and the specified strength.
 
Method Summary
 void draw(SimGraphics g, int fromX, int toX, int fromY, int toY)
          Draws this DefaultDrawableEdge.
 void setColor(java.awt.Color val)
          Sets the color of this DefaultDrawableEdge.
 void setDrawDirected(boolean val)
          Sets whether this DefaultDrawableEdge is drawn as directed or not.
 
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

DefaultDrawableEdge

public DefaultDrawableEdge()
Constructs a DefaultDrawableEdge without any connecting Nodes. This is primarily used to load this class in a "bean-like" fashion.


DefaultDrawableEdge

public DefaultDrawableEdge(Node from,
                           Node to,
                           java.lang.String label)
Construct an edge from the specified to node to the specified node with the specified label, and a default strength of 1.0. This edge is not automatically added to the nodes, and so each node must add the edge. The edge will be drawn as directed and in red.

Parameters:
from - the from Node
to - the to Node
the - label for this edge

DefaultDrawableEdge

public DefaultDrawableEdge(Node from,
                           Node to,
                           java.lang.String label,
                           float strength)
Construct an edge from the specified to node to the specified node with the specified label, and the specified strength. This edge is not automatically added to the nodes, and so each node must add the edge. The actual end Nodes for this edge are those returned by the Node.getNode() calls. The edge will be drawn as directed and in red.

Parameters:
from - the from Node
to - the to Node
label - the label for this edge
strength - the strength of this edge

DefaultDrawableEdge

public DefaultDrawableEdge(Node from,
                           Node to)
Construct an edge from the specified to node to the specified node with a blank label. This edge is not automatically added to the nodes, and so each node must add the edge. The edge will be drawn as directed and in red.

Parameters:
from - the from Node
to - the to Node
Method Detail

setColor

public void setColor(java.awt.Color val)
Sets the color of this DefaultDrawableEdge.


setDrawDirected

public void setDrawDirected(boolean val)
Sets whether this DefaultDrawableEdge is drawn as directed or not.


draw

public void draw(SimGraphics g,
                 int fromX,
                 int toX,
                 int fromY,
                 int toY)
Draws this DefaultDrawableEdge.

Specified by:
draw in interface DrawableEdge