diff --git a/u12/.classpath b/u12/.classpath
new file mode 100644
index 0000000..7a144eb
--- /dev/null
+++ b/u12/.classpath
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/u12/.gitignore b/u12/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/u12/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/u12/.project b/u12/.project
new file mode 100644
index 0000000..24c8433
--- /dev/null
+++ b/u12/.project
@@ -0,0 +1,17 @@
+
+
+ u12
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/u12/.settings/org.eclipse.jdt.core.prefs b/u12/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..8c9943d
--- /dev/null
+++ b/u12/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,14 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=17
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=17
diff --git a/u12/src/de/hsh/prog/klassedashedline/DashedLine.java b/u12/src/de/hsh/prog/klassedashedline/DashedLine.java
new file mode 100644
index 0000000..1818605
--- /dev/null
+++ b/u12/src/de/hsh/prog/klassedashedline/DashedLine.java
@@ -0,0 +1,79 @@
+package de.hsh.prog.klassedashedline;
+
+import java.awt.Graphics;
+import java.util.Arrays;
+
+/**
+ * Klasse zum speichern und Zeichnen einer gestrichelten Linie
+ * @author p8q-yhw-u1
+ *
+ */
+public class DashedLine extends Line {
+
+ private int[] dashes;
+
+ /**
+ * Erstellt ein DashedLine Objekt
+ * @param l1 Startpunkt der Linie
+ * @param l2 Endpunkt der Linie
+ * @param dashes Zeichenmuster, ein Integer Array von Pixel-Längen.
+ * Geradzahlige Indexe => Strich, Ungradzahlige Indexe => Lücke
+ */
+ public DashedLine(Loc l1, Loc l2, int[] dashes) {
+ super(l1, l2);
+
+ if (dashes.length <= 0) {
+ throw new IllegalArgumentException("dashes muss mindestens ein Element enthalten");
+ }
+
+ this.dashes = dashes;
+ }
+
+ /**
+ * Zeichnet die gestrichelt Linie mit einem Graphics Objekt
+ */
+ @Override
+ public void draw(Graphics g) {
+ double x = this.getP1().getX();
+ double y = this.getP1().getY();
+
+ double totalLen = this.getP1().distance(this.getP2());
+
+ double dx = this.getP2().getX() - x;
+ double dy = this.getP2().getY() - y;
+
+ double currLen = 0;
+ int currDash = 0;
+
+ while (currLen < totalLen) {
+
+ double dashLen = dashes[currDash];
+
+ if (dashLen + currLen > totalLen) {
+ dashLen = totalLen - currLen;
+ }
+
+ double nextx = x + dx * dashLen / totalLen;
+ double nexty = y + dy * dashLen / totalLen;
+
+ if (currDash % 2 == 0) {
+ new Line((int) x, (int) y, (int) nextx, (int) nexty).draw(g);
+ }
+
+ x = nextx;
+ y = nexty;
+
+ currLen += dashLen;
+ currDash = (currDash + 1) % this.dashes.length;
+ }
+ }
+
+ /**
+ * Gibt die Linie in String-Form aus
+ */
+ @Override
+ public String toString() {
+ return "[" + super.toString() + ", dashes=" + Arrays.toString(dashes) + "]";
+ }
+
+}