Source of ClassRelationshipEdge.java


  1: import java.util.ArrayList;
  2: import java.awt.geom.Point2D;

  4: /**
  5:    An edge that is shaped like a line with up to
  6:    three segments with an arrowhead
  7: */
  8: public class ClassRelationshipEdge extends SegmentedLineEdge
  9: {
 10:    /**
 11:       Constructs a straight edge.
 12:    */
 13:    public ClassRelationshipEdge()
 14:    {
 15:       bentStyle = BentStyle.STRAIGHT;
 16:    }

 18:    /**
 19:       Sets the bentStyle property
 20:       @param newValue the bent style
 21:    */
 22:    public void setBentStyle(BentStyle newValue) { bentStyle = newValue; }
 23:    /**
 24:       Gets the bentStyle property
 25:       @return the bent style
 26:    */
 27:    public BentStyle getBentStyle() { return bentStyle; }

 29:    public ArrayList<Point2D> getPoints()
 30:    {
 31:       return bentStyle.getPath(getStart().getBounds(),
 32:          getEnd().getBounds());
 33:    }

 35:    private BentStyle bentStyle;
 36: }