summaryrefslogtreecommitdiffstats
path: root/tests/ajde/examples/figures-cacm/figures/Line.java
blob: 3e8f6582d6a7b2414bb1fafa43aa1066bc8dc76a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package figures;

class Line {
    private Point p1, p2;

    Line(Point p1, Point p2) {
	super();
	this.p1 = p1;
	this.p2 = p2;
    }

    Point getP1() { return p1; }
    Point getP2() { return p2; }

    void setP1(Point p1) { this.p1 = p1; }
    void setP2(Point p2) { this.p2 = p2; }

    void moveBy(int dx, int dy) {
	getP1().moveBy(dx, dy);
	getP2().moveBy(dx, dy);
    }
}