diff options
Diffstat (limited to 'ws2015/eip/blaetter/06/Test.java')
-rw-r--r-- | ws2015/eip/blaetter/06/Test.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ws2015/eip/blaetter/06/Test.java b/ws2015/eip/blaetter/06/Test.java new file mode 100644 index 0000000..c8232a2 --- /dev/null +++ b/ws2015/eip/blaetter/06/Test.java | |||
@@ -0,0 +1,40 @@ | |||
1 | import gameoflifetest.GraphicsWindow; | ||
2 | |||
3 | class Test { | ||
4 | public static void main (String[] args) | ||
5 | { | ||
6 | GraphicsWindow gw = new GraphicsWindow(); | ||
7 | |||
8 | Position[] points = { new Position(10, 10) | ||
9 | , new Position(20, 10) | ||
10 | , new Position(30, 10) | ||
11 | , new Position(30, 20) | ||
12 | , new Position(20, 20) | ||
13 | , new Position(10, 20) | ||
14 | }; | ||
15 | |||
16 | Polygon p = new Polygon(points); | ||
17 | |||
18 | p.zeichneDich(gw); | ||
19 | gw.mouseClick(); | ||
20 | |||
21 | p = p.translate(10, 10); | ||
22 | gw.clear(); | ||
23 | p.zeichneDich(gw); | ||
24 | gw.mouseClick(); | ||
25 | |||
26 | p = p.erweitere(new Position(5, 20)); | ||
27 | gw.clear(); | ||
28 | p.zeichneDich(gw); | ||
29 | gw.mouseClick(); | ||
30 | |||
31 | p = p.reduziere(2); | ||
32 | gw.clear(); | ||
33 | p.zeichneDich(gw); | ||
34 | gw.mouseClick(); | ||
35 | |||
36 | System.out.format("%.2f\n", p.berechneFlaeche()); | ||
37 | |||
38 | System.exit(0); | ||
39 | } | ||
40 | } | ||