|
@@ -46,7 +46,7 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
* controller which should manipulate the model
|
|
|
*/
|
|
|
public SettingsPopUp(Controller controller) {
|
|
|
- setBounds(new Rectangle(0, 0, 450, 300));
|
|
|
+ setBounds(new Rectangle(0, 0, 470, 360));
|
|
|
this.controller = controller;
|
|
|
this.config = this.controller.getSettingsController();
|
|
|
this.that = this;
|
|
@@ -66,6 +66,7 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
|
|
|
JLabel lblVisualisationSize = new JLabel("Visualization Radius:");
|
|
|
lblVisualisationSize.setBounds(10, 10, 150, 20);
|
|
|
+ lblVisualisationSize.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblVisualisationSize
|
|
|
.setToolTipText("<html>Radius of the SmartDevice Visualization, which is half of the Device width.</html>");
|
|
|
pVisualisation.add(lblVisualisationSize);
|
|
@@ -87,10 +88,35 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
config.setDeviceVisualizationRadius(sliderRadius.getValue());
|
|
|
controller.notifyObservers();
|
|
|
});
|
|
|
+
|
|
|
+ JLabel lblLinkSize = new JLabel("Link dimension:");
|
|
|
+ lblLinkSize.setBounds(10, 60, 150, 20);
|
|
|
+ lblLinkSize
|
|
|
+ .setToolTipText("<html>Dimenions of the Link visualization around SmartDevices.</html>");
|
|
|
+ lblLinkSize.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
+ pVisualisation.add(lblLinkSize);
|
|
|
+
|
|
|
+ JLabel lblDimInPixels = new JLabel("(Dimension in pixels:)");
|
|
|
+ lblDimInPixels.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
+ lblDimInPixels.setBounds(10, 80, 150, 20);
|
|
|
+ pVisualisation.add(lblDimInPixels);
|
|
|
+
|
|
|
+ sliderLinkRadius = new JSlider();
|
|
|
+ sliderLinkRadius.setPaintLabels(true);
|
|
|
+ sliderLinkRadius.setPaintTicks(true);
|
|
|
+ sliderLinkRadius.setMajorTickSpacing(18);
|
|
|
+ sliderLinkRadius.setMaximum(110);
|
|
|
+ sliderLinkRadius.setMinimum(2);
|
|
|
+ sliderLinkRadius.setBounds(160, 70, 280, 50);
|
|
|
+ pVisualisation.add(sliderLinkRadius);
|
|
|
+ sliderLinkRadius.addChangeListener(a -> {
|
|
|
+ config.setLinkRadius(sliderLinkRadius.getValue());
|
|
|
+ controller.notifyObservers();
|
|
|
+ });
|
|
|
|
|
|
chckbxTerminatedConnections = new JCheckBox(
|
|
|
"Show terminated connections");
|
|
|
- chckbxTerminatedConnections.setBounds(0, 70, 240, 25);
|
|
|
+ chckbxTerminatedConnections.setBounds(0, 150, 240, 25);
|
|
|
chckbxTerminatedConnections.addActionListener(a -> config
|
|
|
.setShowTerminatedConnections(chckbxTerminatedConnections
|
|
|
.isSelected()));
|
|
@@ -99,7 +125,7 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
pVisualisation.add(chckbxTerminatedConnections);
|
|
|
|
|
|
chckbxConnections = new JCheckBox("Show connections");
|
|
|
- chckbxConnections.setBounds(240, 70, 200, 25);
|
|
|
+ chckbxConnections.setBounds(240, 150, 200, 25);
|
|
|
chckbxConnections.addActionListener(a -> config
|
|
|
.setShowConnections(chckbxConnections.isSelected()));
|
|
|
chckbxConnections
|
|
@@ -107,7 +133,7 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
pVisualisation.add(chckbxConnections);
|
|
|
|
|
|
chckbxLinks = new JCheckBox("Show links");
|
|
|
- chckbxLinks.setBounds(240, 100, 200, 25);
|
|
|
+ chckbxLinks.setBounds(240, 180, 200, 25);
|
|
|
chckbxLinks.addActionListener(a -> config.setShowLinks(chckbxLinks
|
|
|
.isSelected()));
|
|
|
chckbxLinks
|
|
@@ -115,15 +141,23 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
pVisualisation.add(chckbxLinks);
|
|
|
|
|
|
chckbxLinkToolTips = new JCheckBox("Show link ToolTips");
|
|
|
- chckbxLinkToolTips.setBounds(240, 130, 200, 25);
|
|
|
+ chckbxLinkToolTips.setBounds(240, 210, 200, 25);
|
|
|
chckbxLinkToolTips.addActionListener(a -> config
|
|
|
.setShowLinkToolTips(chckbxLinkToolTips.isSelected()));
|
|
|
chckbxLinkToolTips
|
|
|
.setToolTipText("True if the link name should be shown on, when the mouse hovers over the link");
|
|
|
pVisualisation.add(chckbxLinkToolTips);
|
|
|
+
|
|
|
+ chckbxLinkNames = new JCheckBox("Show Link names as a list");
|
|
|
+ chckbxLinkNames.setBounds(240, 240, 200, 25);
|
|
|
+ chckbxLinkNames.addActionListener(a -> config
|
|
|
+ .setShowLinkNameList(chckbxLinkNames.isSelected()));
|
|
|
+ chckbxLinkNames
|
|
|
+ .setToolTipText("True if the link names should be shown in a list in the visualization panel");
|
|
|
+ pVisualisation.add(chckbxLinkNames);
|
|
|
|
|
|
chckbxSmartdevices = new JCheckBox("Show SmartDevices");
|
|
|
- chckbxSmartdevices.setBounds(0, 100, 240, 25);
|
|
|
+ chckbxSmartdevices.setBounds(0, 180, 240, 25);
|
|
|
chckbxSmartdevices.addActionListener(a -> config
|
|
|
.setShowSmartDevices(chckbxSmartdevices.isSelected()));
|
|
|
chckbxSmartdevices
|
|
@@ -131,7 +165,7 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
pVisualisation.add(chckbxSmartdevices);
|
|
|
|
|
|
chckbxDeviceNames = new JCheckBox("Show SmartDevice names");
|
|
|
- chckbxDeviceNames.setBounds(0, 130, 240, 25);
|
|
|
+ chckbxDeviceNames.setBounds(0, 210, 240, 25);
|
|
|
chckbxDeviceNames.addActionListener(a -> config
|
|
|
.setShowSmartDeviceNames(chckbxDeviceNames.isSelected()));
|
|
|
chckbxDeviceNames
|
|
@@ -165,10 +199,12 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
private static final long serialVersionUID = -7638231800254589350L;
|
|
|
private JCheckBox chckbxDeviceNames;
|
|
|
private JSlider sliderRadius;
|
|
|
+ private JSlider sliderLinkRadius;
|
|
|
private JCheckBox chckbxTerminatedConnections;
|
|
|
private JCheckBox chckbxConnections;
|
|
|
private JCheckBox chckbxLinks;
|
|
|
private JCheckBox chckbxLinkToolTips;
|
|
|
+ private JCheckBox chckbxLinkNames;
|
|
|
private JCheckBox chckbxSmartdevices;
|
|
|
|
|
|
@Override
|
|
@@ -178,6 +214,7 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
* SettingsController
|
|
|
*/
|
|
|
sliderRadius.setValue(config.getDeviceVisualizationRadius());
|
|
|
+ sliderLinkRadius.setValue(config.getLinkRadius());
|
|
|
chckbxTerminatedConnections.setSelected(config
|
|
|
.isShowTerminatedConnections());
|
|
|
chckbxConnections.setSelected(config.isShowConnections());
|
|
@@ -185,5 +222,6 @@ public class SettingsPopUp extends JFrame implements Observer {
|
|
|
chckbxLinkToolTips.setSelected(config.isShowLinkToolTips());
|
|
|
chckbxSmartdevices.setSelected(config.isShowSmartDevices());
|
|
|
chckbxDeviceNames.setSelected(config.isShowSmartDeviceNames());
|
|
|
+ chckbxLinkNames.setSelected(config.isShowLinkNameList());
|
|
|
}
|
|
|
}
|