Browse Source

InspectorPanel

Remove Grouping Seperator
Change from GridBagLayout to MigLayout
Add Select All Button
Update Gitignore
Add Add/Delete/Duplicate-Buttons to Inspector
TomTroppmann 3 years ago
parent
commit
a32f6d3959
49 changed files with 652 additions and 1183 deletions
  1. 0 7
      .gitignore
  2. BIN
      jars/miglayout/miglayout-core-4.3-20121116.151612-3-javadoc.jar
  3. BIN
      jars/miglayout/miglayout-core-4.3-20121116.151612-3-sources.jar
  4. BIN
      jars/miglayout/miglayout-core-4.3-20121116.151612-3.jar
  5. BIN
      jars/miglayout/miglayout-swing-4.3-20121116.151626-3-javadoc.jar
  6. BIN
      jars/miglayout/miglayout-swing-4.3-20121116.151626-3-sources.jar
  7. BIN
      jars/miglayout/miglayout-swing-4.3-20121116.151626-3.jar
  8. BIN
      res/Images/duplicate.png
  9. 1 1
      src/Connection/ConnectHandheld.java
  10. 1 1
      src/Connection/ConnectPhysical.java
  11. 2 3
      src/Connection/socket/Server.java
  12. 0 1
      src/algorithm/example/DemoAlgo.java
  13. 1 1
      src/api/AlgorithmFrameworkFlex.java
  14. 1 1
      src/api/TopologieAlgorithmFramework.java
  15. 1 1
      src/classes/HolonElement.java
  16. 1 1
      src/classes/HolonSwitch.java
  17. 1 2
      src/ui/controller/CanvasController.java
  18. 2 2
      src/ui/controller/Control.java
  19. 1 1
      src/ui/controller/IndexTranslator.java
  20. 0 350
      src/ui/controller/UpdateController.java
  21. 1 53
      src/ui/model/Model.java
  22. 0 49
      src/ui/view/DefaulTable.java
  23. 0 270
      src/ui/view/Inspector.java
  24. 0 51
      src/ui/view/Main.java
  25. 0 38
      src/ui/view/PropertyTable.java
  26. 5 12
      src/ui/view/canvas/AbstractCanvas.java
  27. 4 22
      src/ui/view/canvas/Canvas.java
  28. 3 12
      src/ui/view/canvas/GroupNodeCanvas.java
  29. 1 1
      src/ui/view/component/ButtonTabComponent.java
  30. 1 1
      src/ui/view/component/Console.java
  31. 17 17
      src/ui/view/component/TrippleCheckBox.java
  32. 1 1
      src/ui/view/dialog/AboutUsPopUp.java
  33. 1 1
      src/ui/view/dialog/AddElementPopUp.java
  34. 2 2
      src/ui/view/dialog/AddObjectPopUp.java
  35. 7 2
      src/ui/view/dialog/BackgroundPopUp.java
  36. 3 1
      src/ui/view/dialog/CanvasResizePopUp.java
  37. 3 3
      src/ui/view/dialog/CreateNewDialog.java
  38. 1 1
      src/ui/view/dialog/CreateTemplatePopUp.java
  39. 2 1
      src/ui/view/dialog/EditEdgesPopUp.java
  40. 3 2
      src/ui/view/dialog/SearchPopUp.java
  41. 24 257
      src/ui/view/main/GUI.java
  42. 154 0
      src/ui/view/main/Inspector.java
  43. 340 0
      src/ui/view/main/InspectorTable.java
  44. 54 0
      src/ui/view/main/Main.java
  45. 1 1
      src/ui/view/main/TimePanel.java
  46. 7 8
      src/ui/view/main/UnitGraph.java
  47. 2 2
      src/ui/view/window/AddOnWindow.java
  48. 1 1
      src/ui/view/window/FlexWindow.java
  49. 2 2
      src/ui/view/window/Outliner.java

+ 0 - 7
.gitignore

@@ -135,10 +135,3 @@ dist/
 nbdist/
 .nb-gradle/
 
-### added manually ###
-.idea/
-praktikum-holons.iml
-/gb_singlerun.txt
-/PSO i100 p20 m3e-3 v4 (52).metalog
-/PSO i100 p20 m3e-3 v6.metalog
-/target/

BIN
jars/miglayout/miglayout-core-4.3-20121116.151612-3-javadoc.jar


BIN
jars/miglayout/miglayout-core-4.3-20121116.151612-3-sources.jar


BIN
jars/miglayout/miglayout-core-4.3-20121116.151612-3.jar


BIN
jars/miglayout/miglayout-swing-4.3-20121116.151626-3-javadoc.jar


BIN
jars/miglayout/miglayout-swing-4.3-20121116.151626-3-sources.jar


BIN
jars/miglayout/miglayout-swing-4.3-20121116.151626-3.jar


BIN
res/Images/duplicate.png


+ 1 - 1
src/Connection/ConnectHandheld.java

@@ -27,7 +27,7 @@ import classes.GroupNode;
 import classes.HolonObject;
 import Connection.socket.Server;
 import ui.controller.Control;
