Browse Source

Adds Settings Panel (without function)

Andreas T. Meyer-Berg 6 years ago
parent
commit
5735ddd9a5

+ 42 - 18
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/SettingsPopUp.java

@@ -1,20 +1,19 @@
 package de.tu_darmstadt.tk.SmartHomeNetworkSim.view.popups;
 
-import javax.swing.JFrame;
-
 import java.awt.BorderLayout;
-
-import javax.swing.JTabbedPane;
-import javax.swing.JPanel;
-
+import java.awt.Rectangle;
 import java.awt.Toolkit;
 
+import javax.swing.JCheckBox;
+import javax.swing.JFrame;
 import javax.swing.JLabel;
+import javax.swing.JPanel;
 import javax.swing.JSlider;
+import javax.swing.JTabbedPane;
+import javax.swing.SwingConstants;
 
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.Controller;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Model;
-import java.awt.Rectangle;
 
 /**
  * PopUp to display and edit the settings
@@ -44,20 +43,45 @@ public class SettingsPopUp extends JFrame {
 		lblVisualisationSize.setBounds(12, 13, 125, 16);
 		pVisualisation.add(lblVisualisationSize);
 		
-		JSlider slider = new JSlider();
-		slider.setPaintLabels(true);
-		slider.setPaintTicks(true);
-		slider.setMajorTickSpacing(18);
-		slider.setMaximum(110);
-		slider.setMinimum(2);
-		slider.setValue(controller.getDevice_visualization_radius());
-		slider.setBounds(135, 13, 280, 45);
-		pVisualisation.add(slider);
-		slider.addChangeListener(a -> {
-			controller.setDevice_visualization_radius(slider.getValue());
+		JLabel lblradiusInPixels = new JLabel("(Radius in pixels:)");
+		lblradiusInPixels.setHorizontalAlignment(SwingConstants.RIGHT);
+		lblradiusInPixels.setBounds(12, 43, 118, 16);
+		pVisualisation.add(lblradiusInPixels);
+		
+		JSlider sliderRadius = new JSlider();
+		sliderRadius.setPaintLabels(true);
+		sliderRadius.setPaintTicks(true);
+		sliderRadius.setMajorTickSpacing(18);
+		sliderRadius.setMaximum(110);
+		sliderRadius.setMinimum(2);
+		sliderRadius.setValue(controller.getDevice_visualization_radius());
+		sliderRadius.setBounds(135, 13, 280, 45);
+		pVisualisation.add(sliderRadius);
+		sliderRadius.addChangeListener(a -> {
+			controller.setDevice_visualization_radius(sliderRadius.getValue());
 			controller.notifyObservers();
 		});
 		
+		JCheckBox chckbxTerminatedConnections = new JCheckBox("Show terminated connections");
+		chckbxTerminatedConnections.setBounds(8, 67, 197, 25);
+		pVisualisation.add(chckbxTerminatedConnections);
+		
+		JCheckBox chckbxDeviceNames = new JCheckBox("Show SmartDevice names");
+		chckbxDeviceNames.setBounds(8, 127, 197, 25);
+		pVisualisation.add(chckbxDeviceNames);
+		
+		JCheckBox chckbxConnections = new JCheckBox("Show connections");
+		chckbxConnections.setBounds(237, 67, 182, 25);
+		pVisualisation.add(chckbxConnections);
+		
+		JCheckBox chckbxLinks = new JCheckBox("Show links");
+		chckbxLinks.setBounds(237, 97, 178, 25);
+		pVisualisation.add(chckbxLinks);
+		
+		JCheckBox chckbxSmartdevices = new JCheckBox("Show SmartDevices");
+		chckbxSmartdevices.setBounds(8, 97, 197, 25);
+		pVisualisation.add(chckbxSmartdevices);
+		
 		JPanel pImports = new JPanel();
 		tabbedPane.addTab("Imports", null, pImports, null);