01: package net.sourceforge.squirrel_sql.plugins.graph;
02:
03: import java.awt.*;
04:
05: public class GraphLine {
06: private Point _beg;
07: private Point _end;
08: private FoldingPoint _fpBeg;
09: private FoldingPoint _fpEnd;
10:
11: public GraphLine(Point begin, Point end) {
12: this ._beg = begin;
13: this ._end = end;
14: }
15:
16: public GraphLine(FoldingPoint begin, Point end) {
17: this ._fpBeg = begin;
18: this ._end = end;
19: }
20:
21: public GraphLine(Point begin, FoldingPoint end) {
22: this ._beg = begin;
23: this ._fpEnd = end;
24: }
25:
26: public GraphLine(FoldingPoint begin, FoldingPoint end) {
27: this ._fpBeg = begin;
28: this ._fpEnd = end;
29: }
30:
31: public GraphLine(GraphLine line) {
32:
33: if (null == line.getBegin()) {
34: _fpBeg = new FoldingPoint(line._fpBeg);
35: } else {
36: _beg = new Point(line._beg);
37: }
38:
39: if (null == line.getEnd()) {
40: _fpEnd = new FoldingPoint(line._fpEnd);
41: } else {
42: _beg = new Point(line._end);
43: }
44: }
45:
46: public Point getBegin() {
47: if (null == _beg) {
48: return _fpBeg.getZoomedPoint();
49: } else {
50: return _beg;
51: }
52: }
53:
54: public Point getEnd() {
55: if (null == _end) {
56: return _fpEnd.getZoomedPoint();
57: } else {
58: return _end;
59: }
60: }
61: }
|