-import ui.view.Console;
+import ui.view.component.Console;
 
 public class ConnectHandheld implements AddOn{
 	

+ 1 - 1
src/Connection/ConnectPhysical.java

@@ -36,7 +36,7 @@ import classes.GroupNode;
 import classes.HolonElement;
 import classes.HolonObject;
 import ui.controller.Control;
-import ui.view.Console;
+import ui.view.component.Console;
 /**
  * Easy Connection via Http Request. Repeat Request with a delay.
  * 

+ 2 - 3
src/Connection/socket/Server.java

@@ -17,7 +17,7 @@ public class Server implements Runnable{
     private DataInputStream in;
     private boolean stopped = false;		
     private boolean connection = false;
-    private ui.view.Console console;
+    private ui.view.component.Console console;
     
     
     private HolonObject observed;
@@ -25,7 +25,7 @@ public class Server implements Runnable{
     private HolonObjectModel newModelField;
 	private Control control;
     
-    public Server(int port, ui.view.Console console, HolonObject observed, Control control) throws IOException {
+    public Server(int port, ui.view.component.Console console, HolonObject observed, Control control) throws IOException {
     	this.observed = observed;
     	this.console = console;
     	this.control = control;
@@ -129,7 +129,6 @@ public class Server implements Runnable{
 			}
 			control.calculateStateAndVisualForCurrentTimeStep();
 			control.updateCanvas();
-			control.getGui().triggerUpdateController(null);
 		}
 	}
 	

+ 0 - 1
src/algorithm/example/DemoAlgo.java

@@ -376,7 +376,6 @@ public class DemoAlgo implements AddOn {
 		private void updateVisual() {
 			control.calculateStateAndVisualForCurrentTimeStep();
 			control.updateCanvas();
-			control.getGui().triggerUpdateController(null);
 		}
 		/**
 		 * Sets the Model back to its original State before the LAST run.

+ 1 - 1
src/api/AlgorithmFrameworkFlex.java

@@ -59,8 +59,8 @@ import ui.model.DecoratedState;
 import ui.model.Model;
 import ui.model.DecoratedHolonObject.HolonObjectState;
 import ui.model.DecoratedSwitch.SwitchState;
+import ui.view.component.Console;
 import ui.model.DecoratedNetwork;
-import ui.view.Console;
 import utility.ImageImport;
 import utility.StringFormat;
 

+ 1 - 1
src/api/TopologieAlgorithmFramework.java

@@ -55,8 +55,8 @@ import ui.model.DecoratedState;
 import ui.model.Model;
 import ui.model.DecoratedHolonObject.HolonObjectState;
 import ui.model.DecoratedSwitch.SwitchState;
+import ui.view.component.Console;
 import ui.model.DecoratedNetwork;
-import ui.view.Console;
 
 public abstract class TopologieAlgorithmFramework implements AddOn{
 	//Algo

+ 1 - 1
src/classes/HolonElement.java

@@ -7,7 +7,7 @@ import classes.IdCounter.CounterType;
 import interfaces.GraphEditable;
 import interfaces.LocalMode;
 import ui.controller.FlexManager;
-import ui.view.IndexTranslator;
+import ui.controller.IndexTranslator;
 
 import java.awt.*;
 import java.awt.geom.Point2D;

+ 1 - 1
src/classes/HolonSwitch.java

@@ -9,7 +9,7 @@ import java.util.ListIterator;
 import com.google.gson.annotations.Expose;
 import interfaces.GraphEditable;
 import interfaces.LocalMode;
-import ui.view.IndexTranslator;
+import ui.controller.IndexTranslator;
 
 /**
  * The class HolonSwitch represents a Switch, which can be turned on and off.

+ 1 - 2
src/ui/controller/CanvasController.java

@@ -15,7 +15,7 @@ import classes.HolonSwitch;
 import classes.Node;
 import interfaces.ObjectListener;
 import ui.model.Model;
-import ui.view.GUI;
+import ui.view.main.GUI;
 import utility.Vector2Int;
 
 /**
@@ -310,7 +310,6 @@ public class CanvasController {
 	
 	public void updateCanvas() {
 		gui.repaintCanvas();
-		gui.triggerUpdateController(null);
 	}
 	public GUI getGui() {
 		return gui;

+ 2 - 2
src/ui/controller/Control.java

@@ -26,8 +26,8 @@ import classes.HolonObject;
 import classes.Node;
 import ui.model.Model;
 import ui.model.Model.FairnessModel;
-import ui.view.CreateTemplatePopUp;
-import ui.view.GUI;
+import ui.view.dialog.CreateTemplatePopUp;
+import ui.view.main.GUI;
 import utility.events.Event;
 
 /**

+ 1 - 1
src/ui/view/IndexTranslator.java → src/ui/controller/IndexTranslator.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.controller;
 
 import interfaces.LocalMode;
 import ui.model.Model;

+ 0 - 350
src/ui/controller/UpdateController.java

@@ -1,350 +0,0 @@
-package ui.controller;
-
-import classes.*;
-import ui.model.DecoratedGroupNode;
-import ui.model.DecoratedHolonObject.HolonObjectState;
-import ui.model.Model;
-import ui.view.DefaulTable;
-import ui.view.PropertyTable;
-import ui.view.GroupNodeCanvas;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-/**
- * This class is for all update methods and more ;)
- * 
- * @author Gruppe14
- *
- */
-public class UpdateController {
-
-	Model model;
-	Control controller;;
-
-	public UpdateController(Model model, Control control) {
-		this.model = model;
-		this.controller = control;
-	}
-
-	/**
-	 * Update the information concerning properties of the selected CpsObject.
-	 */
-	public void refreshTableProperties(DefaulTable table) {
-		if (model.getSelectedObjects().size() == 1) {
-			AbstractCanvasObject tempCps = model.getSelectedObjects().stream().findFirst().get();
-			if (tempCps != null && tempCps.getClass() == HolonObject.class) {
-				if (table.getRowCount() != 0) {
-					table.removeRow(2);
-					Object[] tempEnergy = { "Total Energy", ((HolonObject) tempCps).getEnergyNeededFromConsumingElements(model.getCurIteration()) };
-					table.insertRow(2, tempEnergy);
-				}
-			}
-		}
-	}
-
-	    
-
-
-
-	/**
-	 * Erase all information of the HolonElement Model.
-	 * 
-	 * @param t
-	 *            the Table
-	 */
-	public void deleteRows(PropertyTable t) {
-		if (t.getRowCount() > 0) {
-			for (int i = t.getRowCount() - 1; i > -1; i--) {
-				t.removeRow(i);
-			}
-		}
-	}
-
-	/**
-	 * Search for clicked HolonObject through the mouse's y-Coord.
-	 * 
-	 * @param yValue
-	 *            the Y Coordination
-	 * @return clicked HolonObject
-	 */
-	public HolonObject getHolonObj(int yValue, PropertyTable table) {
-		final int yTemp = (int) Math.floor(yValue / 16);
-		HolonObject obtTemp = null;
-		String temp = table.getValueAt(yTemp, 0).toString();
-		int idTemp = Integer.parseInt(temp.split(", ")[1]);
-		obtTemp = (HolonObject) controller.searchByID(idTemp);
-		return obtTemp;
-	}
-
-	/**
-	 * Search for actual selected HolonElement.
-	 * 
-	 * @param obj
-	 *            selected HolonObject, if obj==null means multi-selection
-	 *            active
-	 * @param yValue
-	 *            Y-Coord in the HolonElementsTable
-	 * @param toMultiHash
-	 *            0 means no MultiSelection, 1 means MultiSelection without
-	 *            Control, 2 means MultiSelection with Control
-	 * @return the selected HolonElement
-	 */
-	public HolonElement getActualHolonElement(HolonObject obj, int yValue, int toMultiHash,
-			ArrayList<PropertyTable> tables) {
-		final int yTemp = (int) Math.floor(yValue / 16);
-		int rowsTotal = 0;
-		// Filter for search --> single and multi selection
-		if (obj == null) {
-			rowsTotal = tables.get(1).getRowCount();
-		} else {
-			rowsTotal = tables.get(0).getRowCount();
-		}
-		// search for the clicked HolonObject and HolonElement --> in the
-		// HolonElementTable
-		HolonObject obtTemp = null;
-		HolonElement toReturnEle = null;
-		int id = 0;
-		if (rowsTotal != 0 && rowsTotal > yTemp) {
-			// Multi-Selection search
-			if (obj == null) {
-				String tempStringObj = tables.get(1).getValueAt(yTemp, 0).toString();
-				int idTempObj = Integer.parseInt(tempStringObj.split(", ")[1]);
-				if (model.getSelectedObjects() != null) {
-					obtTemp = (HolonObject) getHolonObjSelected(idTempObj);
-				}
-				id = Integer.parseInt(tables.get(1).getValueAt(yTemp, 1).toString());
-				ArrayList<HolonElement> eleTemp = new ArrayList<HolonElement>();
-				if (model.getEleToDelete().containsKey(idTempObj) && toMultiHash == 2) {
-					eleTemp = model.getEleToDelete().get(idTempObj);
-					if (!eleTemp.contains(obtTemp.searchElementById(id))) {
-						eleTemp.add(obtTemp.searchElementById(id));
-						model.getEleToDelete().replace(idTempObj, eleTemp);
-					}
-				} else if (toMultiHash == 2) {
-					eleTemp.add(obtTemp.searchElementById(id));
-					model.getEleToDelete().put(idTempObj, eleTemp);
-				} else if (toMultiHash == 1) {
-					model.setEleToDelete(new HashMap<Integer, ArrayList<HolonElement>>());
-					eleTemp.add(obtTemp.searchElementById(id));
-					model.getEleToDelete().put(idTempObj, eleTemp);
-				} else if (toMultiHash == 0) {
-					toReturnEle = obtTemp.searchElementById(id);
-				}
-			} // Single-Selection search
-			else {
-				model.setEleToDelete(new HashMap<Integer, ArrayList<HolonElement>>());
-				id = Integer.parseInt(tables.get(0).getValueAt(yTemp, 0).toString());
-				toReturnEle = obj.searchElementById(id);
-			}
-			model.setSelectedHolonElement(toReturnEle);
-			return toReturnEle;
-		} // If no HolonObject selected
-		else {
-			model.setEleToDelete(new HashMap<Integer, ArrayList<HolonElement>>());
-			model.setSelectedHolonElement(null);
-			return null;
-		}
-	}
-
-	/**
-	 * Getter for selected CpsObject.
-	 * 
-	 * @return selected CpsObject
-	 */
-	public AbstractCanvasObject getActualCps() {
-        AbstractCanvasObject tempCps;
-        if (model.getSelectedObjects().size() == 1) {
-			tempCps = model.getSelectedObjects().stream().findFirst().get();
-		} else {
-			int tempID = model.getSelectedObjectID();
-			tempCps = controller.searchByID(tempID);
-		}
-		return tempCps;
-	}
-
-	/**
-	 * Getter for selected CpsObject.
-	 * 
-	 * @return selected CpsObject
-	 */
-	public AbstractCanvasObject getActualCpsUpperNode(GroupNodeCanvas canvas) {
-		int tempID = model.getSelectedObjectID();
-		AbstractCanvasObject tempCps = controller.searchByIDUpperNode(tempID, canvas.getGroupNode());
-		return tempCps;
-	}
-
-	public void paintProperties(AbstractCanvasObject obj) {
-		if (obj != null) {
-			// Name of the CpsObject
-			Object[] tempName = { "Name", obj.getName() };
-			model.getPropertyTable().addRow(tempName);
-			// Id of the CpsObject
-			Object[] tempId = { "ID", obj.getId() };
-			model.getPropertyTable().addRow(tempId);
-			// For HolonObjects the Total Energy (production or
-			// consumption) is calculated
-			if (obj instanceof HolonObject) {
-				
-				Object[] tempEnergy = { "Total Energy", ((HolonObject) obj).getEnergyNeededFromConsumingElements(model.getCurIteration()) };
-				model.getPropertyTable().addRow(tempEnergy);
-				model.getPropertyTable().setCellEditable(0, 1, false);
-				model.getPropertyTable().setCellEditable(2, 1, false);
-				model.getPropertyTable().setCellEditable(3, 1, false);
-				model.getPropertyTable().setCellEditable(4, 1, false);
-			} // For HolonSwitches is showed the actual status (active
-				// or inactive)
-			else if (obj instanceof HolonSwitch) {
-				deleteRows(model.getSingleTable());
-				deleteRows(model.getMultiTable());
-				Object[] tempMode = { "Manual", ((HolonSwitch) obj).getManualMode() };
-				model.getPropertyTable().addRow(tempMode);
-				if (((HolonSwitch) obj).getManualMode()) {
-					Object[] tempActive = { "Active", ((HolonSwitch) obj).getManualState() };
-					model.getPropertyTable().addRow(tempActive);
-					model.getPropertyTable().setCellEditable(3, 1, true);
-				} else {
-					Object[] tempActive = { "Active",
-							((HolonSwitch) obj).getState(model.getCurIteration()) };
-					model.getPropertyTable().addRow(tempActive);
-					model.getPropertyTable().setCellEditable(3, 1, false);
-				}
-				// unitGraph.repaintWithNewSwitch((HolonSwitch) obj);
-				// elementGraph.setText(obj.getName());
-				model.getPropertyTable().setCellEditable(0, 1, true);
-				model.getPropertyTable().setCellEditable(2, 1, true);
-			} else if (obj instanceof GroupNode) {
-				deleteRows(model.getSingleTable());
-				deleteRows(model.getMultiTable());
-				//short fix please make me new
-				DecoratedGroupNode dGroupNode = controller.getSimManager().getVisualRepresentationalState(model.getCurIteration()).getCreatedGroupNodes().get((GroupNode) obj);
-				Object[] info = { "Statistics:", "" };
-				
-				Object[] numEle = { "Number of Objects (total)", ((GroupNode) obj).getNodes().size() };
-				Object[] numObj = { "Number of HolonObjects", ((GroupNode) obj).getNumHolonObj().size() };
-				Object[] numSwi = { "Number of HolonSwitches", ((GroupNode) obj).getNumSwitches().size() };
-				Object[] numUpp = { "Number of GroupNodes", ((GroupNode) obj).getNumUpperNodes().size() };
-				model.getPropertyTable().addRow(info);
-				model.getPropertyTable().addRow(numEle);
-				model.getPropertyTable().addRow(numObj);
-				model.getPropertyTable().addRow(numSwi);
-				model.getPropertyTable().addRow(numUpp);
-				if(dGroupNode != null) {
-					int numerator, denominator;
-					Object[] title = { "HolonObject Statistics:", "" };
-					
-					denominator	= dGroupNode.getAmountOfConsumer() + dGroupNode.getAmountOfSupplier() + dGroupNode.getAmountOfPassiv();
-					
-					numerator = dGroupNode.getAmountOfSupplier();
-					Object[] producer = { "Producer:",  numerator + "/" + denominator + "("+ (float)numerator/(float)denominator * 100 + "%)"};					
-					numerator = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.NOT_SUPPLIED);
-					Object[] notSupplied = { "UnSupplied:",  numerator + "/" + denominator + "("+ (float)numerator/(float)denominator * 100 + "%)"};
-					numerator = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.PARTIALLY_SUPPLIED);
-					Object[] partiallySupplied = { "PartriallySupplied:",  numerator + "/" + denominator + "("+ (float)numerator/(float)denominator * 100 + "%)"};
-					numerator = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.SUPPLIED);
-					Object[] supplied = { "Supplied:",  numerator + "/" + denominator + "("+ (float)numerator/(float)denominator * 100 + "%)"};
-					numerator = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.OVER_SUPPLIED);
-					Object[] overSupplied = { "OverSupplied:",  numerator + "/" + denominator + "("+ (float)numerator/(float)denominator * 100 + "%)"};
-					numerator = dGroupNode.getAmountOfPassiv();
-					Object[] passiv = { "Passiv(%):",  numerator + "/" + denominator + "("+ (float)numerator/(float)denominator * 100 + "%)"};
-					
-					Object[] nothing= {"", ""};
-					numerator = dGroupNode.getAmountOfAktiveElemntsFromHolonObjects();
-					denominator = dGroupNode.getAmountOfElemntsFromHolonObjects();
-					Object[] aktiv = { "Active HolonElements:",  numerator + "/" + denominator + "("+ (float)numerator/(float)denominator * 100 + "%)"};
-					float consumption = dGroupNode.getConsumptionFromConsumer();
-					float production = dGroupNode.getProductionFromSupplier();
-					Object[] consumptionObj = { "Total Consumption:",  consumption};
-					Object[] productionObj = { "Total Production:",  production};
-					Object[] difference = { "Difference:", production - consumption};
-					
-					
-					model.getPropertyTable().addRow(title);
-					model.getPropertyTable().addRow(producer);
-					model.getPropertyTable().addRow(notSupplied);
-					model.getPropertyTable().addRow(partiallySupplied);
-					model.getPropertyTable().addRow(supplied);
-					model.getPropertyTable().addRow(overSupplied);
-					model.getPropertyTable().addRow(passiv);
-					model.getPropertyTable().addRow(nothing);
-					model.getPropertyTable().addRow(aktiv);
-					model.getPropertyTable().addRow(nothing);
-					model.getPropertyTable().addRow(consumptionObj);
-					model.getPropertyTable().addRow(productionObj);
-					model.getPropertyTable().addRow(difference);
-				}
-				
-			} else {
-				deleteRows(model.getSingleTable());
-				deleteRows(model.getMultiTable());
-			}
-			// For Objects the only editable cell is the name
-			ArrayList<Edge> tempArray = obj.getConnections();
-			// If the clicked object has connections
-			if (!tempArray.isEmpty()) {
-				boolean first = true;
-				for (Edge temp2 : tempArray) {
-					if (first) {
-						first = false;
-						if (obj.getId() != temp2.getA().getId()) {
-							Object[] tempConnection = { obj.getName() + " is connected to",
-									temp2.getA().getName() + " with ID: " + temp2.getA().getId() };
-							model.getPropertyTable().addRow(tempConnection);
-						} else {
-							Object[] tempConnection = { obj.getName() + " is connected to",
-									temp2.getB().getName() + " with ID: " + temp2.getB().getId() };
-							model.getPropertyTable().addRow(tempConnection);
-						}
-					} else {
-						if (obj.getId() != temp2.getA().getId()) {
-							Object[] tempConnection = { "",
-									temp2.getA().getName() + " with ID: " + temp2.getA().getId() };
-							model.getPropertyTable().addRow(tempConnection);
-						} else {
-							Object[] tempConnection = { "",
-									temp2.getB().getName() + " with ID: " + temp2.getB().getId() };
-							model.getPropertyTable().addRow(tempConnection);
-						}
-					}
-				}
-			}
-		} // If the clicked Object is an edge
-		else if (model.getSelectedEdge() != null) {
-			// Name displayed
-			Object[] tempName = { "Name",
-					"Edge: " + model.getSelectedEdge().getA().getName() + " to "
-							+ model.getSelectedEdge().getB().getName() };
-			model.getPropertyTable().addRow(tempName);
-			// Current Flow displayed
-			Object[] tempFlow = { "Current flow", "" };
-			model.getPropertyTable().addRow(tempFlow);
-			// Max Capacity displayed
-			Object[] tempCapacity = { "Max. Capacity", model.getSelectedEdge().getCapacity() };
-			model.getPropertyTable().addRow(tempCapacity);
-			// Status displayed
-            Object[] tempStatus = {"Length", model.getSelectedEdge().getLength() };
-            model.getPropertyTable().addRow(tempStatus);
-            // For edges, the only possible editable cell is the max
-			// flow
-			model.getPropertyTable().setCellEditable(0, 1, false);
-			model.getPropertyTable().setCellEditable(2, 1, true);
-			model.getPropertyTable().setCellEditable(3, 1, true);
-		} else if (getActualCps() == null) {
-			deleteRows(model.getSingleTable());
-			deleteRows(model.getMultiTable());
-		}
-		// Update of the HolonElementTable (Single- or Multi-Selection)
-	}
-
-	public AbstractCanvasObject getHolonObjSelected(int id) {
-		AbstractCanvasObject obj = null;
-		for (AbstractCanvasObject o : model.getSelectedObjects()) {
-			if (o.getId() == id) {
-				obj = o;
-				break;
-			}
-		}
-		return obj;
-	}
-
-}

