Compare commits
3 Commits
017bbe9307
...
79198f4f4a
Author | SHA1 | Date | |
---|---|---|---|
79198f4f4a | |||
7180d7951a | |||
b2c8b4f54f |
20
.idea/workspace.xml
generated
20
.idea/workspace.xml
generated
@ -5,7 +5,9 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="70f8ea87-9ffc-471a-8059-ebbfc323adcc" name="Changes" comment="Stable Version 3.0">
|
<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$/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>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@ -25,16 +27,16 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"Application.Display.executor": "Run",
|
"Application.Display.executor": "Run",
|
||||||
"Application.OurApplication.executor": "Run",
|
"Application.OurApplication.executor": "Run",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"git-widget-placeholder": "main",
|
"git-widget-placeholder": "main",
|
||||||
"kotlin-language-version-configured": "true",
|
"kotlin-language-version-configured": "true",
|
||||||
"last_opened_file_path": "C:/Git/ProjektGraphMain"
|
"last_opened_file_path": "C:/Git/ProjektGraphMain"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
<recent name="C:\Git\ProjektGraph" />
|
<recent name="C:\Git\ProjektGraph" />
|
||||||
|
@ -40,15 +40,29 @@ public class OurApplication {
|
|||||||
*/
|
*/
|
||||||
public static void main(String[]args){
|
public static void main(String[]args){
|
||||||
|
|
||||||
LogElementList<OurLogElement>logList = new LogElementList<OurLogElement>();
|
Random random = new Random();
|
||||||
|
|
||||||
|
DirectedGraph<VertexMarking, EdgeMarking> myGraph = new DirectedGraph<>();
|
||||||
|
|
||||||
|
ExampleGraphs temp = new ExampleGraphs();
|
||||||
|
myGraph = temp.example1();
|
||||||
|
|
||||||
|
System.out.println(myGraph.toString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OurParameterArea parameterArea = new OurParameterArea();
|
OurParameterArea parameterArea = new OurParameterArea();
|
||||||
OurDrawArea drawArea = new OurDrawArea(logList,"GraphVisualization");
|
OurDrawArea drawArea = new OurDrawArea(myGraph.getLogList(),"GraphVisualization");
|
||||||
OurTextArea textArea = new OurTextArea(logList);
|
OurTextArea textArea = new OurTextArea(myGraph.getLogList());
|
||||||
OurAlgorithm algorithm = new OurAlgorithm(parameterArea);
|
OurAlgorithm algorithm = new OurAlgorithm(parameterArea);
|
||||||
OurLegendArea legendArea = new OurLegendArea();
|
OurLegendArea legendArea = new OurLegendArea();
|
||||||
HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea> applet = new HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea>(drawArea, textArea, parameterArea, algorithm, logList, legendArea);
|
HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea> applet = new HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea>(drawArea, textArea, parameterArea, algorithm, myGraph.getLogList(), legendArea);
|
||||||
|
|
||||||
|
|
||||||
|
drawArea.setCurrentGraph(myGraph.getScreenGraph());
|
||||||
|
algorithm.setCurrentGraph(myGraph);
|
||||||
|
|
||||||
JFrame frame = new JFrame("Visualise");
|
JFrame frame = new JFrame("Visualise");
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
frame.getContentPane().add(applet);
|
frame.getContentPane().add(applet);
|
||||||
@ -59,9 +73,7 @@ public class OurApplication {
|
|||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
|
|
||||||
|
|
||||||
Random random = new Random();
|
|
||||||
|
|
||||||
DirectedGraph<VertexMarking, EdgeMarking> myGraph = new DirectedGraph<>();
|
|
||||||
|
|
||||||
/*for (int i = 0; i < 10; i++) {
|
/*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));
|
myGraph.addVertex(new MarkedVertex<>(random.nextInt(1, 10)*40, random.nextInt(1, 10)*40, Integer.toString(i), null, Color.BLACK));
|
||||||
@ -77,13 +89,6 @@ public class OurApplication {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ExampleGraphs temp = new ExampleGraphs();
|
|
||||||
myGraph = temp.example1();
|
|
||||||
|
|
||||||
System.out.println(myGraph.toString());
|
|
||||||
|
|
||||||
drawArea.setCurrentGraph(myGraph.getScreenGraph());
|
|
||||||
algorithm.setCurrentGraph(myGraph);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
|||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
System.out.println("Add " + i.getName() + " with " + dist + " weight to queue.");
|
System.out.println("Add " + i.getName() + " with " + dist + " weight to queue.");
|
||||||
nextVertex.getElement().getScreenVertex().setColor(Color.YELLOW);
|
i.getScreenVertex().setColor(Color.YELLOW);
|
||||||
this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy()));
|
this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy()));
|
||||||
|
|
||||||
// Nehme nächsten Knoten in die Queue auf
|
// Nehme nächsten Knoten in die Queue auf
|
||||||
@ -281,6 +281,9 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//zurücksetzten der Färbungen
|
||||||
|
this.clearScreenGraphColor();
|
||||||
|
|
||||||
System.out.println("Done");
|
System.out.println("Done");
|
||||||
// Gibt Distanz zu gefragtem Knoten zurück
|
// Gibt Distanz zu gefragtem Knoten zurück
|
||||||
return distance.get(n2);
|
return distance.get(n2);
|
||||||
@ -362,7 +365,7 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
|||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
System.out.println("Add " + i.getName() + " with " + dist + " weight to queue.");
|
System.out.println("Add " + i.getName() + " with " + dist + " weight to queue.");
|
||||||
nextVertex.getElement().getScreenVertex().setColor(Color.YELLOW);
|
i.getScreenVertex().setColor(Color.YELLOW);
|
||||||
this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy()));
|
this.logList.add(new OurLogElement(step, "Step: " + step, 0, this.getScreenGraphCopy()));
|
||||||
|
|
||||||
// Nehme nächsten Knoten in die Queue auf
|
// Nehme nächsten Knoten in die Queue auf
|
||||||
@ -370,8 +373,18 @@ public class DirectedGraph<T extends VertexMarking, U extends EdgeMarking> exten
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//zurücksetzten der Färbungen
|
||||||
|
this.clearScreenGraphColor();
|
||||||
|
|
||||||
System.out.println("Done");
|
System.out.println("Done");
|
||||||
// Gibt Distanz zu gefragtem Knoten zurück
|
// Gibt Distanz zu gefragtem Knoten zurück
|
||||||
return distance.get(n2);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user