Added Description for each step

This commit is contained in:
i23007 2024-07-07 14:02:19 +02:00
parent e2c2038531
commit 6060796ddd
9 changed files with 87 additions and 41 deletions

View File

@ -6,10 +6,14 @@
<component name="ChangeListManager">
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="LegendArea gestaltet">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurLegendArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurLegendArea.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurParameterArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurParameterArea.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurApplication.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurApplication.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurLegendArea.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurLegendArea.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurLogElement.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurLogElement.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurTextArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurTextArea.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/graph/DirectedGraph.java" beforeDir="false" afterPath="$PROJECT_DIR$/graph/DirectedGraph.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurLogElement.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurLogElement.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurParameterArea.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurParameterArea.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurTextArea.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurTextArea.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/graph/DirectedGraph.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/graph/DirectedGraph.class" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -34,17 +38,17 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"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"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;Application.Display.executor&quot;: &quot;Run&quot;,
&quot;Application.OurApplication.executor&quot;: &quot;Debug&quot;,
&quot;Application.OurLegendArea.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;C:/Git/ProjektGraphMain&quot;
}
}]]></component>
}</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Git\ProjektGraph" />
@ -173,7 +177,7 @@
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/OurApplication/OurApplication.java</url>
<line>49</line>
<option name="timeStamp" value="1" />
<option name="timeStamp" value="2" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -228,11 +228,15 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> 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<T extends VertexMarking, U extends EdgeMarking> 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<T extends VertexMarking, U extends EdgeMarking> 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<T extends VertexMarking, U extends EdgeMarking> 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<T extends VertexMarking, U extends EdgeMarking> 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<T extends VertexMarking, U extends EdgeMarking> 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));

View File

@ -4,7 +4,13 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="Beispiele überarbeitet" />
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="LegendArea gestaltet">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurLegendArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurLegendArea.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/OurApplication/OurParameterArea.java" beforeDir="false" afterPath="$PROJECT_DIR$/OurApplication/OurParameterArea.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurApplication.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurApplication.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurLegendArea.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/ProjektGraph/OurApplication/OurLegendArea.class" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -28,16 +34,17 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;Application.Display.executor&quot;: &quot;Run&quot;,
&quot;Application.OurApplication.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;C:/Git/ProjektGraphMain&quot;
<component name="PropertiesComponent"><![CDATA[{
"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"
}
}</component>
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Git\ProjektGraph" />
@ -128,7 +135,15 @@
<option name="project" value="LOCAL" />
<updated>1720311867957</updated>
</task>
<option name="localTasksCounter" value="10" />
<task id="LOCAL-00010" summary="LegendArea gestaltet">
<option name="closed" value="true" />
<created>1720347450647</created>
<option name="number" value="00010" />
<option name="presentableId" value="LOCAL-00010" />
<option name="project" value="LOCAL" />
<updated>1720347450647</updated>
</task>
<option name="localTasksCounter" value="11" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -149,6 +164,18 @@
<MESSAGE value="Tests with marking of Edges and Vertexes&#10;Adding Visualisation of Edge weight &#10;and Vertex name&#10;fixed AStar" />
<MESSAGE value="small fix" />
<MESSAGE value="Beispiele überarbeitet" />
<option name="LAST_COMMIT_MESSAGE" value="Beispiele überarbeitet" />
<MESSAGE value="LegendArea gestaltet" />
<option name="LAST_COMMIT_MESSAGE" value="LegendArea gestaltet" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/OurApplication/OurApplication.java</url>
<line>49</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>