diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index e86cc4b..74f9b11 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,12 @@
-
+
-
-
+
+
@@ -34,16 +34,17 @@
- {
- "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"
+
+}]]>
@@ -134,7 +135,15 @@
1720311867957
-
+
+
+ 1720347450647
+
+
+
+ 1720347450647
+
+
@@ -155,6 +164,18 @@
-
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/OurApplication/OurApplication.java
+ 49
+
+
+
+
\ No newline at end of file
diff --git a/OurApplication/OurApplication.java b/OurApplication/OurApplication.java
index 222ea6d..54d1d37 100644
--- a/OurApplication/OurApplication.java
+++ b/OurApplication/OurApplication.java
@@ -46,7 +46,7 @@ public class OurApplication {
ExampleGraphs temp = new ExampleGraphs();
myGraph = temp.example1();
-
+ //sean: Ich wollte erst hier dann das ausgewählte Beispiel reinhauen, jedoch wird das hier nur einmal am Anfang aufgerufen
System.out.println(myGraph.toString());
diff --git a/OurApplication/OurLegendArea.java b/OurApplication/OurLegendArea.java
index b2092b8..eb80246 100644
--- a/OurApplication/OurLegendArea.java
+++ b/OurApplication/OurLegendArea.java
@@ -66,15 +66,4 @@ public class OurLegendArea extends LegendArea{
g.drawLine(10, y + 10, 30, y + 10); // Zeichnet eine horizontale Linie
g.drawString("Kanten Markierung", 40, y + 15); // Zeichnet die Beschreibung neben der Linie
}
-
- public static void main(String[] args) {
- JFrame frame = new JFrame("Legend Area Example");
- OurLegendArea legendArea = new OurLegendArea();
-
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setSize(300, 250); // Angepasste Größe, um das neue Element aufzunehmen
- frame.add(legendArea.getScrollPane());
- frame.setVisible(true);
- }
-
}
\ No newline at end of file
diff --git a/OurApplication/OurParameterArea.java b/OurApplication/OurParameterArea.java
index faba790..42a865a 100644
--- a/OurApplication/OurParameterArea.java
+++ b/OurApplication/OurParameterArea.java
@@ -1,8 +1,15 @@
package OurApplication;
+import graph.DirectedGraph;
+import graph.EdgeMarking;
+import graph.ExampleGraphs;
+import graph.VertexMarking;
import visualisation.ParameterArea;
import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
/**
* This class provides an example for using visualization.ParameterArea.
@@ -14,7 +21,16 @@ import javax.swing.*;
public class OurParameterArea extends ParameterArea{
private static final long serialVersionUID = 1L;
-
+
+ private JRadioButton button1;
+ private JRadioButton button2;
+ private JRadioButton button3;
+ private JRadioButton button4;
+
+ private ExampleGraphs temp;
+ private int selectedExample;
+
+
/** TextField containing maximum sum up value. */
protected JTextField maxValue;
@@ -24,8 +40,76 @@ public class OurParameterArea extends ParameterArea{
*/
public OurParameterArea() {
super();
+ temp = new ExampleGraphs();
+ selectedExample = 1; // Standardmäßig Beispiel 1
+
setBorder(BorderFactory.createTitledBorder("ParameterArea"));
- // Hier Elemente adden
+ // Layout-Manager setzen, um die Buttons vertikal anzuordnen
+ setLayout(new GridLayout(4, 1, 5, 5)); // 4 Zeilen, 1 Spalte, 5 Pixel Abstand
+
+ // Buttons erstellen
+ button1 = new JRadioButton("Beispiel 1", true);
+ button2 = new JRadioButton("Beispiel 2");
+ button3 = new JRadioButton("Beispiel 3");
+ button4 = new JRadioButton("Beispiel 4");
+
+ // ButtonGroup erstellen und Buttons hinzufügen, um die gegenseitige Ausschließung zu gewährleisten
+ ButtonGroup group = new ButtonGroup();
+ group.add(button1);
+ group.add(button2);
+ group.add(button3);
+ group.add(button4);
+
+ // ActionListener hinzufügen
+ button1.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ selectedExample = 1;
+ }
+ });
+
+ button2.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ selectedExample = 2;
+ }
+ });
+
+ button3.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ selectedExample = 3;
+ }
+ });
+
+ button4.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ selectedExample = 4;
+ }
+ });
+
+ // Buttons zum Panel hinzufügen
+ add(button1);
+ add(button2);
+ add(button3);
+ add(button4);
}
+
+ public DirectedGraph getSelectedGraph() {
+ ExampleGraphs temp = new ExampleGraphs();
+ switch (selectedExample) {
+ case 2:
+ return temp.example2();
+ case 3:
+ return temp.example3();
+ case 4:
+ return temp.example4();
+ case 1:
+ default:
+ return temp.example1();
+ }
+ }
+
}
diff --git a/out/production/ProjektGraph/OurApplication/OurApplication.class b/out/production/ProjektGraph/OurApplication/OurApplication.class
index 5d799da..6e5851f 100644
Binary files a/out/production/ProjektGraph/OurApplication/OurApplication.class and b/out/production/ProjektGraph/OurApplication/OurApplication.class differ
diff --git a/out/production/ProjektGraph/OurApplication/OurLegendArea.class b/out/production/ProjektGraph/OurApplication/OurLegendArea.class
index c4a44cc..6f89ee5 100644
Binary files a/out/production/ProjektGraph/OurApplication/OurLegendArea.class and b/out/production/ProjektGraph/OurApplication/OurLegendArea.class differ