From 84e220b332bfffb0f2dcc39b9697a6fd6691d265 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Mon, 25 Apr 2022 18:36:30 +0200 Subject: Initial commit --- src/aufgaben/b20160604/Aufgabe1.java | 109 +++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100755 src/aufgaben/b20160604/Aufgabe1.java (limited to 'src/aufgaben/b20160604/Aufgabe1.java') diff --git a/src/aufgaben/b20160604/Aufgabe1.java b/src/aufgaben/b20160604/Aufgabe1.java new file mode 100755 index 0000000..9574334 --- /dev/null +++ b/src/aufgaben/b20160604/Aufgabe1.java @@ -0,0 +1,109 @@ +package aufgaben.b20160604; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import function.Display; +import function.Grade1; +import function.Grade2; +import function.Sin; +import function.SquareRoot; +import misc.Utils; +import aufgaben.Aufgabe; +import aufgaben.blatt2.Objekt; + +public class Aufgabe1 extends Aufgabe implements Runnable { + + private final int width = 500, height = 500; + private volatile boolean done; + private String name; + private Display wasser, boot, segel; + private Display[] regenbogen; + + public Aufgabe1() { + name = "BV 2 - Aufgabe 1"; + done = false; + this.setSize(width, height); + this.setTitle(name); + this.addWindowListener( + new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + System.out.println("close"); + done = true; + } + } + ); + } + + @Override + public boolean done() { + return done; + } + + public void paint(Graphics g) { + wasser.draw(g); + boot.draw(g); + g.drawLine(250, 385, 350, 385); + g.drawLine(350, 385, 350, 415); + g.drawLine(300, 385, 300, 300); + segel.draw(g); + g.drawLine(300, 385, 330, 370); + g.drawOval(450, 0, 100, 100); + g.drawLine(400, 50, 450, 50); + g.drawLine(400, 60, 450, 60); + //ziel1 bei 475, 75 + g.drawLine(419, 100, 457, 75); + g.drawLine(426, 110, 464, 85); + for(int i = 0; i