diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-11-26 07:21:47 +0000 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-11-26 07:21:47 +0000 |
| commit | da7761a4269b0f0d277be02fa1b5cc82e35295f4 (patch) | |
| tree | 98e8ec04ad802867edb3865af937fd364ad283d9 /ws2015/eip/blaetter/06/Test.java | |
| parent | cde46f1dd104e3f214272a5cf33e389ac74096c1 (diff) | |
| download | uni-da7761a4269b0f0d277be02fa1b5cc82e35295f4.tar uni-da7761a4269b0f0d277be02fa1b5cc82e35295f4.tar.gz uni-da7761a4269b0f0d277be02fa1b5cc82e35295f4.tar.bz2 uni-da7761a4269b0f0d277be02fa1b5cc82e35295f4.tar.xz uni-da7761a4269b0f0d277be02fa1b5cc82e35295f4.zip | |
EiP H6-1
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 | } | ||
