diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 74f9b11..a0be32b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,10 +6,14 @@ - - - - + + + + + + + + - { + "keyToString": { + "Application.Display.executor": "Run", + "Application.OurApplication.executor": "Debug", + "Application.OurLegendArea.executor": "Run", + "RunOnceActivity.ShowReadmeOnStart": "true", + "git-widget-placeholder": "main", + "kotlin-language-version-configured": "true", + "last_opened_file_path": "C:/Git/ProjektGraphMain" } -}]]> +} @@ -173,7 +177,7 @@ file://$PROJECT_DIR$/OurApplication/OurApplication.java 49 - diff --git a/OurApplication/OurLogElement.java b/OurApplication/OurLogElement.java index 4248d14..d85d6d9 100644 --- a/OurApplication/OurLogElement.java +++ b/OurApplication/OurLogElement.java @@ -40,19 +40,19 @@ public class OurLogElement extends LogElement{ * @param description the log element's step description * @param value the log element's sum up value */ - public OurLogElement(int step, String description, long value, Vertex v){ + public OurLogElement(int step, String description, long value, Vertex vertex){ this.step = step; this.description = description; this.value = value; - this.vertex = v; + this.vertex = vertex; } - public OurLogElement(int step, String description, long value, Edge e){ + public OurLogElement(int step, String description, long value, Edge edge){ this.step = step; this.description = description; this.value = value; - this.edge = e; + this.edge = edge; } diff --git a/OurApplication/OurTextArea.java b/OurApplication/OurTextArea.java index 1e1e077..d303df4 100644 --- a/OurApplication/OurTextArea.java +++ b/OurApplication/OurTextArea.java @@ -1,5 +1,6 @@ package OurApplication; +import logging.LogElement; import logging.LogElementList; import visualisation.TextArea; @@ -36,6 +37,8 @@ public class OurTextArea extends TextArea{ * No output. */ public boolean print(){ + LogElement logElement=(LogElement)logList.get(); + setText(logElement.getDescription()); return true; } } diff --git a/graph/DirectedGraph.java b/graph/DirectedGraph.java index 4290283..5846aac 100644 --- a/graph/DirectedGraph.java +++ b/graph/DirectedGraph.java @@ -228,11 +228,15 @@ public class DirectedGraph exten int dist = 0; // Zähler für LogList int step = 0; + // String für den Description Inhalt + String textDescription; // Färben der Start und Ziel Knoten für Visualisierung + hinzufügen zur LogList n1.getScreenVertex().setColor(Color.RED); n2.getScreenVertex().setColor(Color.RED); - this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy())); + textDescription = "Startknoten: " + n1.getScreenVertex().getMarking() + + ", Endknoten: " + n2.getScreenVertex().getMarking(); + this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy())); while (!queue.isEmpty()) { // Den nächsten Knoten, der am wenigsten kostet, besuchen @@ -243,9 +247,10 @@ public class DirectedGraph exten // Logging - System.out.println("Visit " + nextVertex.getElement().getName()); + textDescription = "Visit " + nextVertex.getElement().getName(); + System.out.println(textDescription); nextVertex.getElement().getScreenVertex().setColor(Color.BLUE); - this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy())); + this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy())); // Gehe von diesem Knoten aus alle erreichbaren Knoten durch @@ -270,9 +275,10 @@ public class DirectedGraph exten distance.put(i, dist); // Logging - System.out.println("Add " + i.getName() + " with " + dist + " weight to queue."); + textDescription = "Add " + i.getName() + " with " + dist + " weight to queue."; + System.out.println(textDescription); i.getScreenVertex().setColor(Color.YELLOW); - this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy())); + this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy())); // Nehme nächsten Knoten in die Queue auf queue.add(new WrapperElement<>(i, dist)); @@ -318,11 +324,15 @@ public class DirectedGraph exten int distToFinish = 0; // Zähler für LogList int step = 0; + // String für den Description Inhalt + String textDescription; // Färben der Start und Ziel Knoten für Visualisierung + hinzufügen zur LogList n1.getScreenVertex().setColor(Color.RED); n2.getScreenVertex().setColor(Color.RED); - this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy())); + textDescription = "Startknoten: " + n1.getScreenVertex().getMarking() + + ", Endknoten: " + n2.getScreenVertex().getMarking(); + this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy())); while (!queue.isEmpty()) { // Den nächsten Knoten, der am wenigsten kostet, besuchen @@ -333,9 +343,10 @@ public class DirectedGraph exten // Logging - System.out.println("Visit " + nextVertex.getElement().getName()); + textDescription = "Visit " + nextVertex.getElement().getName(); + System.out.println(textDescription); nextVertex.getElement().getScreenVertex().setColor(Color.BLUE); - this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy())); + this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy())); // Gehe von diesem Knoten aus alle erreichbaren Knoten durch @@ -365,9 +376,10 @@ public class DirectedGraph exten distance.put(i, dist); // Logging - System.out.println("Add " + i.getName() + " with " + dist + " weight to queue."); + textDescription = "Add " + i.getName() + " with " + dist + " weight to queue."; + System.out.println(textDescription); i.getScreenVertex().setColor(Color.YELLOW); - this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy())); + this.logList.add(new OurLogElement(step, textDescription, 0, this.getScreenGraphCopy())); // Nehme nächsten Knoten in die Queue auf queue.add(new WrapperElement<>(i, distToFinish)); diff --git a/out/production/ProjektGraph/.idea/workspace.xml b/out/production/ProjektGraph/.idea/workspace.xml index 0fa9420..74f9b11 100644 --- a/out/production/ProjektGraph/.idea/workspace.xml +++ b/out/production/ProjektGraph/.idea/workspace.xml @@ -4,7 +4,13 @@ - + + + + + + + - { - "keyToString": { - "Application.Display.executor": "Run", - "Application.OurApplication.executor": "Run", - "RunOnceActivity.ShowReadmeOnStart": "true", - "git-widget-placeholder": "main", - "kotlin-language-version-configured": "true", - "last_opened_file_path": "C:/Git/ProjektGraphMain" + +}]]> @@ -128,7 +135,15 @@ @@ -149,6 +164,18 @@ - + + + + + file://$PROJECT_DIR$/OurApplication/OurApplication.java + 49 + + + \ No newline at end of file diff --git a/out/production/ProjektGraph/OurApplication/OurLogElement.class b/out/production/ProjektGraph/OurApplication/OurLogElement.class index 8312e76..f6df8aa 100644 Binary files a/out/production/ProjektGraph/OurApplication/OurLogElement.class and b/out/production/ProjektGraph/OurApplication/OurLogElement.class differ diff --git a/out/production/ProjektGraph/OurApplication/OurParameterArea.class b/out/production/ProjektGraph/OurApplication/OurParameterArea.class index 755d517..9307c16 100644 Binary files a/out/production/ProjektGraph/OurApplication/OurParameterArea.class and b/out/production/ProjektGraph/OurApplication/OurParameterArea.class differ diff --git a/out/production/ProjektGraph/OurApplication/OurTextArea.class b/out/production/ProjektGraph/OurApplication/OurTextArea.class index 5ef8543..baff098 100644 Binary files a/out/production/ProjektGraph/OurApplication/OurTextArea.class and b/out/production/ProjektGraph/OurApplication/OurTextArea.class differ diff --git a/out/production/ProjektGraph/graph/DirectedGraph.class b/out/production/ProjektGraph/graph/DirectedGraph.class index ae72cfa..22f8dc8 100644 Binary files a/out/production/ProjektGraph/graph/DirectedGraph.class and b/out/production/ProjektGraph/graph/DirectedGraph.class differ