1 package org.glassbox.dotparser;
2
3 import java.awt.Point;
4
5 /***
6 A utility to hold the position information of an edge.
7 */
8 public class DOTLine {
9 private Point[] _cp;
10 private Point _ps;
11 private Point _pe;
12
13 /***
14 Constructor.
15 @param ps The startpoint of the arrow at the edge's start, or <code>null</code> if the edge does not have an arrow at it's start.
16 @param pe The startpoint of the arrow at the edge's end, or <code>null</code> if the edge does not have an arrow at it's end.
17 @param cp The B-Spline control points of the edge.
18 */
19 public DOTLine(Point ps, Point pe, Point[] cp) {
20 _ps = ps;
21 _pe = pe;
22 _cp = cp;
23 }
24
25 public boolean hasArrowAtStart() {
26 return _ps!=null;
27 }
28
29 public boolean hasArrowAtEnd() {
30 return _pe!=null;
31 }
32
33 public Point getPointOfArrowAtStart() {
34 return _ps;
35 }
36
37 public Point getPointOfArrowAtEnd() {
38 return _pe;
39 }
40
41 public Point[] getControlPoints() {
42 return _cp;
43 }
44 }