diff options
Diffstat (limited to 'src/aufgaben/blatt1')
-rwxr-xr-x | src/aufgaben/blatt1/Aufgabe1.java | 58 | ||||
-rwxr-xr-x | src/aufgaben/blatt1/Aufgabe2a.java | 58 | ||||
-rwxr-xr-x | src/aufgaben/blatt1/Aufgabe2b40.java | 97 | ||||
-rwxr-xr-x | src/aufgaben/blatt1/Aufgabe2bEPIC.java | 97 | ||||
-rwxr-xr-x | src/aufgaben/blatt1/Aufgabe2c40.java | 58 | ||||
-rwxr-xr-x | src/aufgaben/blatt1/Aufgabe2c40UTF8.java | 58 | ||||
-rwxr-xr-x | src/aufgaben/blatt1/Aufgabe2cEPIC.java | 58 | ||||
-rwxr-xr-x | src/aufgaben/blatt1/Aufgabe2cEPICUTF8.java | 58 |
8 files changed, 542 insertions, 0 deletions
diff --git a/src/aufgaben/blatt1/Aufgabe1.java b/src/aufgaben/blatt1/Aufgabe1.java new file mode 100755 index 0000000..dbd29a6 --- /dev/null +++ b/src/aufgaben/blatt1/Aufgabe1.java @@ -0,0 +1,58 @@ +package aufgaben.blatt1;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import aufgaben.Aufgabe;
+import misc.Utils;
+
+public class Aufgabe1 extends Aufgabe {
+
+ private final int width = 500, height = 500;
+ private boolean done = false;
+ private String name;
+
+ public Aufgabe1() {
+ name = "Blatt 1 - Aufgabe 1";
+ this.setSize(width, height);
+ this.setTitle("Blatt 1 - Aufgabe 1");
+ 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) {
+ int x, y;
+ for(int i = 0; i<40; i++) {
+ x = Utils.randomInt(0, width);
+ y = Utils.randomInt(0, height);
+ g.drawRect(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y));
+ g.setColor(new Color(Utils.randomInt(0, 255), Utils.randomInt(0, 255), Utils.randomInt(0, 255)));
+ }
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/aufgaben/blatt1/Aufgabe2a.java b/src/aufgaben/blatt1/Aufgabe2a.java new file mode 100755 index 0000000..ced5ee8 --- /dev/null +++ b/src/aufgaben/blatt1/Aufgabe2a.java @@ -0,0 +1,58 @@ +package aufgaben.blatt1;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import aufgaben.Aufgabe;
+import misc.Utils;
+
+public class Aufgabe2a extends Aufgabe {
+
+ private final int width = 500, height = 500;
+ private boolean done = false;
+ private String name;
+
+ public Aufgabe2a() {
+ name = "Blatt 1 - 2a";
+ this.setSize(width, height);
+ this.setTitle("Blatt 1 - Aufgabe 2a");
+ 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) {
+ int x, y;
+ for(int i = 0; i<40; i++) {
+ x = Utils.randomInt(0, width);
+ y = Utils.randomInt(0, height);
+ g.fillArc(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y), Utils.randomInt(0, 360), Utils.randomInt(0, 360));
+ g.setColor(new Color(Utils.randomInt(0, 255), Utils.randomInt(0, 255), Utils.randomInt(0, 255)));
+ }
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/aufgaben/blatt1/Aufgabe2b40.java b/src/aufgaben/blatt1/Aufgabe2b40.java new file mode 100755 index 0000000..55e9f57 --- /dev/null +++ b/src/aufgaben/blatt1/Aufgabe2b40.java @@ -0,0 +1,97 @@ +package aufgaben.blatt1;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Polygon;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import aufgaben.Aufgabe;
+import misc.Utils;
+
+public class Aufgabe2b40 extends Aufgabe {
+
+ private final int width = 500, height = 500;
+ private boolean done = false;
+ private String name;
+
+ public Aufgabe2b40() {
+ name = "Blatt 1 - 2b40";
+ this.setSize(width, height);
+ this.setTitle("Blatt 1 - Aufgabe 2b - 40 Objekte");
+ 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) {
+ int x, y;
+ for(int i = 0; i<40; i++) {
+ x = Utils.randomInt(0, width);
+ y = Utils.randomInt(0, height);
+ switch(Utils.randomInt(0, 8)) {
+ case 0:
+ g.drawRect(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y));
+ break;
+ case 1:
+ g.fillRect(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y));
+ break;
+ case 2:
+ g.drawArc(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y), Utils.randomInt(0, 360), Utils.randomInt(0, 360));
+ break;
+ case 3:
+ g.fillArc(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y), Utils.randomInt(0, 360), Utils.randomInt(0, 360));
+ break;
+ case 4:
+ g.drawOval(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y));
+ break;
+ case 5:
+ g.fillOval(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y));
+ break;
+ case 6:
+ g.drawPolygon(getPolygon());
+ break;
+ case 7:
+ g.fillPolygon(getPolygon());
+ break;
+ case 8:
+ g.drawLine(Utils.randomInt(0, width), Utils.randomInt(0, height), Utils.randomInt(0, width), Utils.randomInt(0, height));
+ break;
+ }
+ g.setColor(new Color(Utils.randomInt(0, 255), Utils.randomInt(0, 255), Utils.randomInt(0, 255)));
+ }
+ }
+
+ private Polygon getPolygon() {
+ int bla = Utils.randomInt(1, 100);
+ int[] x = new int[bla], y = new int[bla];
+ for(int i = 0; i<bla; i++) {
+ x[i] = Utils.randomInt(0, width);
+ y[i] = Utils.randomInt(0, height);
+ }
+ return new Polygon(x, y, bla);
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/aufgaben/blatt1/Aufgabe2bEPIC.java b/src/aufgaben/blatt1/Aufgabe2bEPIC.java new file mode 100755 index 0000000..aa8596a --- /dev/null +++ b/src/aufgaben/blatt1/Aufgabe2bEPIC.java @@ -0,0 +1,97 @@ +package aufgaben.blatt1;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Polygon;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import aufgaben.Aufgabe;
+import misc.Utils;
+
+public class Aufgabe2bEPIC extends Aufgabe {
+
+ private final int width = 1920, height = 1080;
+ private boolean done = false;
+ private String name;
+
+ public Aufgabe2bEPIC() {
+ name = "Blatt 1 - 2bEPIC";
+ this.setSize(width, height);
+ this.setTitle("Blatt 1 - Aufgabe 2b - Unendlich Objekte");
+ 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) {
+ int x, y;
+ while(true) {
+ x = Utils.randomInt(0, width);
+ y = Utils.randomInt(0, height);
+ switch(Utils.randomInt(0, 8)) {
+ case 0:
+ g.drawRect(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y));
+ break;
+ case 1:
+ g.fillRect(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y));
+ break;
+ case 2:
+ g.drawArc(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y), Utils.randomInt(0, 360), Utils.randomInt(0, 360));
+ break;
+ case 3:
+ g.fillArc(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y), Utils.randomInt(0, 360), Utils.randomInt(0, 360));
+ break;
+ case 4:
+ g.drawOval(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y));
+ break;
+ case 5:
+ g.fillOval(x, y, Utils.randomInt(0, width-x), Utils.randomInt(0, height-y));
+ break;
+ case 6:
+ g.drawPolygon(getPolygon());
+ break;
+ case 7:
+ g.fillPolygon(getPolygon());
+ break;
+ case 8:
+ g.drawLine(Utils.randomInt(0, width), Utils.randomInt(0, height), Utils.randomInt(0, width), Utils.randomInt(0, height));
+ break;
+ }
+ g.setColor(new Color(Utils.randomInt(0, 255), Utils.randomInt(0, 255), Utils.randomInt(0, 255)));
+ }
+ }
+
+ private Polygon getPolygon() {
+ int bla = Utils.randomInt(1, 100);
+ int[] x = new int[bla], y = new int[bla];
+ for(int i = 0; i<bla; i++) {
+ x[i] = Utils.randomInt(0, width);
+ y[i] = Utils.randomInt(0, height);
+ }
+ return new Polygon(x, y, bla);
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/aufgaben/blatt1/Aufgabe2c40.java b/src/aufgaben/blatt1/Aufgabe2c40.java new file mode 100755 index 0000000..144b2ab --- /dev/null +++ b/src/aufgaben/blatt1/Aufgabe2c40.java @@ -0,0 +1,58 @@ +package aufgaben.blatt1;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import aufgaben.Aufgabe;
+import misc.Utils;
+
+public class Aufgabe2c40 extends Aufgabe {
+
+ private final int width = 500, height = 500;
+ private boolean done = false;
+ private String name;
+
+ public Aufgabe2c40() {
+ name = "Blatt 1 - 2c40";
+ this.setSize(width, height);
+ this.setTitle("Blatt 1 - Aufgabe 2c - 40 Strings, alphanumerisch");
+ 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) {
+ int x, y;
+ for(int i = 0; i<40; i++) {
+ x = Utils.randomInt(0, width);
+ y = Utils.randomInt(0, height);
+ g.drawString(Utils.randomStringAN(Utils.randomInt(0, 100)), x, y);
+ g.setColor(new Color(Utils.randomInt(0, 255), Utils.randomInt(0, 255), Utils.randomInt(0, 255)));
+ }
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/aufgaben/blatt1/Aufgabe2c40UTF8.java b/src/aufgaben/blatt1/Aufgabe2c40UTF8.java new file mode 100755 index 0000000..598ed86 --- /dev/null +++ b/src/aufgaben/blatt1/Aufgabe2c40UTF8.java @@ -0,0 +1,58 @@ +package aufgaben.blatt1;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import aufgaben.Aufgabe;
+import misc.Utils;
+
+public class Aufgabe2c40UTF8 extends Aufgabe {
+
+ private final int width = 500, height = 500;
+ private boolean done = false;
+ private String name;
+
+ public Aufgabe2c40UTF8() {
+ name = "Blatt 1 - 2c40UTF8";
+ this.setSize(width, height);
+ this.setTitle("Blatt 1 - Aufgabe 2c - 40 Strings, UTF8");
+ 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) {
+ int x, y;
+ for(int i = 0; i<40; i++) {
+ x = Utils.randomInt(0, width);
+ y = Utils.randomInt(0, height);
+ g.drawString(Utils.randomStringUTF8(Utils.randomInt(0, 100)), x, y);
+ g.setColor(new Color(Utils.randomInt(0, 255), Utils.randomInt(0, 255), Utils.randomInt(0, 255)));
+ }
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/aufgaben/blatt1/Aufgabe2cEPIC.java b/src/aufgaben/blatt1/Aufgabe2cEPIC.java new file mode 100755 index 0000000..48a3f72 --- /dev/null +++ b/src/aufgaben/blatt1/Aufgabe2cEPIC.java @@ -0,0 +1,58 @@ +package aufgaben.blatt1;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import aufgaben.Aufgabe;
+import misc.Utils;
+
+public class Aufgabe2cEPIC extends Aufgabe {
+
+ private final int width = 500, height = 500;
+ private boolean done = false;
+ private String name;
+
+ public Aufgabe2cEPIC() {
+ name = "Blatt 1 - 2cEPIC";
+ this.setSize(width, height);
+ this.setTitle("Blatt 1 - Aufgabe 2c - Unendlich Strings, alphanumerisch");
+ 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) {
+ int x, y;
+ while(true) {
+ x = Utils.randomInt(0, width);
+ y = Utils.randomInt(0, height);
+ g.drawString(Utils.randomStringAN(Utils.randomInt(0, 100)), x, y);
+ g.setColor(new Color(Utils.randomInt(0, 255), Utils.randomInt(0, 255), Utils.randomInt(0, 255)));
+ }
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/aufgaben/blatt1/Aufgabe2cEPICUTF8.java b/src/aufgaben/blatt1/Aufgabe2cEPICUTF8.java new file mode 100755 index 0000000..b6db746 --- /dev/null +++ b/src/aufgaben/blatt1/Aufgabe2cEPICUTF8.java @@ -0,0 +1,58 @@ +package aufgaben.blatt1;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import aufgaben.Aufgabe;
+import misc.Utils;
+
+public class Aufgabe2cEPICUTF8 extends Aufgabe {
+
+ private final int width = 100, height = 100;
+ private boolean done = false;
+ private String name;
+
+ public Aufgabe2cEPICUTF8() {
+ name = "Blatt 1 - 2cEPICUTF8";
+ this.setSize(width, height);
+ this.setTitle("Blatt 1 - Aufgabe 2c - Unendlich Strings, UTF8");
+ 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 ) {
+ int x, y;
+ while(true) {
+ x = Utils.randomInt(0, width);
+ y = Utils.randomInt(0, height);
+ g.drawString(Utils.randomStringUTF8(Utils.randomInt(0, 100)), x, y);
+ g.setColor(new Color(Utils.randomInt(0, 255), Utils.randomInt(0, 255), Utils.randomInt(0, 255)));
+ }
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
|