01: import java.awt.*;
02: import java.awt.geom.*;
03: 
04: /**
05:    An edge that is shaped like a straight line.
06: */
07: public class LineEdge extends AbstractEdge
08: {
09:    public void draw(Graphics2D g2)
10:    {
11:       g2.draw(getConnectionPoints());
12:    }
13: 
14:    public boolean contains(Point2D aPoint)
15:    {
16:       final double MAX_DIST = 2;
17:       return getConnectionPoints().ptSegDist(aPoint) 
18:          < MAX_DIST;
19:    }
20: }