+ 1 - 53
src/ui/model/Model.java

@@ -9,8 +9,6 @@ import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import javax.swing.JTable;
-
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 
@@ -29,8 +27,6 @@ import classes.Node;
 import classes.Pair;
 import interfaces.GraphListener;
 import interfaces.ObjectListener;
-import ui.view.DefaulTable;
-import ui.view.PropertyTable;
 import utility.Vector2Int;
 
 /**
@@ -63,8 +59,6 @@ public class Model {
     private HashMap<Integer, ArrayList<HolonElement>> eleToDelete;
     // Capacity for Edge
     private float maxCapacity;
-    /** Table for the properties of HolonObjects, Edges etc */
-    private JTable propertyTable;
     
     private ArrayList<GraphListener> graphListeners = new ArrayList<GraphListener>();
     // Iteration Speed
@@ -124,9 +118,6 @@ public class Model {
     private ArrayList<HolonSwitch> switchsOnCanvas= new ArrayList<HolonSwitch>();
     
     private List<ObjectListener> objectListeners;
-    private PropertyTable tableModelHolonElementMulti;
-    private PropertyTable tableModelHolonElementSingle;
-    private DefaulTable tableModelProperties;
     private HashMap<Integer, GroupNode> hashcodeMap = new HashMap<>();
 
 
@@ -145,10 +136,6 @@ public class Model {
         setCgIdx(new HashMap<>());
         setCvsObjIdx(new HashMap<>());
         setEleToDelete(new HashMap<>());
-        setSingleTable(new PropertyTable());
-        setMultiTable(new PropertyTable());
-        setPropertyTable(new DefaulTable(1000, colNames.length));
-        getPropertyTable().setColumnIdentifiers(colNames);
         initGson();
     }
 
@@ -560,50 +547,11 @@ public class Model {
     public HashMap<Integer, ArrayList<HolonElement>> getEleToDelete() {
         return this.eleToDelete;
     }
-
+    //TODO eleToDelete is this necessary
     public void setEleToDelete(HashMap<Integer, ArrayList<HolonElement>> theHash) {
         this.eleToDelete = theHash;
     }
 
-    public PropertyTable getSingleTable() {
-        return this.tableModelHolonElementSingle;
-    }
-
-    public void setSingleTable(PropertyTable pt) {
-        this.tableModelHolonElementSingle = pt;
-    }
-
-    public PropertyTable getMultiTable() {
-        return this.tableModelHolonElementMulti;
-    }
-
-    public void setMultiTable(PropertyTable pt) {
-        this.tableModelHolonElementMulti = pt;
-    }
-
-
-    public DefaulTable getPropertyTable() {
-        return this.tableModelProperties;
-    }
-
-    public void setPropertyTable(DefaulTable pt) {
-        this.tableModelProperties = pt;
-    }
-
-    
-	/**
-	 * @return the tableProperties
-	 */
-	public JTable getTableProperties() {
-		return propertyTable;
-	}
-	
-	/**
-	 * @return the tableProperties
-	 */
-	public void setTableProperties(JTable propertyTable) {
-		this.propertyTable = propertyTable;
-	}
 
     public List<HolonElement> getAllHolonElemnts() {
     	return getAllHolonObjectsOnCanvas().stream().flatMap(hO -> hO.getElements().stream()).collect(Collectors.toList());

+ 0 - 49
src/ui/view/DefaulTable.java

@@ -1,49 +0,0 @@
-package ui.view;
-
-import javax.swing.table.DefaultTableModel;
-
-/**
- * Default Table.
- * 
- * @author Gruppe14
- */
-public class DefaulTable extends DefaultTableModel {
-
-	private static final long serialVersionUID = 1L;
-	private boolean[][] editableCells; // 2d array to represent rows and
-										// columns
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param rows
-	 *            the Rows
-	 * @param cols
-	 *            the Cols
-	 */
-	public DefaulTable(int rows, int cols) { // constructor
-		super(rows, cols);
-		this.editableCells = new boolean[rows][cols];
-	}
-
-	@Override
-	public boolean isCellEditable(int row, int column) {
-		return this.editableCells[row][column];
-	}
-
-	/**
-	 * Set Cell Editable.
-	 * 
-	 * @param row
-	 *            the Rows
-	 * @param col
-	 *            the Cols
-	 * @param value
-	 *            true or false
-	 */
-	public void setCellEditable(int row, int col, boolean value) {
-		this.editableCells[row][col] = value; // set cell true/false
-		this.fireTableCellUpdated(row, col);
-	}
-
-}

+ 0 - 270
src/ui/view/Inspector.java

@@ -1,270 +0,0 @@
-package ui.view;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GridLayout;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.swing.BorderFactory;
-import javax.swing.BoxLayout;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JFormattedTextField;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-
-import classes.AbstractCanvasObject;
-import classes.HolonElement;
-import classes.HolonElement.Priority;
-import classes.HolonObject;
-import ui.controller.Control;
-import ui.view.util.TrippleCheckBox;
-import utility.ImageImport;
-import utility.events.SimpleDocumentListener;
-
-
-public class Inspector extends JPanel {
-	private List<HolonElement> elements = new ArrayList<>();
-	private Control control;
-	private final int columnHeight = 19;
-	private final Inspector self;
-	private final ImageIcon deleteElementIcon = new ImageIcon(ImageImport.loadImage("Images/minus.png", 13, 13));
-	private final ImageIcon addElementIcon = new ImageIcon(ImageImport.loadImage("Images/plus.png", 13, 13));
-	private final Color selectedColor = new Color(126, 186, 255);
-	
-	Inspector(Control control) {
-		control.OnSelectionChanged.addListener(() -> update_ui());
-		this.control = control;
-		UIManager.put("Spinner.editorAlignment", JTextField.LEFT);
-		initUI();
-		this.add(header());
-		self = this;
-	}
-
-	public void update_ui() {
-		System.out.println("update_ui");
-		elements = extractElements(control.getModel().getSelectedObjects());
-		// TODO Pooling
-		this.removeAll();
-		this.add(header());
-		for (HolonElement element : elements) {
-			this.add(new ElementEdit(element));
-		}
-		if(!elements.isEmpty()) {
-			this.add(generateAddElementButton(elements.stream().findFirst().get()));
-		}
-
-		
-		revalidate();
-		repaint();
-	}
-
-	private void initUI() {
-		this.setBackground(Color.white);
-		this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
-		
-	}
-
-	private JPanel header() {
-		JPanel header = new JPanel(new GridLayout(1,7));
-		header.setMinimumSize(new Dimension(Integer.MIN_VALUE, columnHeight));
-		header.setMaximumSize(new Dimension(Integer.MAX_VALUE, columnHeight));
-		JPanel selectionPanel = new JPanel();
-		selectionPanel.setLayout(new BoxLayout(selectionPanel, BoxLayout.LINE_AXIS));
-		//Delete Button
-		JButton deleteButton = new JButton();
-		deleteButton.setIcon(deleteElementIcon);
-		deleteButton.setBorder(generateButtonHeaderBorder());
-		deleteButton.setContentAreaFilled(false);
-		deleteButton.setFocusPainted(false);
-		deleteButton.setToolTipText(
-				"<html><b>Remove this element</b><br>Removes this HolonElement from the HolonObject.</html>");
-		deleteButton.addActionListener(clicked ->{
-			System.out.println("hello");
-		});
-		
-		JButton addButton = new JButton();
-		addButton.setIcon(addElementIcon);
-		addButton.setBorder(generateButtonHeaderBorder());
-		addButton.setContentAreaFilled(false);
-		addButton.setFocusPainted(false);
-		TrippleCheckBox selectAllCheckBox = new TrippleCheckBox();
-		selectAllCheckBox.setBorder(generateButtonHeaderBorder());
-		selectionPanel.add(selectAllCheckBox);
-		selectionPanel.add(deleteButton, BorderLayout.LINE_END);
-		selectionPanel.add(addButton);
-		header.add(selectionPanel);
-		//Populate
-		String[] headerCoulumnTitles = {"Object", "Nr.", "Device", "Energy", "Priority", "Activ"};
-		for(String coulumnTitle : headerCoulumnTitles) {
-			header.add(generateHeaderColumnTitle(coulumnTitle));
-		}
-		return header;
-	}
-
-	private JLabel generateHeaderColumnTitle(String string) {
-		JLabel columnTitleLabel = new JLabel(string);
-		columnTitleLabel.setToolTipText(string);
-		columnTitleLabel.setBorder(generateHeaderBorder());
-		return columnTitleLabel;
-	}
-	
-	private JPanel generateAddElementButton(HolonElement element) {
-		JPanel panel = new JPanel(new BorderLayout());
-		panel.setBorder(generateTableBorder());
-		panel.setBackground(Color.white);
-		panel.setMinimumSize(new Dimension(Integer.MIN_VALUE, columnHeight));
-		panel.setMaximumSize(new Dimension(Integer.MAX_VALUE, columnHeight));
-		JButton button = new JButton();
-		button.setIcon(addElementIcon);
-		button.setBorder(null);
-		button.setBackground(Color.white);
-		button.addActionListener(clicked -> {
-			element.parentObject.addElement(new HolonElement(element));
-			update_ui();
-			
-		});
-		panel.add(button, BorderLayout.CENTER);
-		return panel;
-	}
-	
-
-	private List<HolonElement> extractElements(Collection<AbstractCanvasObject> toInspect) {
-		// Extract elements from a list of AbstractCanvasObjects
-		return toInspect.stream().filter(obj -> obj instanceof HolonObject).flatMap(obj -> {
-			HolonObject ho = (HolonObject) obj;
-			return ho.getElements().stream();
-		}).collect(Collectors.toList());
-	}
-
-	private Border generateTableBorder() {
-		return BorderFactory.createMatteBorder(1, 1, 0, 0, Color.LIGHT_GRAY);
-	}
-
-	private Border generateHeaderBorder() {
-		return BorderFactory.createEmptyBorder(1, 2, 0, 0);
-	}
-	private Border generateButtonHeaderBorder() {
-		return BorderFactory.createEmptyBorder(2, 2, 0, 0);
-	}
-
-	private class ElementEdit extends JPanel {
-		HolonElement element;
-
-		ElementEdit(HolonElement element) {
-			this.element = element;
-			this.initUI();
-			this.createEditFields();
-		}
-		
-		private void initUI() {
-			this.setBackground(Color.white);
-			this.setLayout(new GridLayout(1, 7));
-			this.setMinimumSize(new Dimension(Integer.MIN_VALUE, columnHeight));
-			this.setMaximumSize(new Dimension(Integer.MAX_VALUE, columnHeight));
-		}
-		private void createEditFields(){
-			//Selected
-			JPanel selectedColumnPanel = new JPanel(new BorderLayout());
-			selectedColumnPanel.setBorder(generateTableBorder());
-			selectedColumnPanel.setOpaque(false);
-			this.add(selectedColumnPanel);
-			JCheckBox selected = new JCheckBox();
-			selected.setBorder(generateTableBorder());
-			selected.setOpaque(false);
-			selected.addActionListener(clicked -> {
-				this.setBackground(selected.isSelected() ? selectedColor : Color.white);
-			});
-			selectedColumnPanel.add(selected, BorderLayout.CENTER);
-			
-			//ObjectName and ID
-			JPanel objectNamePanel = new JPanel(new BorderLayout());
-			JTextField objectNameTextField = new JTextField(this.element.parentObject.getName());
-			objectNameTextField.setBorder(generateTableBorder());
-			objectNameTextField.getDocument().addDocumentListener((SimpleDocumentListener) e -> {
-				this.element.parentObject.setName(objectNameTextField.getText());
-				
-			});
-			objectNameTextField.setOpaque(false);
-			objectNameTextField.setBorder(BorderFactory.createEmptyBorder());
-			objectNameTextField.addActionListener(ae -> update_ui());
-			
-			JLabel idLabel = new JLabel("[" + this.element.parentObject.getId() + "]");
-			objectNamePanel.add(objectNameTextField, BorderLayout.CENTER);
-			objectNamePanel.setBorder(generateTableBorder());
-			objectNamePanel.add(idLabel, BorderLayout.LINE_END);
-			objectNamePanel.setOpaque(false);
-			idLabel.setForeground(Color.gray);
-			idLabel.setToolTipText("HolonObject's ID");
-			this.add(objectNamePanel);
-
-			//Id
-			JLabel idTextField = new JLabel(Integer.toString(this.element.getId()));
-			idTextField.setBorder(generateTableBorder());
-			this.add(idTextField);
-			
-			//Name
-			JTextField elementNameTextField = new JTextField(this.element.getEleName());
-			elementNameTextField.setBorder(generateTableBorder());
-			elementNameTextField.getDocument().addDocumentListener((SimpleDocumentListener) e -> {
-				this.element.setEleName(elementNameTextField.getText());
-			});
-			elementNameTextField.setOpaque(false);
-			this.add(elementNameTextField);
-			// Energy
-			JFormattedTextField energyTextField = new JFormattedTextField();
-			energyTextField.setValue(this.element.getEnergy());
-			energyTextField.setOpaque(false);
-			energyTextField.addPropertyChangeListener(actionEvent -> {
-				float energy = (float)energyTextField.getValue();
-				if(this.element.getEnergy() != energy) {
-					this.element.setEnergyPerElement(energy);
-					control.calculateStateAndVisualForCurrentTimeStep();
-				}
-			});
-			energyTextField.setBorder(generateTableBorder());
-			this.add(energyTextField);
-			
-			//Priority
-			JComboBox<Priority> comboBox = new JComboBox<Priority>(Priority.values());
-			comboBox.setSelectedItem(this.element.getPriority());
-			comboBox.setOpaque(false);
-			comboBox.setBorder(generateTableBorder());
-			comboBox.setEditable(false);
-			comboBox.addActionListener(ae -> {
-				this.element.setPriority((Priority)comboBox.getSelectedItem());
-			});
-			this.add(comboBox);
-
-			//Active Delete Column
-			
-			JPanel checkBoxWrapperPanel = new JPanel(new BorderLayout());
-			checkBoxWrapperPanel.setBorder(generateTableBorder());
-			checkBoxWrapperPanel.setOpaque(false);
-			this.add(checkBoxWrapperPanel);
-
-			// Active
-			JCheckBox checkbox = new JCheckBox();
-			checkbox.setSelected(this.element.isActive());
-			checkbox.setOpaque(false);
-			checkbox.addActionListener(actionEvent -> {
-				this.element.setActive(checkbox.isSelected());
-				control.calculateStateAndVisualForCurrentTimeStep();
-			});
-			checkBoxWrapperPanel.add(checkbox, BorderLayout.LINE_START);
-			
-			
-			
-		}
-
-	}
-}

+ 0 - 51
src/ui/view/Main.java

@@ -1,51 +0,0 @@
-package ui.view;
-
-import ui.controller.Control;
-import ui.model.Model;
-
-import javax.swing.*;
-
-import java.awt.*;
-
-/**
- * The main Class in this Program. The GUI is created in this Class.
- * 
- * @author Gruppe14
- * 
- */
-public class Main {
-
-	/**
-	 * main method of this program.
-	 * 
-	 * @param args
-	 *            standard
-	 */
-	public static void main(String[] args) {
-		if (!System.getProperty("os.name").startsWith("Linux")) {
-			loadNotLinuxLookAndFeel();	
-		}
-		
-        EventQueue.invokeLater(() -> {
-            try {
-                Model model = new Model();
-                Control control = new Control(model);
-                GUI view = new GUI(control);
-                IndexTranslator.model = model;
-                view.setVisible(true);
-
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        });
-    }
-
-	private static void loadNotLinuxLookAndFeel() {
-		try {
-		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
-		e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 38
src/ui/view/PropertyTable.java

@@ -1,38 +0,0 @@
-package ui.view;
-
-import javax.swing.table.DefaultTableModel;
-
-/**
- * Property Table.
- * 
- * @author Gruppe14
- */
-public class PropertyTable extends DefaultTableModel {
-
-	private final int maxColumns = 7;
-	
-	@Override
-	public Class<?> getColumnClass(int columnIndex) {
-		//System.out.println("getColumnClass(" + "index:" + columnIndex+ ", ColumnCount:" + getColumnCount() + ")");
-		if (getColumnCount() == maxColumns) {
-			switch (columnIndex) {
-			case 4:
-			case 6:
-				return Boolean.class;
-			}
-		} else if (getColumnCount() == maxColumns - 1) {
-			switch (columnIndex) {
-			case 3:
-			case 5:
-				return Boolean.class;
-			}
-		}
-		return String.class;
-	}
-	
-	@Override
-	public boolean isCellEditable(int row, int column) {
-		return getColumnCount() == maxColumns && column > 1
-				|| getColumnCount() == maxColumns -1  && column > 0;
-	}
-}

+ 5 - 12
src/ui/view/AbstractCanvas.java → src/ui/view/canvas/AbstractCanvas.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.canvas;
 
 import java.awt.BasicStroke;
 import java.awt.Color;
@@ -25,7 +25,6 @@ import classes.HolonElement;
 import classes.HolonObject;
 import classes.Node;
 import ui.controller.Control;
-import ui.controller.UpdateController;
 import ui.model.Model;
 import utility.Vector2Int;
 
@@ -46,7 +45,7 @@ public abstract class AbstractCanvas extends JPanel {
 
 	final JMenuItem itemCut = new JMenuItem("Cut");
 	final JMenuItem itemCopy = new JMenuItem("Copy");
-	final JMenuItem itemPaste = new JMenuItem("Paste");
+	public final JMenuItem itemPaste = new JMenuItem("Paste");
 	final JMenuItem itemDelete = new JMenuItem("Delete");
 	final JMenuItem itemGroup = new JMenuItem("Group");
 	final JMenuItem itemUngroup = new JMenuItem("Ungroup");
@@ -61,14 +60,13 @@ public abstract class AbstractCanvas extends JPanel {
 	protected int x = 0;
 	protected int y = 0;
 	// Selection
-	AbstractCanvasObject tempCps = null;
-	UpdateController updCon;
+	public AbstractCanvasObject tempCps = null;
 
 	// Replacement
 	/**
 	 * the CpsObject that might be replaced by drag&drop
 	 */
-	protected AbstractCanvasObject mayBeReplaced = null;
+	public AbstractCanvasObject mayBeReplaced = null;
 
 	// PopUpMenu
 	JPopupMenu popmenu = new JPopupMenu();
@@ -83,7 +81,7 @@ public abstract class AbstractCanvas extends JPanel {
 	boolean dragged = false; // if an object/objects was/were dragged
 	boolean drawEdge = false; // for drawing edges
 	boolean doMark = false; // for double click
-	Edge edgeHighlight = null;
+	public Edge edgeHighlight = null;
 	Point mousePosition = new Point(); // Mouse Position when
 	ArrayList<Vector2Int> savePos;
 	// edge Object Start Point
@@ -273,11 +271,6 @@ public abstract class AbstractCanvas extends JPanel {
 
 	abstract void drawDeleteEdge();
 
-	void triggerUpdateController() {
-		updCon.paintProperties(tempCps);
-		updCon.refreshTableProperties(model.getPropertyTable());
-	}
-
 	/**
 	 * Checks if {@code draggedCps} or a new cpsObject at Position (x,y) could
 	 * replace exactly one object in {@code objects}. Saves the object that would be

+ 4 - 22
src/ui/view/Canvas.java → src/ui/view/canvas/Canvas.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.canvas;
 
 import java.awt.BasicStroke;
 import java.awt.Color;
@@ -33,7 +33,6 @@ import classes.HolonObject;
 import classes.HolonSwitch;
 import classes.Node;
 import ui.controller.Control;
-import ui.controller.UpdateController;
 import ui.model.Consumer;
 import ui.model.DecoratedCable;
 import ui.model.DecoratedGroupNode;
@@ -42,6 +41,7 @@ import ui.model.DecoratedHolonObject.HolonObjectState;
 import ui.model.DecoratedSwitch;
 import ui.model.ExitCable;
 import ui.model.DecoratedSwitch.SwitchState;
+import ui.view.main.UnitGraph;
 import ui.model.Model;
 import ui.model.Passiv;
 import ui.model.Supplier;
@@ -96,8 +96,6 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 		popmenu.add(itemUngroup);
 		popmenu.add(itemCreateTemplate);
 
-		updCon = new UpdateController(mod, control);
-
 		itemDelete.setEnabled(false);
 		itemCut.setEnabled(false);
 		itemCopy.setEnabled(false);
@@ -144,7 +142,6 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 					}
 					controller.addUpperNode("GroupNode", groupNode, animCps);
 					controller.calculateStateAndVisualForCurrentTimeStep();
-					triggerUpdateController();
 					controller.clearSelection();
 					repaint();
 				}
@@ -192,7 +189,6 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 						animCps.get(i).getPosition().set(savePos.get(i));
 					}
 					controller.calculateStateAndVisualForCurrentTimeStep();
-					triggerUpdateController();
 					repaint();
 				}
 			});
@@ -588,18 +584,6 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 
 	@Override
 	public void mouseClicked(MouseEvent e) {
-		if (!disabled) {
-			if (e.getButton() == MouseEvent.BUTTON1) {
-				DefaulTable propertyTable = model.getPropertyTable();
-				if (propertyTable.getRowCount() > 0) {
-					for (int i = propertyTable.getRowCount() - 1; i > -1; i--) {
-						propertyTable.removeRow(i);
-					}
-				}
-
-				triggerUpdateController();
-			}
-		}
 	}
 
 	@Override
@@ -735,8 +719,6 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 			}
 			controller.calculateStateAndVisualForTimeStep(model.getCurIteration());
 
-			triggerUpdateController();
-
 			repaint();
 		}
 	}
@@ -1017,7 +999,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 	 *
 	 * @param bool
 	 */
-	void setToolTip(boolean bool) {
+	public void setToolTip(boolean bool) {
 		this.toolTip = bool;
 	}
 
@@ -1027,7 +1009,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 	 * @param x
 	 * @param y
 	 */
-	void setXY(int x, int y) {
+	public void setXY(int x, int y) {
 		this.x = x;
 		this.y = y;
 	}

+ 3 - 12
src/ui/view/GroupNodeCanvas.java → src/ui/view/canvas/GroupNodeCanvas.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.canvas;
 
 import java.awt.BasicStroke;
 import java.awt.Color;
@@ -25,6 +25,7 @@ import ui.model.ExitCable;
 import ui.model.Model;
 import ui.model.Passiv;
 import ui.model.Supplier;
+import ui.view.main.UnitGraph;
 import utility.ImageImport;
 import utility.Vector2Int;
 
@@ -34,7 +35,7 @@ public class GroupNodeCanvas extends Canvas {
 	private String parentPath;
 	private Component parentComponent;
 
-	GroupNodeCanvas(Model mod, Control control, UnitGraph unitGraph, GroupNode groupNode, String parentPath,
+	public GroupNodeCanvas(Model mod, Control control, UnitGraph unitGraph, GroupNode groupNode, String parentPath,
 			Component parentComponent) {
 		super(mod, control, unitGraph);
 		this.groupNode = groupNode;
@@ -165,13 +166,6 @@ public class GroupNodeCanvas extends Canvas {
 			controller.setSelectedObjectID(-1);
 			// Object Selection
 
-			// Erase old data in the PropertyTable
-			if (model.getPropertyTable().getRowCount() > 0) {
-				for (int i = model.getPropertyTable().getRowCount() - 1; i > -1; i--) {
-					model.getPropertyTable().removeRow(i);
-				}
-			}
-
 			if (e.getX() > 0) {
 				for (AbstractCanvasObject cps : groupNode.getNodes()) {
 					cx = cps.getPosition().getX() - model.getScaleDiv2();
@@ -240,8 +234,6 @@ public class GroupNodeCanvas extends Canvas {
 					if (!e.isControlDown() && e.getButton() != MouseEvent.BUTTON3) {
 						controller.clearSelection();
 					}
-					updCon.deleteRows(model.getMultiTable());
-					updCon.deleteRows(model.getSingleTable());
 				}
 
 				if (edgeHighlight == null && tempCps == null) {
@@ -315,7 +307,6 @@ public class GroupNodeCanvas extends Canvas {
 				controller.getGui().openNewUpperNodeTab((GroupNode)tempCps);
 			}
 			controller.calculateStateAndVisualForTimeStep(model.getCurIteration());
-			triggerUpdateController();
 			repaint();
 		}
 	}

+ 1 - 1
src/ui/view/ButtonTabComponent.java → src/ui/view/component/ButtonTabComponent.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.component;
 
 /*
  * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.

+ 1 - 1
src/ui/view/Console.java → src/ui/view/component/Console.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.component;
 
 import java.awt.BorderLayout;
 

+ 17 - 17
src/ui/view/util/TrippleCheckBox.java → src/ui/view/component/TrippleCheckBox.java

@@ -1,4 +1,4 @@
-package ui.view.util;
+package ui.view.component;
 
 import java.awt.Color;
 import java.awt.Component;
@@ -12,23 +12,23 @@ import javax.swing.UIManager;
 
 public class TrippleCheckBox extends JCheckBox implements Icon, ActionListener {
 
-	public enum Mode {
+	public enum State {
 		unselected, mid_state_selection, selected
 	};
 
-	Mode mode;
+	State state;
 	final static Icon icon = UIManager.getIcon("CheckBox.icon");
 
 	public TrippleCheckBox() {
-		this("", Mode.unselected);
+		this("", State.unselected);
 	}
 
 	public TrippleCheckBox(String text) {
-		this(text, Mode.unselected);
+		this(text, State.unselected);
 	}
 
-	public TrippleCheckBox(String text, Mode selection) {
-		super(text, selection != Mode.unselected);
+	public TrippleCheckBox(String text, State selection) {
+		super(text, selection == State.selected);
 		setSelectionState(selection);
 		addActionListener(this);
 		setIcon(this);
@@ -36,23 +36,23 @@ public class TrippleCheckBox extends JCheckBox implements Icon, ActionListener {
 
 	@Override
 	public boolean isSelected() {
-		return (getSelectionState() != Mode.unselected);
+		return (getSelectionState() == State.selected);
 	}
 
-	public Mode getSelectionState() {
-		return mode;
+	public State getSelectionState() {
+		return state;
 	}
 
-	public void setSelectionState(Mode selection) {
-		setSelected(selection != Mode.unselected);
-		mode = selection;
+	public void setSelectionState(State selection) {
+		state = selection;
+		setSelected(state == State.selected);
 	}
 
 
 	@Override
 	public void paintIcon(Component c, Graphics g, int x, int y) {
 		icon.paintIcon(c, g, x, y);
-		if (getSelectionState() != Mode.mid_state_selection)
+		if (getSelectionState() != State.mid_state_selection)
 			return;
 
 		int w = getIconWidth();
@@ -81,13 +81,13 @@ public class TrippleCheckBox extends JCheckBox implements Icon, ActionListener {
 	public void actionPerformed(ActionEvent e) {
 		switch (getSelectionState()) {
 		case unselected:
-			setSelectionState(Mode.selected);
+			setSelectionState(State.selected);
 			break;
 		case mid_state_selection:
-			setSelectionState(Mode.unselected);
+			setSelectionState(State.unselected);
 			break;
 		case selected:
-			setSelectionState(Mode.unselected);
+			setSelectionState(State.unselected);
 			break;
 		}
 	}

+ 1 - 1
src/ui/view/AboutUsPopUp.java → src/ui/view/dialog/AboutUsPopUp.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.dialog;
 
 import javax.swing.*;
 

+ 1 - 1
src/ui/view/AddElementPopUp.java → src/ui/view/dialog/AddElementPopUp.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.dialog;
 
 import java.awt.BorderLayout;
 import java.awt.Color;

+ 2 - 2
src/ui/view/AddObjectPopUp.java → src/ui/view/dialog/AddObjectPopUp.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.dialog;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -69,7 +69,7 @@ public class AddObjectPopUp extends JDialog {
 	 * @param obj  the object
 	 * @param cat  the categorie
 	 */
-	AddObjectPopUp(boolean edit, AbstractCanvasObject obj, String cat, JFrame parentFrame) {
+	public AddObjectPopUp(boolean edit, AbstractCanvasObject obj, String cat, JFrame parentFrame) {
 
 		toEdit = obj;
 		editState = edit;

+ 7 - 2
src/ui/view/BackgroundPopUp.java → src/ui/view/dialog/BackgroundPopUp.java

@@ -1,13 +1,18 @@
-package ui.view;
+package ui.view.dialog;
 
 import classes.GroupNode;
 import ui.controller.Control;
 import ui.model.Model;
+import ui.view.canvas.Canvas;
 import utility.ImageImport;
 
 import javax.swing.*;
 import javax.swing.filechooser.FileNameExtensionFilter;
-import java.awt.*;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.GridLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.ComponentAdapter;

+ 3 - 1
src/ui/view/CanvasResizePopUp.java → src/ui/view/dialog/CanvasResizePopUp.java

@@ -1,7 +1,9 @@
-package ui.view;
+package ui.view.dialog;
 
 import ui.controller.Control;
 import ui.model.Model;
+import ui.view.canvas.Canvas;
+import ui.view.canvas.GroupNodeCanvas;
 import utility.ImageImport;
 import utility.Vector2Int;
 

+ 3 - 3
src/ui/view/CreateNewDialog.java → src/ui/view/dialog/CreateNewDialog.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.dialog;
 
 import java.awt.BorderLayout;
 import java.awt.CardLayout;
@@ -44,7 +44,7 @@ public class CreateNewDialog extends JDialog{
 	
 	
 	
-	CreateNewDialog(Control controller, JFrame parentFrame){
+	public CreateNewDialog(Control controller, JFrame parentFrame){
 		super((JFrame)parentFrame, "Create a..");
 		actualController = controller;
 		setVisible(true);
@@ -77,7 +77,7 @@ public class CreateNewDialog extends JDialog{
 	}
 
 
-	CreateNewDialog(Control controller, Option aOption, JFrame parentFrame){
+	public CreateNewDialog(Control controller, Option aOption, JFrame parentFrame){
 		super((JFrame)parentFrame, "Create a " + aOption.name());
 		actualController = controller;
 		if(aOption == Option.None)

+ 1 - 1
src/ui/view/CreateTemplatePopUp.java → src/ui/view/dialog/CreateTemplatePopUp.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.dialog;
 
 import java.awt.BorderLayout;
 import java.awt.Choice;

+ 2 - 1
src/ui/view/EditEdgesPopUp.java → src/ui/view/dialog/EditEdgesPopUp.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.dialog;
 
 import java.awt.BorderLayout;
 import java.awt.Font;
@@ -18,6 +18,7 @@ import javax.swing.border.EmptyBorder;
 
 import classes.Edge;
 import ui.controller.Control;
+import ui.view.canvas.Canvas;
 
 /**
  * Popup for Editing Edges.

+ 3 - 2
src/ui/view/SearchPopUp.java → src/ui/view/dialog/SearchPopUp.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.dialog;
 
 import java.awt.BorderLayout;
 import java.awt.Font;
@@ -17,6 +17,7 @@ import javax.swing.border.EmptyBorder;
 
 import classes.AbstractCanvasObject;
 import ui.controller.Control;
+import ui.view.canvas.Canvas;
 
 /**
  * This Class represents a popup to seatch for Objects on the Canvas.
@@ -45,7 +46,7 @@ public class SearchPopUp extends JDialog {
 	 * @param can
 	 *            Canvas
 	 */
-    SearchPopUp(Control contr, Canvas can, JFrame parentFrame) {
+    public SearchPopUp(Control contr, Canvas can, JFrame parentFrame) {
         super((java.awt.Frame) null, true);
 		idx = -1;
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);

+ 24 - 257
src/ui/view/GUI.java → src/ui/view/main/GUI.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.main;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -29,8 +29,6 @@ import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.ListIterator;
-import java.util.Timer;
-import java.util.TimerTask;
 
 import javax.swing.AbstractAction;
 import javax.swing.ActionMap;
@@ -74,18 +72,30 @@ import classes.AbstractCanvasObject;
 import classes.Category;
 import classes.Edge;
 import classes.GroupNode;
-import classes.HolonElement;
 import classes.HolonObject;
 import classes.HolonSwitch;
 import classes.IdCounter;
 import classes.IdCounter.CounterType;
 import interfaces.GraphEditable;
 import ui.controller.Control;
-import ui.controller.UpdateController;
 import ui.model.DecoratedState;
 import ui.model.Model;
 import ui.model.Model.FairnessModel;
-import ui.view.CreateNewDialog.Option;
+import ui.view.canvas.AbstractCanvas;
+import ui.view.canvas.Canvas;
+import ui.view.canvas.GroupNodeCanvas;
+import ui.view.component.ButtonTabComponent;
+import ui.view.dialog.AboutUsPopUp;
+import ui.view.dialog.AddObjectPopUp;
+import ui.view.dialog.BackgroundPopUp;
+import ui.view.dialog.CanvasResizePopUp;
+import ui.view.dialog.CreateNewDialog;
+import ui.view.dialog.CreateNewDialog.Option;
+import ui.view.dialog.EditEdgesPopUp;
+import ui.view.dialog.SearchPopUp;
+import ui.view.window.AddOnWindow;
+import ui.view.window.FlexWindow;
+import ui.view.window.Outliner;
 import utility.ImageImport;
 
 /**
@@ -158,11 +168,8 @@ public class GUI {
 	private final JTabbedPane tabbedPaneOriginal = new JTabbedPane(JTabbedPane.TOP);
 	private final JPopupMenu popmenuEdit = new JPopupMenu();
 	private final JMenuItem editItem = new JMenuItem("Edit Object");
-	private final JLabel maxGraph = new JLabel("100%");
-	private final JLabel medGraph = new JLabel("50%");
-	private final JLabel minGraph = new JLabel("0%");
+
 	private final JLabel elementGraph = new JLabel("None ");
-	private final ArrayList<HolonElement> selectedElements = new ArrayList<>();
 	private final JTree categoryTree = new JTree();
 	/******************************************
 	 ************* Right Container*************
@@ -176,16 +183,10 @@ public class GUI {
 	private final int distanceBetweenElementsAndGraph = 350;
 
 	// Prechoosed local Periods
-	private String[] comboContext = { "", "5", "10", "20", "100", "1000" };
-	private JComboBox<String> localPeriodInput = new JComboBox<String>(comboContext);
-	JButton resetButton = new JButton("", new ImageIcon(ImageImport.loadImage("/Images/resetIcon3.png")));
-	ImageIcon localPeriodButtonImage = new ImageIcon(
-			GrayFilter.createDisabledImage(ImageImport.loadImage("/Images/Graph.png")));
-	private JButton localPeriodButton = new JButton("", localPeriodButtonImage);
-	private final JPanel graphLabel = new JPanel();
+
 	private final JScrollPane scrollProperties = new JScrollPane();
 	// In this section is the graph for the selected HolonElement of the clicked
-	private final JScrollPane scrollGraph = new JScrollPane();
+
 	private final Model model;
 	private final Control controller;
 
@@ -202,12 +203,10 @@ public class GUI {
 	private final JMenuItem mItemObject = new JMenuItem("Object");
 	private final JMenuItem mItemSwitch = new JMenuItem("Switch");
 	private final JButton btnDel = new JButton();
-	private final JButton btnAddHolEL = new JButton();
-	private final JButton btnDelHolEL = new JButton();
 
 	private final JToolBar toolBar = new JToolBar();
 	private final JToolBar toolBarHolonEl = new JToolBar();
-	private final JToolBar toolBarGraph = new JToolBar();
+
 	// Languages
 	private final Canvas canvas;
 	private final UnitGraph unitGraph;
@@ -219,28 +218,17 @@ public class GUI {
 	private final JMenuItem mntmFindReplace = new JMenuItem("Find/ Replace");
 	private final JMenuItem mntmAlignAll = new JMenuItem("Align All");
 	private final JMenuItem mntmResetCategory = new JMenuItem("Reset Categories");
-	private final String[] columnNamesMulti = { "Object", "Nr.", "Device", "Energy", "Flexibility active", "Quantity",
-			"Activated" };
-	private final String[] columnNamesSingle = { "Nr.", "Device", "Energy", "Flexibility active", "Quantity",
-			"Activated" };
-	private final ArrayList<PropertyTable> tables = new ArrayList<>();
-	private final UpdateController updCon;
-	// for doubleclick
-	private boolean click = false;
 	// TODO make GUI a JFRAME and remove holegJFrame
 	private JFrame holegJFrame;
 
 	// tabbedPaneOriginal or tabbedPaneSplit
 	private JTabbedPane tabTemp;
-	private boolean initSplit = true;
 	private String catOfObjToBeEdited;
 	private GroupNodeCanvas unc;
 	private JPanel contentPane;
-	private String holonEleNamesDisplayed = "None ";
 	// Pop up Windows
 	private AddObjectPopUp addObjectPopUP;
 	private AboutUsPopUp aboutUsPopUp;
-	private AddElementPopUp addElementPopUp;
 	// variables
 	private boolean dragging = false;
 	private String actualObjectClicked;
@@ -275,11 +263,10 @@ public class GUI {
 		inspector = new Inspector(control);
 		control.setGui(this);
 		control.calculateStateAndVisualForCurrentTimeStep();
-		this.unitGraph = new UnitGraph(model, control);
+		this.unitGraph = new UnitGraph(control);
 		this.canvas = new Canvas(model, control, unitGraph);
 		initialize();
 		updateCategories(model.getCategories());
-		updCon = new UpdateController(model, controller);
 		control.OnCategoryChanged.addListener(() -> this.updateCategoryUI(model.getCategories()));
 	}
 
@@ -464,7 +451,6 @@ public class GUI {
 				}
 
 				model.getSelectedObjects().clear();
-				hideScrollGraph();
 			}
 		});
 
@@ -750,131 +736,14 @@ public class GUI {
 		 **********************/
 
 		panelHolonEl.setLayout(new BoxLayout(panelHolonEl, BoxLayout.X_AXIS));
-		toolBarHolonEl.add(btnAddHolEL);
-		toolBarHolonEl.add(btnDelHolEL);
 		toolBarHolonEl.setFloatable(false);
 		panelHolonEl.add(toolBarHolonEl);
 
-		// Set up of the Properties section
-
-		scrollGraph.setViewportView(unitGraph);
-		graphLabel.setLayout(new BorderLayout(0, 10));
-		graphLabel.add(maxGraph, BorderLayout.NORTH);
-		graphLabel.add(medGraph, BorderLayout.CENTER);
-		graphLabel.add(minGraph, BorderLayout.SOUTH);
-
-		toolBarGraph.setFloatable(false);
-		toolBarGraph.setAlignmentY(Component.RIGHT_ALIGNMENT);
-
-		localPeriodButton.setToolTipText("Toggle Local/Global Mode");
-		toolBarGraph.add(localPeriodButton);
-		// ComboBox
-		localPeriodInput.setEditable(true);
-		localPeriodInput.setVisible(false);
-		localPeriodInput.setMaximumSize(new Dimension(20, 23));
-		localPeriodInput.addItemListener(aListener -> {
-			if (aListener.getStateChange() == ItemEvent.DESELECTED) {
-				validateInput(localPeriodInput.getEditor().getItem().toString(), true);
-			}
-
-		});
-
-		toolBarGraph.add(localPeriodInput);
-
-		// localPeriodButtonFunction
-		localPeriodButton.addActionListener(actionEvent -> {
-			boolean newState = !localPeriodInput.isVisible();
-			changeLocalPeriodButtonAppeareance(newState);
-			unitGraph.setUseLocalPeriod(newState);
-		});
-
-		toolBarGraph.add(Box.createHorizontalGlue());
-		resetButton.setToolTipText("Reset");
-		resetButton.addActionListener(actionEvent -> unitGraph.reset());
-		toolBarGraph.add(resetButton);
-
-		scrollGraph.setRowHeaderView(graphLabel);
-		scrollGraph.setColumnHeaderView(toolBarGraph);
+	
 
-		tables.add(model.getSingleTable());
-		tables.add(model.getMultiTable());
-		/***********************
-		 * HolonElement Table Actions
-		 **********************/
-		/*
-		 * Add HolonElement to given HolonObject
-		 */
-		btnAddHolEL.addActionListener(actionEvent -> {
-			if (model.getSelectedObjects().size() == 1) {
-				AbstractCanvasObject tempCpsObject = updCon.getActualCps();
-				if (tempCpsObject != null && tempCpsObject.getClass() == HolonObject.class
-						&& tempCpsObject.getId() != 0) {
-					addElementPopUp = new AddElementPopUp(holegJFrame);
-					addElementPopUp.setActualHolonObject((HolonObject) updCon.getActualCps());
-					addElementPopUp.setVisible(true);
-					HolonElement ele = addElementPopUp.getElement();
-					if (ele != null) {
-						controller.addElementCanvasObject(tempCpsObject.getId(), ele.getEleName(), ele.getEnergy(),
-								ele.getId());
-					}
-					controller.calculateStateAndVisualForTimeStep(model.getCurIteration());
-					triggerUpdateController(null);
-					contentPane.updateUI();
-				}
-			} else {
-				JOptionPane.showMessageDialog(contentPane, "No object selected.\nPlease select a object first.",
-						"Message", JOptionPane.INFORMATION_MESSAGE);
-			}
-		});
-		btnAddHolEL.setIcon(new ImageIcon(ImageImport.loadImage("Images/plus.png", 16, 16)));
-		btnAddHolEL.setToolTipText("<html><b>Add Element</b><br>Add a new HolonElement to the HolonObject.</html>");
 
-		/*
-		 * Delete the chosen HolonElement of the selected HolonObject, Multi-Selection
-		 * for CpsObjects as well as for HolonElements possible
-		 */
-		btnDelHolEL.addActionListener(actionEvent -> {
-			// For Single Selection of CpsObject
-			if (model.getSelectedObjects().size() == 1) {
-				if (updCon.getActualCps().getClass() == HolonObject.class) {
-					HolonObject obj = (HolonObject) updCon.getActualCps();
-					if (selectedElements.isEmpty()) {
-						JOptionPane.showMessageDialog(contentPane,
-								"No element selectet.\nPlease select a element in the list first.", "Message",
-								JOptionPane.INFORMATION_MESSAGE);
-					}
-					for (HolonElement e : selectedElements) {
-						controller.deleteElementCanvas(obj.getId(), e.getId());
-						controller.calculateStateAndVisualForCurrentTimeStep();
-						triggerUpdateController(null);
-						contentPane.updateUI();
-						// Names displayed in graph are not updated
-					}
-					model.getEleToDelete().clear();
-					selectedElements.clear();
-				}
-				// For MultiSelection of CpsObject
-			} else if (model.getSelectedObjects().size() > 1) {
-				for (Integer i : model.getEleToDelete().keySet()) {
-					for (HolonElement e : model.getEleToDelete().get(i)) {
-						controller.deleteElementCanvas(i, e.getId());
-					}
-				}
-				triggerUpdateController(null);
-				model.getEleToDelete().clear();
-				selectedElements.clear();
-			} else {
-				JOptionPane.showMessageDialog(contentPane, "No object selectet.\nPlease select a object first.",
-						"No object selectet", JOptionPane.INFORMATION_MESSAGE);
-			}
-			triggerUpdateController(null);
-			elementGraph.setText("None");
-			holonEleNamesDisplayed = "None";
-		});
-		btnDelHolEL.setIcon(new ImageIcon(ImageImport.loadImage("Images/minus.png", 16, 16)));
-		btnDelHolEL.setToolTipText(
-				"<html><b>Remove Element</b><br>Removes the selected HolonElement from the HolonObject.</html>");
 
+	
 		/***********************
 		 * HolonElement Graph Actions
 		 **********************/
@@ -1124,8 +993,6 @@ public class GUI {
 							.getPathForLocation(e.getX(), e.getY()).getLastPathComponent();
 					if (selectedNode.getLevel() == 2) {
 						controller.searchCategoryObject(selectedNode.getParent().toString(), selectedNode.toString());
-						updCon.deleteRows(model.getSingleTable());
-						updCon.deleteRows(model.getMultiTable());
 						// if (selected instanceof HolonObject && selected !=
 						// null) {
 						// selected = (HolonObject) selected;
@@ -1328,7 +1195,6 @@ public class GUI {
 			controller.setSelectedObjectID(0);
 			controller.setSelecteEdge(null);
 			controller.setCurIteration(0);
-			hideScrollGraph();
 			elementGraph.setText("None");
 			canvas.tempCps = null;
 			canvas.repaint();
@@ -1426,7 +1292,6 @@ public class GUI {
 
 					controller.calculateStateAndVisualForCurrentTimeStep();
 					canvas.repaint();
-					hideScrollGraph();
 				} catch (IOException e) {
 					e.printStackTrace();
 				}
@@ -1447,7 +1312,6 @@ public class GUI {
 
 					controller.calculateStateAndVisualForCurrentTimeStep();
 					canvas.repaint();
-					hideScrollGraph();
 				} catch (IOException e) {
 					e.printStackTrace();
 				}
@@ -1486,19 +1350,16 @@ public class GUI {
 
 		splitGraphHolonEl.setTopComponent(inspector);
 		splitGraphHolonEl.setDividerLocation(distanceBetweenElementsAndGraph);
-		splitGraphHolonEl.setBottomComponent(scrollGraph);
 		canvasSP.setViewportView(canvas);
 
 		tabbedPaneOriginal.setBorder(null);
 		scrollProperties.setBorder(null);
-		scrollGraph.setBorder(null);
 		splitPane.setBorder(null);
 		splitPane1.setBorder(null);
 		splitHolonElPro.setBorder(null);
 		splitGraphHolonEl.setBorder(null);
 		panelHolonEl.setBorder(null);
 		canvasSP.setBorder(null);
-		hideScrollGraph();
 
 		holegJFrame.getContentPane().add(timePanel, BorderLayout.SOUTH);
 
@@ -1598,19 +1459,6 @@ public class GUI {
 			out.update();
 		}
 	}
-
-	private void showScrollGraph() {
-		scrollGraph.setVisible(true);
-		splitGraphHolonEl.setBottomComponent(scrollGraph);
-		splitGraphHolonEl.setDividerLocation(distanceBetweenElementsAndGraph);
-	}
-
-	private void hideScrollGraph() {
-		scrollGraph.setVisible(false);
-		splitGraphHolonEl.remove(scrollGraph);
-		splitGraphHolonEl.setDividerLocation(0);
-	}
-
 	private boolean isUpperPanelInsideBounds() {
 		int x = holegJFrame.getX();
 		int y = holegJFrame.getY();
@@ -1688,28 +1536,6 @@ public class GUI {
 		holegJFrame.setVisible(value);
 	}
 
-	/**
-	 * Checks if a double click was made.
-	 *
-	 * @return true if doublecklick, false if not
-	 */
-	private boolean doubleClick() {
-		if (click) {
-			click = false;
-			return true;
-		} else {
-			click = true;
-			Timer t = new Timer("doubleclickTimer", false);
-			t.schedule(new TimerTask() {
-				@Override
-				public void run() {
-					click = false;
-				}
-			}, 350);
-		}
-		return false;
-	}
-
 	/*
 	 * Open a new Tab with an UpperNodeCanvas
 	 */
@@ -1831,67 +1657,8 @@ public class GUI {
 		}
 	}
 
-	public void triggerUpdateController(AbstractCanvasObject temp) {
-		if (model != null) {
-			return;
-		}
-		if (temp != null) {
-			updCon.paintProperties(temp);
-		}
-		updCon.refreshTableProperties(model.getPropertyTable());
-	}
+	
 
-	/**
-	 * This Method updates the UnitGraph, saves the old LocalModeState and load the
-	 * new LocalModeState.
-	 * 
-	 * @param element The new Element to load the UnitGraph
-	 */
-	private void updateUnitGraph(GraphEditable element) {
-		// SaveOld LocalMode State.
-		if (localPeriodInput.isVisible()) {
-			// Save Old State
-			validateInput(localPeriodInput.getEditor().getItem().toString(), false);
-		}
-		// Update UnitGraph
-		unitGraph.initNewElement(element);
-		// Load LocalMode State.
-		changeLocalPeriodButtonAppeareance(unitGraph.isUsingLocalPeriod());
-		localPeriodInput.getEditor().setItem(unitGraph.getLocalPeriod());
-	}
-
-	/**
-	 * Displayed the actual LocalModeState.
-	 * 
-	 * @param enabled
-	 */
-	private void changeLocalPeriodButtonAppeareance(boolean enabled) {
-		localPeriodInput.setVisible(enabled);
-		if (enabled) {
-			localPeriodButtonImage.setImage(ImageImport.loadImage("/Images/Graph.png"));
-		} else {
-			localPeriodButtonImage.setImage(GrayFilter.createDisabledImage(ImageImport.loadImage("/Images/Graph.png")));
-		}
-	}
-
-	/**
-	 * Validate the LocalMode Input and when its valid save on the Element.
-	 * 
-	 * @param text         the inputText to validate.
-	 * @param bShowMessage when true, open a MessageDialog when text invalid.
-	 */
-	private void validateInput(String text, boolean bShowMessage) {
-		int localPeriodInputValue;
-		try {
-			localPeriodInputValue = Integer.parseInt(text);
-		} catch (NumberFormatException e) {
-			if (bShowMessage)
-				JOptionPane.showMessageDialog(contentPane,
-						'"' + text + '"' + " is not a valid Input. \n Use whole numbers.");
-			return;
-		}
-		unitGraph.setLocalPeriod(localPeriodInputValue);
-	}
 
 	private void openWebpage(String URL) {
 		try {

+ 154 - 0
src/ui/view/main/Inspector.java

@@ -0,0 +1,154 @@
+package ui.view.main;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ItemEvent;
+
+import javax.swing.Box;
+import javax.swing.GrayFilter;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JToolBar;
+
+import interfaces.GraphEditable;
+import ui.controller.Control;
+import utility.ImageImport;
+
+public class Inspector extends JSplitPane {
+	private final UnitGraph unitGraph;
+	private final InspectorTable table;
+	private final Control control;
+	private final JScrollPane scrollGraph = new JScrollPane();
+	private final JPanel graphLabel = new JPanel();
+	private final JLabel maxGraph = new JLabel("100%");
+	private final JLabel medGraph = new JLabel("50%");
+	private final JLabel minGraph = new JLabel("0%");
+	private final JToolBar toolBarGraph = new JToolBar();
+	private String[] comboContext = { "", "5", "10", "20", "100", "1000" };
+	private JComboBox<String> localPeriodInput = new JComboBox<String>(comboContext);
+	private JButton resetButton = new JButton("", new ImageIcon(ImageImport.loadImage("/Images/resetIcon3.png")));
+	private final ImageIcon localPeriodButtonImageEnabled = new ImageIcon(
+			ImageImport.loadImage("/Images/Graph.png"));
+	
+	private final ImageIcon localPeriodButtonImageDisabled = new ImageIcon(
+			GrayFilter.createDisabledImage(ImageImport.loadImage("/Images/Graph.png")));
+	private JButton localPeriodButton = new JButton("", localPeriodButtonImageEnabled);
+	
+	public Inspector(Control control) {
+		this.control = control;
+		table = new InspectorTable(control);
+		unitGraph = new UnitGraph(control);
+		initUI();
+		
+	}
+	private void initUI() {
+		this.setOrientation(JSplitPane.VERTICAL_SPLIT);
+		JScrollPane scrollPane = new JScrollPane(table);
+		scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+		this.setTopComponent(scrollPane);
+		this.setBottomComponent(scrollGraph);
+		this.setDividerLocation(1000);
+		
+		scrollGraph.setViewportView(unitGraph);
+		// Set up of the Properties section
+
+
+		graphLabel.setLayout(new BorderLayout(0, 10));
+		graphLabel.add(maxGraph, BorderLayout.NORTH);
+		graphLabel.add(medGraph, BorderLayout.CENTER);
+		graphLabel.add(minGraph, BorderLayout.SOUTH);
+
+		toolBarGraph.setFloatable(false);
+		toolBarGraph.setAlignmentY(Component.RIGHT_ALIGNMENT);
+
+		localPeriodButton.setToolTipText("Toggle Local/Global Mode");
+		toolBarGraph.add(localPeriodButton);
+		// ComboBox
+		localPeriodInput.setEditable(true);
+		localPeriodInput.setVisible(false);
+		localPeriodInput.setMaximumSize(new Dimension(20, 23));
+		localPeriodInput.addItemListener(aListener -> {
+			if (aListener.getStateChange() == ItemEvent.DESELECTED) {
+				validateInput(localPeriodInput.getEditor().getItem().toString(), true);
+			}
+
+		});
+
+		toolBarGraph.add(localPeriodInput);
+
+		// localPeriodButtonFunction
+		localPeriodButton.addActionListener(actionEvent -> {
+			boolean newState = !localPeriodInput.isVisible();
+			changeLocalPeriodButtonAppeareance(newState);
+			unitGraph.setUseLocalPeriod(newState);
+		});
+
+		toolBarGraph.add(Box.createHorizontalGlue());
+		resetButton.setToolTipText("Reset");
+		resetButton.addActionListener(actionEvent -> unitGraph.reset());
+		toolBarGraph.add(resetButton);
+		scrollGraph.setRowHeaderView(graphLabel);
+		scrollGraph.setColumnHeaderView(toolBarGraph);
+		
+	}
+	
+	/**
+	 * Validate the LocalMode Input and when its valid save on the Element.
+	 * 
+	 * @param text         the inputText to validate.
+	 * @param bShowMessage when true, open a MessageDialog when text invalid.
+	 */
+	private void validateInput(String text, boolean bShowMessage) {
+		int localPeriodInputValue;
+		try {
+			localPeriodInputValue = Integer.parseInt(text);
+		} catch (NumberFormatException e) {
+			if (bShowMessage)
+				JOptionPane.showMessageDialog(null,
+						'"' + text + '"' + " is not a valid Input. \n Use whole numbers.");
+			return;
+		}
+		unitGraph.setLocalPeriod(localPeriodInputValue);
+	}
+	
+	/**
+	 * This Method updates the UnitGraph, saves the old LocalModeState and load the
+	 * new LocalModeState.
+	 * 
+	 * @param element The new Element to load the UnitGraph
+	 */
+	private void updateUnitGraph(GraphEditable element) {
+		// SaveOld LocalMode State.
+		if (localPeriodInput.isVisible()) {
+			// Save Old State
+			validateInput(localPeriodInput.getEditor().getItem().toString(), false);
+		}
+		// Update UnitGraph
+		unitGraph.initNewElement(element);
+		// Load LocalMode State.
+		changeLocalPeriodButtonAppeareance(unitGraph.isUsingLocalPeriod());
+		localPeriodInput.getEditor().setItem(unitGraph.getLocalPeriod());
+	}
+
+	/**
+	 * Displayed the actual LocalModeState.
+	 * 
+	 * @param enabled
+	 */
+	private void changeLocalPeriodButtonAppeareance(boolean enabled) {
+		localPeriodInput.setVisible(enabled);
+		if (enabled) {
+			localPeriodButton.setIcon(localPeriodButtonImageEnabled);
+		} else {
+			localPeriodButton.setIcon(localPeriodButtonImageDisabled);
+		}
+	}
+
+}

+ 340 - 0
src/ui/view/main/InspectorTable.java

@@ -0,0 +1,340 @@
+package ui.view.main;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.math.RoundingMode;
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Locale;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import javax.swing.text.NumberFormatter;
+
+import classes.AbstractCanvasObject;
+import classes.HolonElement;
+import classes.HolonElement.Priority;
+import classes.HolonObject;
+import net.miginfocom.swing.MigLayout;
+import ui.controller.Control;
+import ui.view.component.TrippleCheckBox;
+import ui.view.component.TrippleCheckBox.State;
+import utility.ImageImport;
+import utility.events.SimpleDocumentListener;
+
+public class InspectorTable extends JPanel {
+	private List<ElementRow> elementRows = new ArrayList<ElementRow>();
+	private Control control;
+	private final int columnHeight = 20;
+
+	//UI
+	private final TrippleCheckBox selectAllCheckBox = new TrippleCheckBox();
+	private final JButton addButton = new JButton();
+	private final JButton duplicateButton = new JButton();
+	private final JButton deleteButton = new JButton();
+	private final JPanel buttonPanel = new JPanel();
+	private final NumberFormatter doubleFormatter = generateNumberFormatter();
+	
+	//Colors
+	private final Color selectedColor = new Color(126, 186, 255);
+	private final Color borderColor = new Color(171, 173, 179);
+
+	public InspectorTable(Control control) {
+		control.OnSelectionChanged.addListener(() -> update_ui());
+		this.control = control;
+		init();
+		generateHeader();
+	}
+
+	private void init() {
+		MigLayout layout = new MigLayout("insets 0,gap 0,wrap 7", // Layout Constraints
+				"[][fill, grow][][fill, grow][fill, grow][][]", // Column constraints
+				"[25!][20:20:20]"); // Row constraints
+		this.setLayout(layout);
+		initSelectAllCheckBox();
+		initButtonPanel();
+	}
+
+	private void generateHeader() {
+
+		this.add(selectAllCheckBox);
+		this.add(generateHeaderColumnTitle("Object"));
+		this.add(generateHeaderColumnTitle("Id "));
+		this.add(generateHeaderColumnTitle("Device"));
+		this.add(generateHeaderColumnTitle("Energy"));
+		this.add(generateHeaderColumnTitle("Priority"));
+		this.add(generateHeaderColumnTitle("Activ"));
+	}
+
+	private void initSelectAllCheckBox() {
+		selectAllCheckBox.setBorder(generateButtonHeaderBorder());
+		// Pixel Perfect alignment
+		selectAllCheckBox.setBorder(BorderFactory.createEmptyBorder(2, 3, 0, 0));
+		selectAllCheckBox.addActionListener(clicked -> {
+			switch (selectAllCheckBox.getSelectionState()) {
+			case mid_state_selection:
+			case selected: {
+				for (ElementRow row : elementRows) {
+					row.setSelected(false);
+				}
+				duplicateButton.setEnabled(false);
+				deleteButton.setEnabled(false);
+			}
+				break;
+			case unselected:
+				for (ElementRow row : elementRows) {
+					row.setSelected(true);
+				}
+				duplicateButton.setEnabled(true);
+				deleteButton.setEnabled(true);
+			default:
+				break;
+			}
+		});
+	}
+
+	public void update_ui() {
+		System.out.println("update_ui");
+		List<HolonElement> elements = extractElements(control.getModel().getSelectedObjects());
+		// TODO Pooling
+		this.removeAll();
+		elementRows.clear();
+		generateHeader();
+		for (HolonElement element : elements) {
+			elementRows.add(new ElementRow(element));
+		}
+		this.add(buttonPanel, "span");
+		duplicateButton.setEnabled(false);
+		deleteButton.setEnabled(false);
+		selectAllCheckBox.setSelectionState(State.unselected);
+		revalidate();
+		repaint();
+	}
+
+	private JLabel generateHeaderColumnTitle(String string) {
+		JLabel columnTitleLabel = new JLabel(string);
+		columnTitleLabel.setToolTipText(string);
+		columnTitleLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+		return columnTitleLabel;
+	}
+
+	private void initButtonPanel() {
+		buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
+		buttonPanel.add(Box.createRigidArea(new Dimension(2, 0)));
+
+		addButton.setIcon(new ImageIcon(ImageImport.loadImage("Images/plus.png", 16, 16)));
+		addButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+		addButton.addActionListener(clicked -> {
+			System.out.println("AddButton");
+			Optional<HolonObject> last = control.getModel().getSelectedObjects().stream()
+					.filter(obj -> obj instanceof HolonObject).reduce((prev, next) -> next)
+					.map(obj -> (HolonObject) obj);
+			last.ifPresent(obj -> {
+				obj.addElement(new HolonElement(obj, "Element", 0.0f));
+			});
+			control.calculateStateAndVisualForCurrentTimeStep();
+			update_ui();
+		});
+		buttonPanel.add(addButton);
+
+		duplicateButton.setIcon(new ImageIcon(ImageImport.loadImage("Images/duplicate.png", 16, 16)));
+		duplicateButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+		duplicateButton.addActionListener(clicked -> {
+			for (ElementRow row : elementRows) {
+				if(row.isSelected()) {
+					row.element.parentObject.addElement(new HolonElement(row.element));
+				}
+			}
+			control.calculateStateAndVisualForCurrentTimeStep();
+			update_ui();
+		});
+		buttonPanel.add(duplicateButton);
+
+		deleteButton.setIcon(new ImageIcon(ImageImport.loadImage("Images/minus.png", 16, 16)));
+		deleteButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+		deleteButton.addActionListener(clicked -> {
+			for (ElementRow row : elementRows) {
+				if(row.isSelected()) {
+					row.element.parentObject.removeElement(row.element);
+				}
+			}
+			control.calculateStateAndVisualForCurrentTimeStep();
+			update_ui();
+		});
+		buttonPanel.add(deleteButton);
+	}
+
+	// Extract elements from a list of AbstractCanvasObjects
+	private List<HolonElement> extractElements(Collection<AbstractCanvasObject> toInspect) {
+		return toInspect.stream().filter(obj -> obj instanceof HolonObject).flatMap(obj -> {
+			HolonObject ho = (HolonObject) obj;
+			return ho.getElements().stream();
+		}).collect(Collectors.toList());
+	}
+
+	private NumberFormatter generateNumberFormatter() {
+		NumberFormat doubleFormat = NumberFormat.getNumberInstance(Locale.US);
+		doubleFormat.setMinimumFractionDigits(1);
+		doubleFormat.setMaximumFractionDigits(10);
+		doubleFormat.setRoundingMode(RoundingMode.HALF_UP);
+		doubleFormat.setGroupingUsed(false);
+		NumberFormatter doubleFormatter = new NumberFormatter(doubleFormat);
+		doubleFormatter.setCommitsOnValidEdit(true);
+		doubleFormatter.setValueClass(Double.class);
+		return doubleFormatter;
+	}
+
+	private Border generateButtonHeaderBorder() {
+		return BorderFactory.createEmptyBorder(2, 0, 0, 0);
+	}
+
+	private void setSelectAllCheckBox() {
+		long count = elementRows.stream().filter(ele -> ele.isSelected()).count();
+		if (count == elementRows.size()) {
+			selectAllCheckBox.setSelectionState(State.selected);
+		} else if (count == 0) {
+			selectAllCheckBox.setSelectionState(State.unselected);
+		} else {
+			selectAllCheckBox.setSelectionState(State.mid_state_selection);
+		}
+		duplicateButton.setEnabled(count != 0);
+		deleteButton.setEnabled(count != 0);
+		selectAllCheckBox.repaint();
+	}
+
+	private class ElementRow {
+		HolonElement element;
+		private JCheckBox selectionBox;
+		Container[] cellsInRow = new Container[7];
+
+		ElementRow(HolonElement element) {
+			this.element = element;
+			this.createEditFields();
+			addContainerToInspector();
+		}
+
+		private void addContainerToInspector() {
+			for (Container cell : cellsInRow) {
+				InspectorTable.this.add(cell);
+			}
+		}
+
+		public void setSelected(boolean value) {
+			selectionBox.setSelected(value);
+			// Color row
+			for (Container cell : cellsInRow) {
+				cell.setBackground(selectionBox.isSelected() ? selectedColor : Color.white);
+			}
+		}
+
+		public boolean isSelected() {
+			return selectionBox.isSelected();
+		}
+
+		private void createEditFields() {
+			// Selected
+			JPanel selectedColumnPanel = new JPanel(new BorderLayout());
+			selectedColumnPanel.setBackground(Color.white);
+			selectedColumnPanel.setBorder(BorderFactory.createLineBorder(borderColor));
+			selectionBox = new JCheckBox();
+			selectionBox.addActionListener(clicked -> {
+				setSelected(selectionBox.isSelected());
+				setSelectAllCheckBox();
+			});
+			selectedColumnPanel.setMinimumSize(new Dimension(columnHeight, columnHeight));
+			selectedColumnPanel.setPreferredSize(new Dimension(columnHeight, columnHeight));
+			selectedColumnPanel.setMaximumSize(new Dimension(columnHeight, columnHeight));
+			selectionBox.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
+			selectionBox.setOpaque(false);
+			selectedColumnPanel.add(selectionBox, BorderLayout.CENTER);
+			cellsInRow[0] = selectedColumnPanel;
+
+			// ObjectName and ID
+			JTextField objectNameTextField = new JTextField(this.element.parentObject.getName());
+			objectNameTextField.getDocument().addDocumentListener((SimpleDocumentListener) e -> {
+				this.element.parentObject.setName(objectNameTextField.getText());
+			});
+			objectNameTextField.addActionListener(ae -> update_ui());
+			cellsInRow[1] = objectNameTextField;
+			JTextField idObjectTextField = new JTextField(Integer.toString(this.element.parentObject.getId()));
+			idObjectTextField.setMinimumSize(idObjectTextField.getPreferredSize());
+			idObjectTextField.setBackground(Color.white);
+			idObjectTextField.setEditable(false);
+			idObjectTextField.setEnabled(false);
+			cellsInRow[2] = idObjectTextField;
+			// Name
+			JTextField elementNameTextField = new JTextField(this.element.getEleName());
+			elementNameTextField.getDocument().addDocumentListener((SimpleDocumentListener) e -> {
+				this.element.setEleName(elementNameTextField.getText());
+			});
+			elementNameTextField.setBackground(Color.white);
+			cellsInRow[3] = elementNameTextField;
+			// Energy
+
+			JFormattedTextField energyTextField = new JFormattedTextField(doubleFormatter);
+			energyTextField.setInputVerifier(getInputVerifier());
+			energyTextField.setValue(this.element.getEnergy());
+			energyTextField.setBackground(Color.white);
+			energyTextField.addPropertyChangeListener(actionEvent -> {
+				try {
+					float energy = Float.parseFloat(energyTextField.getText());
+					if (this.element.getEnergy() != energy) {
+						this.element.setEnergyPerElement(energy);
+						control.calculateStateAndVisualForCurrentTimeStep();
+					}
+				} catch (NumberFormatException e) {
+					// Dont Update
+				}
+
+			});
+			cellsInRow[4] = energyTextField;
+
+			// Priority
+			JComboBox<Priority> comboBox = new JComboBox<Priority>(Priority.values());
+			comboBox.setSelectedItem(this.element.getPriority());
+			comboBox.setBackground(Color.white);
+			comboBox.setEditable(false);
+			comboBox.addActionListener(ae -> {
+				this.element.setPriority((Priority) comboBox.getSelectedItem());
+			});
+			cellsInRow[5] = comboBox;
+
+			// Active Delete Column
+
+			JPanel checkBoxWrapperPanel = new JPanel(new BorderLayout());
+			checkBoxWrapperPanel.setBorder(BorderFactory.createLineBorder(borderColor));
+			checkBoxWrapperPanel.setBackground(Color.white);
+			checkBoxWrapperPanel.setMinimumSize(new Dimension(columnHeight, columnHeight));
+			checkBoxWrapperPanel.setMaximumSize(new Dimension(columnHeight, columnHeight));
+			// Active
+			JCheckBox checkbox = new JCheckBox();
+			checkbox.setSelected(this.element.isActive());
+			checkbox.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
+			checkbox.setOpaque(false);
+			checkbox.addActionListener(actionEvent -> {
+				this.element.setActive(checkbox.isSelected());
+				control.calculateStateAndVisualForCurrentTimeStep();
+			});
+			checkBoxWrapperPanel.add(checkbox, BorderLayout.CENTER);
+			cellsInRow[6] = checkBoxWrapperPanel;
+		}
+
+	}
+}

+ 54 - 0
src/ui/view/main/Main.java

@@ -0,0 +1,54 @@
+package ui.view.main;
+
+import ui.controller.Control;
+import ui.controller.IndexTranslator;
+import ui.model.Model;
+
+import javax.swing.*;
+
+import java.awt.*;
+import java.util.Locale;
+
+/**
+ * The main Class in this Program. The GUI is created in this Class.
+ * 
+ * @author Gruppe14
+ * 
+ */
+public class Main {
+
+	/**
+	 * main method of this program.
+	 * 
+	 * @param args standard
+	 */
+	public static void main(String[] args) {
+		setLookAndFeel();
+		setLocale();
+		EventQueue.invokeLater(() -> {
+				Model model = new Model();
+				Control control = new Control(model);
+				GUI view = new GUI(control);
+				IndexTranslator.model = model;
+				view.setVisible(true);
+		});
+	}
+
+	private static void setLocale() {
+		Locale.setDefault(Locale.US);
+	}
+
+	/**
+	 * This method loads the System LookAndFeel. Except for Linux OS.
+	 */
+	private static void setLookAndFeel() {
+		try {
+			if (!System.getProperty("os.name").startsWith("Linux")) {
+				UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+			}
+		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException
+				| UnsupportedLookAndFeelException e) {
+		}
+	}
+
+}

+ 1 - 1
src/ui/view/TimePanel.java → src/ui/view/main/TimePanel.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.main;
 
 import java.awt.BorderLayout;
 import java.awt.Color;

+ 7 - 8
src/ui/view/UnitGraph.java → src/ui/view/main/UnitGraph.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.main;
 
 import java.awt.BasicStroke;
 import java.awt.Color;
@@ -53,18 +53,17 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	
 	//Intern Variables
 	private LinkedList<UnitGraphPoint> actualGraphPoints = new LinkedList<UnitGraphPoint>();
-	private Graphtype actualGraphType;
+	private Graphtype actualGraphType = Graphtype.doubleGraph;
 	private GraphEditable actualElement;
 	Vector2Int editPosition;
 	boolean editMode = false;
 	private enum pointType {Normal, StartPoint, EndPoint};
 	pointType editPoint = pointType.Normal;
-	
-	//Maybe Needed
 	private Model model;
+	private int widthWithBorder, heightWithBorder;
+	
 	
 	
-	private int widthWithBorder, heightWithBorder;
 	
 	
 	
@@ -77,9 +76,9 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
      * @param model   the Model
      * @param control the Controller
      */
-    public UnitGraph(final Model model, Control control) {
+    public UnitGraph(Control control) {
         setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
-        this.model = model;
+        this.model = control.getModel();
         this.setBackground(Color.WHITE);
 
         this.addMouseListener(this);
@@ -397,7 +396,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
      * @param g2D to draw.
      */
     private void drawDoubleGraph(Graphics2D g) {
-    	if(actualGraphPoints.isEmpty()) throw new IndexOutOfBoundsException("A Graph Without Points is not supportet jet");
+    	if(actualGraphPoints.isEmpty()) return;//throw new IndexOutOfBoundsException("A Graph Without Points is not supportet jet");
     	ListIterator<UnitGraphPoint> iter = actualGraphPoints.listIterator();
     	Vector2Int actual = iter.next().displayedPosition;
     	Path2D.Double path = this.initBezier(actual);

+ 2 - 2
src/ui/view/AddOnWindow.java → src/ui/view/window/AddOnWindow.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.window;
 
 import java.awt.BorderLayout;
 import java.awt.Dimension;
@@ -33,7 +33,7 @@ public class AddOnWindow extends JFrame{
 	private AddOn actual;
 	private Control control;
 	private JPanel content = new JPanel();
-	AddOnWindow(JFrame parentFrame, Control control){
+	public AddOnWindow(JFrame parentFrame, Control control){
 		this.control = control;
 		this.setTitle("Add-Ons");
 		this.setVisible(true);

+ 1 - 1
src/ui/view/FlexWindow.java → src/ui/view/window/FlexWindow.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.window;
 
 import java.awt.BorderLayout;
 import java.awt.Color;

+ 2 - 2
src/ui/view/Outliner.java → src/ui/view/window/Outliner.java

@@ -1,4 +1,4 @@
-package ui.view;
+package ui.view.window;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -41,7 +41,7 @@ public class Outliner extends JFrame {
 	JPanel statePanel = new JPanel(new BorderLayout());
 	public boolean isClosed = false;
 	ArrayList<MinimumNetwork> list;
-	Outliner(JFrame parentFrame, Model model, Control controller){ 
+	public Outliner(JFrame parentFrame, Model model, Control controller){ 
 		setBounds(0, 0, 400, parentFrame.getHeight());
 		this.setIconImage(ImageImport.loadImage("/Images/Holeg.png", 30, 30));
 		this.setTitle("Outliner");