Compare commits

..

No commits in common. "79198f4f4a018831abad20c791aa6a0305dbc47a" and "017bbe93071a72894576affc3248368615fc7ab8" have entirely different histories.

5 changed files with 24 additions and 44 deletions

20
.idea/workspace.xml generated
View File

@ -5,9 +5,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="Stable Version 3.0">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/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" />
@ -27,16 +25,16 @@
<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": "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" />

View File

@ -40,29 +40,15 @@ public class OurApplication {
*/
public static void main(String[]args){
Random random = new Random();
DirectedGraph<VertexMarking, EdgeMarking> myGraph = new DirectedGraph<>();
ExampleGraphs temp = new ExampleGraphs();
myGraph = temp.example1();
System.out.println(myGraph.toString());
LogElementList<OurLogElement>logList = new LogElementList<OurLogElement>();
OurParameterArea parameterArea = new OurParameterArea();
OurDrawArea drawArea = new OurDrawArea(myGraph.getLogList(),"GraphVisualization");
OurTextArea textArea = new OurTextArea(myGraph.getLogList());
OurDrawArea drawArea = new OurDrawArea(logList,"GraphVisualization");
OurTextArea textArea = new OurTextArea(logList);
OurAlgorithm algorithm = new OurAlgorithm(parameterArea);
OurLegendArea legendArea = new OurLegendArea();
HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea> applet = new HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea>(drawArea, textArea, parameterArea, algorithm, myGraph.getLogList(), legendArea);
HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea> applet = new HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea>(drawArea, textArea, parameterArea, algorithm, logList, legendArea);
drawArea.setCurrentGraph(myGraph.getScreenGraph());
algorithm.setCurrentGraph(myGraph);
JFrame frame = new JFrame("Visualise");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(applet);
@ -73,7 +59,9 @@ public class OurApplication {
frame.setVisible(true);
Random random = new Random();
DirectedGraph<VertexMarking, EdgeMarking> myGraph = new DirectedGraph<>();
/*for (int i = 0; i < 10; i++) {
myGraph.addVertex(new MarkedVertex<>(random.nextInt(1, 10)*40, random.nextInt(1, 10)*40, Integer.toString(i), null, Color.BLACK));
@ -89,6 +77,13 @@ public class OurApplication {
*/
ExampleGraphs temp = new ExampleGraphs();
myGraph = temp.example1();
System.out.println(myGraph.toString());
drawArea.setCurrentGraph(myGraph.getScreenGraph());
algorithm.setCurrentGraph(myGraph);
}

View File

@ -273,7 +273,7 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
// Logging
System.out.println("Add " + i.getName() + " with " + dist + " weight to queue.");
i.getScreenVertex().setColor(Color.YELLOW);
nextVertex.getElement().getScreenVertex().setColor(Color.YELLOW);
this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy()));
// Nehme nächsten Knoten in die Queue auf
@ -281,9 +281,6 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
}
}
//zurücksetzten der Färbungen
this.clearScreenGraphColor();
System.out.println("Done");
// Gibt Distanz zu gefragtem Knoten zurück
return distance.get(n2);
@ -365,7 +362,7 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
// Logging
System.out.println("Add " + i.getName() + " with " + dist + " weight to queue.");
i.getScreenVertex().setColor(Color.YELLOW);
nextVertex.getElement().getScreenVertex().setColor(Color.YELLOW);
this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy()));
// Nehme nächsten Knoten in die Queue auf
@ -373,18 +370,8 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
}
}
//zurücksetzten der Färbungen
this.clearScreenGraphColor();
System.out.println("Done");
// Gibt Distanz zu gefragtem Knoten zurück
return distance.get(n2);
}
// Methode für das Zurücksetzten der Knotenfarben
public void clearScreenGraphColor(){
for(visualizationElements.Vertex screenVertexes : this.getScreenGraph().getVertexes()){
screenVertexes.setColor(Color.BLACK);
}
}
}