Procházet zdrojové kódy

Removes direct accesses to the model

* Adds getSmartDevices() to NetworkController
* Removes Model from the different GUI classes
* Might improve MVC refresh on ConnectionCreationPanel
Andreas T. Meyer-Berg před 5 roky
rodič
revize
4c03e642be

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/Main.java

@@ -57,7 +57,7 @@ public class Main {
 		conf = controller.getSettingsController();
 	    //initializeTest();
 	    initializeMQTTTest();
-	    v = new MainFrame(m, controller);
+	    v = new MainFrame(controller);
 	    /*
 	    for(int i=0; i<10; i++)
 	    	m.getSim().simulateTimeIntervall(0+50*i, 50);

+ 7 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/NetworkController.java

@@ -119,7 +119,13 @@ public class NetworkController {
 		toDelete.getPorts().clear();
 		model.getDevices().remove(toDelete);
 	}
-
+	/**
+	 * Returns smartDevices of the model
+	 * @return
+	 */
+	public Collection<SmartDevice> getSmartDevices(){
+		return model.getDevices();
+	}
 	/**
 	 * Removes the SmartDevice from the given Link
 	 * 

+ 6 - 13
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/MainFrame.java

@@ -9,7 +9,6 @@ import java.awt.event.WindowStateListener;
 import javax.swing.JFrame;
 
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.Controller;
-import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Model;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.util.Utility;
 
 /**
@@ -19,15 +18,10 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.util.Utility;
  */
 @SuppressWarnings("serial")
 public class MainFrame extends JFrame {
-		
-	/**
-	 * Model of the smart home
-	 */
-	private Model model;
 	/**
 	 * Controller for manipulation of the model
 	 */
-	private Controller control;
+	private Controller controller;
 	/**
 	 * MenuBar of the GUI
 	 */
@@ -41,10 +35,9 @@ public class MainFrame extends JFrame {
 	 * @param m Model which is represented
 	 * @param c Controller which handles the user interaction
 	 */
-	public MainFrame(Model m, Controller c) {
-		//Set model and control
-		this.model = m;
-		this.control = c;
+	public MainFrame(Controller c) {
+		//Set and control
+		this.controller = c;
 		
 		setTitle("Smart Home Network Simulator");	
 		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@@ -62,14 +55,14 @@ public class MainFrame extends JFrame {
 		 * Add Visualization Panel
 		 */
 		//Could be a more complex panel later on (TabbedPanel, ScrollPanel, SplitPanel
-		panel = new VisualisationPanel(model, control);
+		panel = new VisualisationPanel(controller);
 		this.setContentPane(panel);
 		c.addObserver(panel);
 		
 		/*
 		 * Add Menu Bar
 		 */
-		menu = new MenuBar(model, control);
+		menu = new MenuBar(controller);
 		super.setJMenuBar(menu);
 		
 		//Show Frame

+ 2 - 8
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/MenuBar.java

@@ -12,7 +12,6 @@ import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
 
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.Controller;
-import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Model;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.popups.AboutPopUp;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.popups.NetworkTreeWindow;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.popups.SettingsPopUp;
@@ -25,10 +24,6 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.popups.SimulationConfigurator
  */
 public class MenuBar extends JMenuBar {
 
-	/**
-	 * Model
-	 */
-	Model model;
 	/**
 	 * Controller to manipulate the model
 	 */
@@ -59,8 +54,7 @@ public class MenuBar extends JMenuBar {
 	 * @param model Model
 	 * @param controller Controller
 	 */
-	public MenuBar(Model model, Controller controller) {
-		this.model = model;
+	public MenuBar(Controller controller) {
 		this.controller = controller;
 		
 		this.setLayout(new FlowLayout(FlowLayout.LEADING));
@@ -104,7 +98,7 @@ public class MenuBar extends JMenuBar {
 		
 		JMenuItem mntmOption = new JMenuItem("Settings");
 		mntmOption.addActionListener(a -> {
-			SettingsPopUp settings = new SettingsPopUp(model, controller);
+			SettingsPopUp settings = new SettingsPopUp(controller);
 			settings.setLocationRelativeTo(this.getParent());
 			settings.setVisible(true);
 		});

+ 21 - 27
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/VisualisationInteractor.java

@@ -20,7 +20,6 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.NetworkController;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Connection;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.ConnectionPerformance;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Link;
-import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Model;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Packet;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Port;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.SmartDevice;
@@ -42,11 +41,6 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.util.Utility;
  */
 public class VisualisationInteractor implements MouseInputListener,
 		MouseMotionListener, ActionListener, KeyListener {
-	/**
-	 * Smart Home model which should be interacted with
-	 */
-	private Model model;
-
 	/**
 	 * Controller to notify when the model changes
 	 */
@@ -196,22 +190,22 @@ public class VisualisationInteractor implements MouseInputListener,
 	 */
 	private LinkToolTip toolTip;
 	
+	/**
+	 * Link which was clicked
+	 */
 	private Link clickedLink = null;
 	
 	/**
 	 * Creates a new VisualisationInteractor
 	 *
-	 * @param model
-	 *            Model which is visualized
 	 * @param controller
 	 *            controller that is accessed
 	 * @param panel
 	 *            which should visualize the interactions
 	 */
-	public VisualisationInteractor(Model model, Controller controller,
+	public VisualisationInteractor(Controller controller,
 			VisualisationPanel panel) {
 		// Initialize the values
-		this.model = model;
 		this.controller = controller;
 		this.panel = panel;
 		this.config = controller.getSettingsController();
@@ -360,14 +354,14 @@ public class VisualisationInteractor implements MouseInputListener,
 			//Update position
 			if (e.getX() < 0)
 				dragged_x = 0;
-			else if (e.getX() >= model.getWidth())
-				dragged_x = model.getWidth()-1;
+			else if (e.getX() >= config.getWidth())
+				dragged_x = config.getWidth()-1;
 			else
 				dragged_x = e.getX();
 			if (e.getY() < 0)
 				dragged_y = 0;
-			else if (e.getY() >= model.getHeight())
-				dragged_y = model.getHeight()-1;
+			else if (e.getY() >= config.getHeight())
+				dragged_y = config.getHeight()-1;
 			else
 				dragged_y = e.getY();
 			if(mode == DRAG_CONNECTION)
@@ -380,7 +374,7 @@ public class VisualisationInteractor implements MouseInputListener,
 			//Remove unselected
 			controller.getSettingsController().getConfigurationManager().getSelectionModel().selectedDevicesDrag.removeIf(s->(s.getX()<min_x||s.getX()>max_x||s.getY()<min_y||s.getY()>max_y));
 			//Add selected devices
-			for(SmartDevice sel:model.getDevices()){
+			for(SmartDevice sel:network.getSmartDevices()){
 				if(sel.getX()>=min_x&&sel.getX()<=max_x&&sel.getY()>=min_y&&sel.getY()<=max_y&&!controller.getSettingsController().getConfigurationManager().getSelectionModel().selectedDevicesDrag.contains(sel)){
 					controller.getSettingsController().getConfigurationManager().getSelectionModel().selectedDevicesDrag.add(sel);
 				}
@@ -397,12 +391,12 @@ public class VisualisationInteractor implements MouseInputListener,
 			for(SmartDevice d:controller.getSettingsController().getConfigurationManager().getSelectionModel().selectedDevices){
 				if (d.getX() + x_offset <= config.getDeviceVisualizationRadius())
 					x_offset = config.getDeviceVisualizationRadius()-d.getX();
-				else if (d.getX() + x_offset >= model.getWidth() - config.getDeviceVisualizationRadius())
-					x_offset = model.getWidth() - config.getDeviceVisualizationRadius()-d.getX();
+				else if (d.getX() + x_offset >= config.getWidth() - config.getDeviceVisualizationRadius())
+					x_offset = config.getWidth() - config.getDeviceVisualizationRadius()-d.getX();
 				if (d.getY() + y_offset <= config.getDeviceVisualizationRadius())
 					y_offset = config.getDeviceVisualizationRadius()-d.getY();
-				else if (d.getY() + y_offset >= model.getHeight() - config.getDeviceVisualizationRadius())
-					y_offset = model.getHeight() - config.getDeviceVisualizationRadius()-d.getY();
+				else if (d.getY() + y_offset >= config.getHeight() - config.getDeviceVisualizationRadius())
+					y_offset = config.getHeight() - config.getDeviceVisualizationRadius()-d.getY();
 			}
 			//update the dragged position, if the offset changed
 			dragged_x =dragged.getX() + x_offset;
@@ -437,7 +431,7 @@ public class VisualisationInteractor implements MouseInputListener,
 			else
 				mode = SELECTED;
 			panel.repaint();
-			model.notifyObservers();
+			controller.notifyObservers();
 		}
 	}
 
@@ -536,7 +530,7 @@ public class VisualisationInteractor implements MouseInputListener,
 	 */
 	private SmartDevice getSmartDeviceAtPosition(int x, int y) {
 		// Check is device is inside visualization radius
-		for (SmartDevice d : model.getDevices()) {
+		for (SmartDevice d : network.getSmartDevices()) {
 			if (Math.abs(d.getX() - x) < config.getDeviceVisualizationRadius()
 					&& Math.abs(d.getY() - y) < config.getDeviceVisualizationRadius()) {
 				/**
@@ -559,7 +553,7 @@ public class VisualisationInteractor implements MouseInputListener,
 	private LinkedList<Pair<Connection, Pair<Port, Port>>> getConnectionsAtPosition(int x, int y) {
 		LinkedList<Pair<Connection,Pair<Port,Port>>> edges = new LinkedList<Pair<Connection,Pair<Port,Port>>>();
 		// Check is device is inside visualization radius
-		for(Connection c: model.getConnections()){
+		for(Connection c: network.getConnections()){
 			if(c.getProtocol()==null)
 				continue;
 			for(Pair<Port, Port> p: c.getProtocol().getTopology()){
@@ -682,7 +676,7 @@ public class VisualisationInteractor implements MouseInputListener,
 		 * Radius of the device + link
 		 */
 		int radius =  smallRadius + config.getLinkRadius();
-		for (SmartDevice d : model.getDevices()) {
+		for (SmartDevice d : network.getSmartDevices()) {
 			//In DeviceRadius + Link Radius ?
 			if (Math.abs(d.getX() - x) <= radius && Math.abs(d.getY() - y) <= radius) {
 				//More detailed check
@@ -935,9 +929,9 @@ public class VisualisationInteractor implements MouseInputListener,
 		itemDebug = new JMenuItem("Print NetworkState");
 		itemDebug.addActionListener(e -> {
 			// Print Links, Devices and Connections
-				for (Link l : model.getConnectionNetworks())
+				for (Link l : network.getLinks())
 					System.out.println("Link: " + l.getName());
-				for (SmartDevice d : model.getDevices()) {
+				for (SmartDevice d : network.getSmartDevices()) {
 					System.out.println("Device: " + d.getName());
 					for (Port p : d.getPorts()) {
 						if(p==null){
@@ -967,7 +961,7 @@ public class VisualisationInteractor implements MouseInputListener,
 				// Print Terminating Packages
 				LinkedList<Connection> terminated = new LinkedList<Connection>();
 
-				model.getConnections()
+				network.getConnections()
 						.stream()
 						.forEach(c -> {
 							if(c.getStatus() == Connection.FINISHED || c
@@ -976,7 +970,7 @@ public class VisualisationInteractor implements MouseInputListener,
 							for (Packet p : c.getTerminationPackages(1000))
 								System.out.println(p.getTextualRepresentation());
 						});
-				model.getConnections().removeAll(terminated);
+				network.getConnections().removeAll(terminated);
 				if(controller.getSettingsController().getConfigurationManager().getSelectionModel().selectedDevices.isEmpty())
 					mode = NOTHING;
 				else

+ 6 - 17
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/VisualisationPanel.java

@@ -21,7 +21,6 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.Controller;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.NetworkController;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Connection;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Link;
-import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Model;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Port;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.SmartDevice;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.util.Pair;
@@ -38,13 +37,6 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.util.Utility;
 @SuppressWarnings("serial")
 public class VisualisationPanel extends JPanel implements Observer {
 
-	
-	
-	/**
-	 * Smart Home model which is visualized
-	 */
-	private Model model;
-
 	/**
 	 * Controller to notify when the model changes
 	 */
@@ -68,20 +60,17 @@ public class VisualisationPanel extends JPanel implements Observer {
 	/**
 	 * Initializes the Visualization Panel
 	 * 
-	 * @param model
-	 *            Model to visualize
 	 * @param control
 	 *            Control, which changes the model
 	 */
-	public VisualisationPanel(Model model, Controller control) {
+	public VisualisationPanel(Controller control) {
 		super();
 
-		this.model = model;
 		this.control = control;
 		this.config = control.getSettingsController();
 		this.network = control.getNetworkController();
 		
-		this.interactor = new VisualisationInteractor(model, control, this);
+		this.interactor = new VisualisationInteractor(control, this);
 		this.addMouseMotionListener(interactor);
 		this.addMouseListener(interactor);
 		this.addKeyListener(interactor);
@@ -100,7 +89,7 @@ public class VisualisationPanel extends JPanel implements Observer {
 
 			@Override
 			public void componentResized(ComponentEvent e) {
-				config.setDimension(getWidth(), getHeight(), model.getDepth(),
+				config.setDimension(getWidth(), getHeight(), control.getSettingsController().getDepth(),
 						true);
 				repaint();
 			}
@@ -113,7 +102,7 @@ public class VisualisationPanel extends JPanel implements Observer {
 			public void componentHidden(ComponentEvent e) {
 			}
 		});
-		config.setDimension(getWidth(), getHeight(), model.getDepth(),
+		config.setDimension(getWidth(), getHeight(), control.getSettingsController().getDepth(),
 				true);
 		repaint();
 	}
@@ -275,7 +264,7 @@ public class VisualisationPanel extends JPanel implements Observer {
 			y_offset = interactor.dragged_y-interactor.dragged.getY();
 		}
 		//Paint Devices
-		for (SmartDevice s: model.getDevices()) {
+		for (SmartDevice s: network.getSmartDevices()) {
 			/**
 			 * x Position of the device
 			 */
@@ -350,7 +339,7 @@ public class VisualisationPanel extends JPanel implements Observer {
 		}
 		
 		// For all Connections
-		for (Connection c : model.getConnections()) {
+		for (Connection c : network.getConnections()) {
 			Color connectionState;
 			switch (c.getStatus()) {
 			case Connection.ACTIVE:

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/ConnectionCreationPanel.java

@@ -605,13 +605,13 @@ public class ConnectionCreationPanel extends JScrollPane {
 				/**
 				 * Close Window
 				 */
+				controller.notifyObservers();
 				content.setVisible(false);
 				setVisible(false);
 				if (frame != null) {
 					frame.setVisible(false);
 					frame.dispose();
 				}
-				controller.notifyObservers();
 			}
 		});
 

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

@@ -13,7 +13,6 @@ import javax.swing.SwingConstants;
 
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.SettingsController;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.Controller;
-import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.Model;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.util.Utility;
 
 /**
@@ -22,36 +21,51 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.view.util.Utility;
  * @author Andreas T. Meyer-Berg
  */
 public class SettingsPopUp extends JFrame {
-	Model model;
-	Controller controller;
-	SettingsController config;
-	
-	public SettingsPopUp(Model model, Controller controller) {
+
+	/**
+	 * Main Controller
+	 */
+	private Controller controller;
+	/**
+	 * Settings controller
+	 */
+	private SettingsController config;
+
+	/**
+	 * Creates a SettingsPopUp
+	 * 
+	 * @param controller
+	 *            controller which should manipulate the model
+	 */
+	public SettingsPopUp(Controller controller) {
 		setBounds(new Rectangle(0, 0, 450, 300));
-		this.model = model;
 		this.controller = controller;
-		this.config = controller.getSettingsController();
-		
+		this.config = this.controller.getSettingsController();
+
 		setTitle("Settings");
 		setIconImage(Utility.loadFile("/images/settings.png"));
-		
+
 		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
 		getContentPane().add(tabbedPane, BorderLayout.CENTER);
-		
+
+		/****************************************************************************
+		 * Visualization Radius Settings
+		 ****************************************************************************/
 		JPanel pVisualisation = new JPanel();
 		tabbedPane.addTab("Visualization", null, pVisualisation, null);
 		pVisualisation.setLayout(null);
-		
+
 		JLabel lblVisualisationSize = new JLabel("Visualization Radius:");
 		lblVisualisationSize.setBounds(12, 13, 125, 16);
-		lblVisualisationSize.setToolTipText("<html>Radius of the SmartDevice Visualization, which is half of the Device width.</html>");
+		lblVisualisationSize
+				.setToolTipText("<html>Radius of the SmartDevice Visualization, which is half of the Device width.</html>");
 		pVisualisation.add(lblVisualisationSize);
-		
+
 		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);
@@ -65,58 +79,94 @@ public class SettingsPopUp extends JFrame {
 			config.setDeviceVisualizationRadius(sliderRadius.getValue());
 			controller.notifyObservers();
 		});
-		
-		JCheckBox chckbxTerminatedConnections = new JCheckBox("Show terminated connections");
+
+		/****************************************************************************
+		 * Show Terminated Connections Settings
+		 ****************************************************************************/
+		JCheckBox chckbxTerminatedConnections = new JCheckBox(
+				"Show terminated connections");
 		chckbxTerminatedConnections.setBounds(8, 67, 197, 25);
-		chckbxTerminatedConnections.setSelected(config.isShowTerminatedConnections());
-		chckbxTerminatedConnections.addActionListener(a->config.setShowTerminatedConnections(chckbxTerminatedConnections.isSelected()));
-		chckbxTerminatedConnections.setToolTipText("<html>True if connections to devices, which were removed from the connection,<br> should be shown until the terminating packages of this device were sent.</html>");
+		chckbxTerminatedConnections.setSelected(config
+				.isShowTerminatedConnections());
+		chckbxTerminatedConnections.addActionListener(a -> config
+				.setShowTerminatedConnections(chckbxTerminatedConnections
+						.isSelected()));
+		chckbxTerminatedConnections
+				.setToolTipText("<html>True if connections to devices, which were removed from the connection,<br> should be shown until the terminating packages of this device were sent.</html>");
 		pVisualisation.add(chckbxTerminatedConnections);
-		
+
+		/****************************************************************************
+		 * Show Connections Settings
+		 ****************************************************************************/
 		JCheckBox chckbxConnections = new JCheckBox("Show connections");
 		chckbxConnections.setBounds(237, 67, 182, 25);
 		chckbxConnections.setSelected(config.isShowConnections());
-		chckbxConnections.addActionListener(a->config.setShowConnections(chckbxConnections.isSelected()));
-		chckbxConnections.setToolTipText("True if connections (Services/Connections) should be shown on the Visualization Panel.");
+		chckbxConnections.addActionListener(a -> config
+				.setShowConnections(chckbxConnections.isSelected()));
+		chckbxConnections
+				.setToolTipText("True if connections (Services/Connections) should be shown on the Visualization Panel.");
 		pVisualisation.add(chckbxConnections);
-		
+
+		/****************************************************************************
+		 * Show Links Settings
+		 ****************************************************************************/
 		JCheckBox chckbxLinks = new JCheckBox("Show links");
 		chckbxLinks.setBounds(237, 97, 178, 25);
 		chckbxLinks.setSelected(config.isShowLinks());
-		chckbxLinks.addActionListener(a->config.setShowLinks(chckbxLinks.isSelected()));
-		chckbxLinks.setToolTipText("<html>True if Links (Mediums of physical connection for devices like Wifi, Ethernet, Zigbee),<br> should be visualized (As part of the Circle around the Devices)</html>");
+		chckbxLinks.addActionListener(a -> config.setShowLinks(chckbxLinks
+				.isSelected()));
+		chckbxLinks
+				.setToolTipText("<html>True if Links (Mediums of physical connection for devices like Wifi, Ethernet, Zigbee),<br> should be visualized (As part of the Circle around the Devices)</html>");
 		pVisualisation.add(chckbxLinks);
-		
+
+		/****************************************************************************
+		 * Show Link Tool Tips Settings
+		 ****************************************************************************/
 		JCheckBox chckbxLinkToolTips = new JCheckBox("Show link ToolTips");
 		chckbxLinkToolTips.setBounds(237, 127, 178, 25);
 		chckbxLinkToolTips.setSelected(config.isShowLinkToolTips());
-		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");
+		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);
-		
+
+		/****************************************************************************
+		 * Show SmartDevices Settings
+		 ****************************************************************************/
 		JCheckBox chckbxSmartdevices = new JCheckBox("Show SmartDevices");
 		chckbxSmartdevices.setBounds(8, 97, 197, 25);
 		chckbxSmartdevices.setSelected(config.isShowSmartDevices());
-		chckbxSmartdevices.addActionListener(a->config.setShowSmartDevices(chckbxSmartdevices.isSelected()));
-		chckbxSmartdevices.setToolTipText("True if SmartDevices should be shown (Circles on the VisualizationPanel)");
+		chckbxSmartdevices.addActionListener(a -> config
+				.setShowSmartDevices(chckbxSmartdevices.isSelected()));
+		chckbxSmartdevices
+				.setToolTipText("True if SmartDevices should be shown (Circles on the VisualizationPanel)");
 		pVisualisation.add(chckbxSmartdevices);
-		
+
+		/****************************************************************************
+		 * Show SmartDevice Names Settings
+		 ****************************************************************************/
 		JCheckBox chckbxDeviceNames = new JCheckBox("Show SmartDevice names");
 		chckbxDeviceNames.setBounds(8, 127, 197, 25);
 		chckbxDeviceNames.setSelected(config.isShowSmartDeviceNames());
-		chckbxDeviceNames.addActionListener(a->config.setShowSmartDeviceNames(chckbxDeviceNames.isSelected()));
-		chckbxDeviceNames.setToolTipText("True if SmartDevice names should be shown");
+		chckbxDeviceNames.addActionListener(a -> config
+				.setShowSmartDeviceNames(chckbxDeviceNames.isSelected()));
+		chckbxDeviceNames
+				.setToolTipText("True if SmartDevice names should be shown");
 		pVisualisation.add(chckbxDeviceNames);
-		
+
+		/****************************************************************************
+		 * Show Further tabs for: Imports, Simulation, Graphics e.g.
+		 ****************************************************************************/
 		/**
 		 * Unused Tabs for further settings
 		 **
-		JPanel pImports = new JPanel();
-		tabbedPane.addTab("Imports", null, pImports, null);
-		
-		JPanel pSimulation = new JPanel();
-		tabbedPane.addTab("Simulation", null, pSimulation, null);
-		*/
+		 * JPanel pImports = new JPanel(); tabbedPane.addTab("Imports", null,
+		 * pImports, null);
+		 * 
+		 * JPanel pSimulation = new JPanel(); tabbedPane.addTab("Simulation",
+		 * null, pSimulation, null);
+		 */
 	}
 
 	/**