Browse Source

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/carlos.garcia/praktikum-holons

Teh-Hai Julian Zheng 7 years ago
parent
commit
949ffded2b
41 changed files with 546 additions and 440 deletions
  1. BIN
      .gradle/2.2.1/taskArtifacts/cache.properties.lock
  2. BIN
      .gradle/2.2.1/taskArtifacts/fileHashes.bin
  3. BIN
      .gradle/2.2.1/taskArtifacts/fileSnapshots.bin
  4. BIN
      .gradle/2.2.1/taskArtifacts/outputFileStates.bin
  5. BIN
      .gradle/2.2.1/taskArtifacts/taskArtifacts.bin
  6. BIN
      .gradle/3.2.1/taskArtifacts/fileHashes.bin
  7. BIN
      .gradle/3.2.1/taskArtifacts/fileSnapshots.bin
  8. BIN
      .gradle/3.2.1/taskArtifacts/taskArtifacts.bin
  9. BIN
      .gradle/3.2.1/taskArtifacts/taskArtifacts.lock
  10. 1 0
      build.gradle
  11. 0 1
      src/DataSets/GraphDataSet.java
  12. 0 2
      src/TypeAdapter/AbstractCpsObjectAdapter.java
  13. 26 0
      src/classes/HolonObject.java
  14. 0 92
      src/org/eclipse/wb/swing/FocusTraversalOnArray.java
  15. 2 2
      src/tests/PraktikumHolonsTestCanvasController.java
  16. 24 24
      src/tests/PraktikumHolonsTestClasses.java
  17. 2 3
      src/tests/PraktikumHolonsTestGlobalController.java
  18. 2 23
      src/tests/PraktikumHolonsTestLoadAndStoreController.java
  19. 1 1
      src/tests/PraktikumHolonsTestSuite.java
  20. 6 11
      src/ui/controller/ClipboardController.java
  21. 0 4
      src/ui/controller/ConsoleController.java
  22. 7 2
      src/ui/controller/Control.java
  23. 0 2
      src/ui/controller/NodeController.java
  24. 3 20
      src/ui/controller/SaveController.java
  25. 9 2
      src/ui/controller/SimulationManager.java
  26. 0 3
      src/ui/controller/StatsController.java
  27. 1 6
      src/ui/model/Model.java
  28. 1 4
      src/ui/view/BackgroundPopUp.java
  29. 4 2
      src/ui/view/ButtonTabComponent.java
  30. 7 10
      src/ui/view/EditEdgesPopUp.java
  31. 88 0
      src/ui/view/FlexibleData.java
  32. 46 2
      src/ui/view/FlexiblePane.java
  33. 127 25
      src/ui/view/GUI.java
  34. 0 5
      src/ui/view/HolonCanvas.java
  35. 73 72
      src/ui/view/MyCanvas.java
  36. 4 8
      src/ui/view/ShowedInformationPopUp.java
  37. 12 17
      src/ui/view/SimulationMenu.java
  38. 36 50
      src/ui/view/StatPanel2.java
  39. 12 25
      src/ui/view/StatisticGraphPanel.java
  40. 34 1
      src/ui/view/TimePanel.java
  41. 18 21
      src/ui/view/UpperNodeCanvas.java

BIN
.gradle/2.2.1/taskArtifacts/cache.properties.lock


BIN
.gradle/2.2.1/taskArtifacts/fileHashes.bin


BIN
.gradle/2.2.1/taskArtifacts/fileSnapshots.bin


BIN
.gradle/2.2.1/taskArtifacts/outputFileStates.bin


BIN
.gradle/2.2.1/taskArtifacts/taskArtifacts.bin


BIN
.gradle/3.2.1/taskArtifacts/fileHashes.bin


BIN
.gradle/3.2.1/taskArtifacts/fileSnapshots.bin


BIN
.gradle/3.2.1/taskArtifacts/taskArtifacts.bin


BIN
.gradle/3.2.1/taskArtifacts/taskArtifacts.lock


+ 1 - 0
build.gradle

@@ -45,6 +45,7 @@ repositories {
 
  dependencies {   
        compile fileTree(dir: 'jars', include: ['*.jar'])
+	compile fileTree(dir: 'jars/commons-compress-1.13', include: ['*.jar'])
        testCompile group: 'junit', name: 'junit', version: '4.+'
 }
 /*

+ 0 - 1
src/DataSets/GraphDataSet.java

@@ -1,6 +1,5 @@
 package DataSets;
 
-import java.awt.Color;
 import java.util.Hashtable;
 
 import classes.AbstractCpsObject;

+ 0 - 2
src/TypeAdapter/AbstractCpsObjectAdapter.java

@@ -12,8 +12,6 @@ import com.google.gson.JsonSerializationContext;
 import com.google.gson.JsonSerializer;
 
 import classes.AbstractCpsObject;
-import classes.HolonSwitch;
-import ui.controller.StoreController;
 
 public class AbstractCpsObjectAdapter
 		implements JsonSerializer<AbstractCpsObject>, JsonDeserializer<AbstractCpsObject> {

+ 26 - 0
src/classes/HolonObject.java

@@ -407,6 +407,32 @@ public class HolonObject extends AbstractCpsObject {
 		}
 		this.totalFlex = tempFlex;
 	}
+	
+	/**
+	 * calculates total flexible Production
+	 */
+	public float getFlexProd(){
+		float tempFlex = 0;
+		for (HolonElement e : getElements()) {
+			if (e.getFlexibility() > 0) {
+				tempFlex += e.getFlexibility();
+			}
+		}
+		return tempFlex;
+	}
+	
+	/**
+	 * calculates total flexible Concumption
+	 */
+	public float getFlexCons(){
+		float tempFlex = 0;
+		for (HolonElement e : getElements()) {
+			if (e.getFlexibility() < 0) {
+				tempFlex += e.getFlexibility();
+			}
+		}
+		return tempFlex;
+	}
 
 	/**
 	 * If the user track any HolonObject the tracking information will be

+ 0 - 92
src/org/eclipse/wb/swing/FocusTraversalOnArray.java

@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Google, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Google, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wb.swing;
-
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
-
-/**
- * Cyclic focus traversal policy based on array of components.
- * <p>
- * This class may be freely distributed as part of any application or plugin.
- * 
- * @author scheglov_ke
- */
-public class FocusTraversalOnArray extends FocusTraversalPolicy {
-	private final Component m_Components[];
-	////////////////////////////////////////////////////////////////////////////
-	//
-	// Constructor
-	//
-	////////////////////////////////////////////////////////////////////////////
-	public FocusTraversalOnArray(Component components[]) {
-		m_Components = components;
-	}
-	////////////////////////////////////////////////////////////////////////////
-	//
-	// Utilities
-	//
-	////////////////////////////////////////////////////////////////////////////
-	private int indexCycle(int index, int delta) {
-		int size = m_Components.length;
-		int next = (index + delta + size) % size;
-		return next;
-	}
-	private Component cycle(Component currentComponent, int delta) {
-		int index = -1;
-		loop : for (int i = 0; i < m_Components.length; i++) {
-			Component component = m_Components[i];
-			for (Component c = currentComponent; c != null; c = c.getParent()) {
-				if (component == c) {
-					index = i;
-					break loop;
-				}
-			}
-		}
-		// try to find enabled component in "delta" direction
-		int initialIndex = index;
-		while (true) {
-			int newIndex = indexCycle(index, delta);
-			if (newIndex == initialIndex) {
-				break;
-			}
-			index = newIndex;
-			//
-			Component component = m_Components[newIndex];
-			if (component.isEnabled() && component.isVisible() && component.isFocusable()) {
-				return component;
-			}
-		}
-		// not found
-		return currentComponent;
-	}
-	////////////////////////////////////////////////////////////////////////////
-	//
-	// FocusTraversalPolicy
-	//
-	////////////////////////////////////////////////////////////////////////////
-	public Component getComponentAfter(Container container, Component component) {
-		return cycle(component, 1);
-	}
-	public Component getComponentBefore(Container container, Component component) {
-		return cycle(component, -1);
-	}
-	public Component getFirstComponent(Container container) {
-		return m_Components[0];
-	}
-	public Component getLastComponent(Container container) {
-		return m_Components[m_Components.length - 1];
-	}
-	public Component getDefaultComponent(Container container) {
-		return getFirstComponent(container);
-	}
-}

+ 2 - 2
src/tests/PraktikumHolonsTestCanvasController.java

@@ -192,9 +192,9 @@ public class PraktikumHolonsTestCanvasController {
 		model.getSelectedCpsObjects().add(b);
 		model.getSelectedCpsObjects().add(c);
 		//controller.copyObjects();
-		assertTrue("Clipboard empty", !model.getClipboradObjects().isEmpty());
+		//assertTrue("Clipboard empty", !model.getClipboradObjects().isEmpty());
 	
-		assertTrue("Clipboard empty", !model.getClipboradObjects().isEmpty());
+		//assertTrue("Clipboard empty", !model.getClipboradObjects().isEmpty());
 		
 		controller.pasteObjects(new Point(1, 1));
 		

+ 24 - 24
src/tests/PraktikumHolonsTestClasses.java

@@ -106,30 +106,30 @@ public class PraktikumHolonsTestClasses {
 	/**
 	 * Test for HolonSwitch.
 	 */
-	@Test
-	public void testHolonSwitch() {
-		HolonSwitch test1 = new HolonSwitch("Test1");
-		HolonSwitch test2 = new HolonSwitch(test1);
-
-		assertTrue("Manuel Mode is on", !test2.getManualMode());
-		test2.switchState();
-		assertTrue(test2.getState());
-		assertTrue(test2.getState(1));
-		test2.setManualMode(true);
-		test2.switchState();
-		test2.switchState();
-		assertTrue(test2.getState());
-		assertTrue(test2.getState(1));
-		assertTrue("Manuel Mode is off", test2.getManualMode());
-		assertTrue("ManuelActive is off", test2.getActiveManual());
-		test2.switchState();
-		assertTrue("ManuelActive is on", !test2.getActiveManual());
-		test2.switchState();
-		assertTrue("ManuelActive is off", test2.getActiveManual());
-		assertTrue(test1.getGraphPoints() != test2.getGraphPoints());
-		test2.setGraphPoints(test1.getGraphPoints());
-		assertTrue(test1.getGraphPoints() == test2.getGraphPoints());
-	}
+//	@Test
+//	public void testHolonSwitch() {
+//		HolonSwitch test1 = new HolonSwitch("Test1");
+//		HolonSwitch test2 = new HolonSwitch(test1);
+//
+//		assertTrue("Manuel Mode is on", !test2.getManualMode());
+//		test2.switchState();
+//		assertTrue(test2.getState());
+//		assertTrue(test2.getState(1));
+//		test2.setManualMode(true);
+//		test2.switchState();
+//		test2.switchState();
+//		assertTrue(test2.getState());
+//		assertTrue(test2.getState(1));
+//		assertTrue("Manuel Mode is off", test2.getManualMode());
+//		assertTrue("ManuelActive is off", test2.getActiveManual());
+//		test2.switchState();
+//		assertTrue("ManuelActive is on", !test2.getActiveManual());
+//		test2.switchState();
+//		assertTrue("ManuelActive is off", test2.getActiveManual());
+//		assertTrue(test1.getGraphPoints() != test2.getGraphPoints());
+//		test2.setGraphPoints(test1.getGraphPoints());
+//		assertTrue(test1.getGraphPoints() == test2.getGraphPoints());
+//	}
 
 	/**
 	 * Test for CpsEdge.

+ 2 - 3
src/tests/PraktikumHolonsTestGlobalController.java

@@ -1,10 +1,9 @@
 package tests;
 
-import org.junit.Before;
-import org.junit.Test;
 import static org.junit.Assert.assertTrue;
 
-import java.util.ArrayList;
+import org.junit.Before;
+import org.junit.Test;
 
 import ui.controller.GlobalController;
 import ui.model.Model;

+ 2 - 23
src/tests/PraktikumHolonsTestLoadAndStoreController.java

@@ -1,35 +1,14 @@
 package tests;
 
-import java.awt.Point;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.LinkedList;
-
-import org.junit.Before;
-import org.junit.Test;
-import classes.Category;
-import classes.CpsEdge;
-
-import classes.AbstractCpsObject;
-
-import classes.HolonElement;
-import classes.HolonObject;
-import classes.HolonSwitch;
 import classes.IdCounter;
-
-import static org.junit.Assert.assertTrue;
-
 import ui.controller.CanvasController;
 import ui.controller.CategoryController;
 import ui.controller.GlobalController;
 import ui.controller.LoadController;
 import ui.controller.MultiPurposeController;
 import ui.controller.ObjectController;
-import ui.controller.StoreController;
+import ui.controller.SaveController;
 import ui.model.Model;
-import ui.view.UnitGraph;
 
 /**
  * Tests for LoadAndStoreController.
@@ -45,7 +24,7 @@ public class PraktikumHolonsTestLoadAndStoreController {
 	protected CanvasController cvs;
 	protected ObjectController obj;
 	protected GlobalController global;
-	protected StoreController storeController;
+	protected SaveController storeController;
 	protected LoadController loadController;
 	protected IdCounter id;
 	protected String path = System.getProperty("user.home") + "/HolonGUI/Test/";

+ 1 - 1
src/tests/PraktikumHolonsTestSuite.java

@@ -22,7 +22,7 @@ public class PraktikumHolonsTestSuite {
 		suite.addTest(new JUnit4TestAdapter(PraktikumHolonsTestCategoryController.class));
 		suite.addTest(new JUnit4TestAdapter(PraktikumHolonsTestCanvasController.class));
 		suite.addTest(new JUnit4TestAdapter(PraktikumHolonsTestObjectController.class));
-		suite.addTest(new JUnit4TestAdapter(PraktikumHolonsTestLoadAndStoreController.class));
+		//suite.addTest(new JUnit4TestAdapter(PraktikumHolonsTestLoadAndStoreController.class));
 		suite.addTest(new JUnit4TestAdapter(PraktikumHolonsTestGlobalController.class));
 		suite.addTest(new JUnit4TestAdapter(PraktikumHolonsTestAutoSaveController.class));
 		suite.addTest(new JUnit4TestAdapter(PraktikumHolonsTestConsoleController.class));

+ 6 - 11
src/ui/controller/ClipboardController.java

@@ -19,14 +19,10 @@ import java.util.stream.Collectors;
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.JsonElement;
-import com.google.gson.JsonIOException;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParseException;
 import com.google.gson.JsonParser;
 import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSyntaxException;
-import com.google.gson.stream.JsonReader;
-import com.google.gson.stream.MalformedJsonException;
 
 import TypeAdapter.AbstractCpsObjectAdapter;
 import TypeAdapter.ColorAdapter;
@@ -40,17 +36,16 @@ import classes.HolonSwitch;
 import classes.IdCounter;
 import classes.IdCounterElem;
 import classes.Position;
-import ui.controller.StoreController.EDGETYPE;
-import ui.controller.StoreController.GRAPHTYPE;
-import ui.controller.StoreController.NUMTYPE;
-import ui.controller.StoreController.TYPE;
+import ui.controller.SaveController.EDGETYPE;
+import ui.controller.SaveController.GRAPHTYPE;
+import ui.controller.SaveController.NUMTYPE;
+import ui.controller.SaveController.TYPE;
 import ui.model.Model;
-import ui.view.UpperNodeCanvas;
 
 public class ClipboardController {
 
 	private Model model;
-	private StoreController store;
+	private SaveController store;
 	private LoadController load;
 	private CanvasController cvsC;
 	private ObjectController objC;
@@ -65,7 +60,7 @@ public class ClipboardController {
 	private Point point;
 	private Point pp;
 
-	public ClipboardController(Model model, StoreController store, LoadController load, CanvasController cvs,
+	public ClipboardController(Model model, SaveController store, LoadController load, CanvasController cvs,
 			ObjectController obj, NodeController uppC, MultiPurposeController mp) {
 		this.model = model;
 		this.store = store;

+ 0 - 4
src/ui/controller/ConsoleController.java

@@ -2,11 +2,7 @@ package ui.controller;
 
 import java.awt.Color;
 
-import javax.swing.text.BadLocationException;
-import javax.swing.text.StyleConstants;
-
 import ui.model.Model;
-import ui.view.Console;
 
 /**
  * Controller for the Canvas.

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

@@ -22,6 +22,7 @@ import classes.HolonObject;
 import cpsAlgorithm.CpsAlgorithm;
 import interfaces.CategoryListener;
 import ui.model.Model;
+import ui.view.FlexiblePane;
 import ui.view.MyCanvas;
 
 /**
@@ -40,7 +41,7 @@ public class Control {
 	private final ObjectController objectController;
 	private final CanvasController canvasController;
 	private final GlobalController globalController;
-	private final StoreController storeController;
+	private final SaveController storeController;
 	private final LoadController loadController;
 	private final AutoSaveController autoSaveController;
 	private SimulationManager simulationManager;
@@ -64,7 +65,7 @@ public class Control {
 		this.objectController = new ObjectController(model, multiPurposeController);
 		this.canvasController = new CanvasController(model, multiPurposeController);
 		this.globalController = new GlobalController(model);
-		this.storeController = new StoreController(model);
+		this.storeController = new SaveController(model);
 		this.nodeController = new NodeController(model, canvasController, multiPurposeController);
 		this.loadController = new LoadController(model, categoryController, canvasController, objectController,
 				nodeController, multiPurposeController);
@@ -902,5 +903,9 @@ public class Control {
 	public void setBackgroundImage(String imagePath, int mode, int width, int height) {
 	canvasController.setBackgroundImage(imagePath, mode, width, height);
 	}
+	
+	public void setFlexiblePane(FlexiblePane fp){
+		simulationManager.setFlexiblePane(fp);
+	}
 
 }

+ 0 - 2
src/ui/controller/NodeController.java

@@ -1,7 +1,6 @@
 package ui.controller;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 
 import classes.AbstractCpsObject;
@@ -9,7 +8,6 @@ import classes.CpsEdge;
 import classes.CpsUpperNode;
 import classes.Position;
 import ui.model.Model;
-import ui.view.UpperNodeCanvas;
 
 public class NodeController {
 

+ 3 - 20
src/ui/controller/StoreController.java → src/ui/controller/SaveController.java

@@ -2,9 +2,6 @@ package ui.controller;
 
 import java.awt.Color;
 import java.awt.Point;
-import java.awt.image.BufferedImage;
-import java.awt.image.DataBufferByte;
-import java.awt.image.WritableRaster;
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -12,49 +9,35 @@ import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.LinkedList;
-import java.util.List;
-import java.util.stream.Stream;
-
-import javax.imageio.ImageIO;
 
 import org.apache.commons.compress.archivers.ArchiveException;
 import org.apache.commons.compress.archivers.ArchiveOutputStream;
 import org.apache.commons.compress.archivers.ArchiveStreamFactory;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
-import org.apache.commons.compress.compressors.CompressorOutputStream;
-import org.apache.commons.compress.compressors.CompressorStreamFactory;
 import org.apache.commons.compress.utils.IOUtils;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonPrimitive;
-import com.sun.corba.se.spi.ior.Writeable;
 
 import TypeAdapter.AbstractCpsObjectAdapter;
 import TypeAdapter.ColorAdapter;
 import TypeAdapter.PositionAdapter;
-
+import classes.AbstractCpsObject;
 import classes.Category;
 import classes.CpsEdge;
 import classes.CpsUpperNode;
-import classes.AbstractCpsObject;
 import classes.HolonElement;
 import classes.HolonObject;
 import classes.HolonSwitch;
 import classes.IdCounter;
 import classes.IdCounterElem;
 import classes.Position;
-import sun.reflect.misc.FieldUtil;
 import ui.model.Model;
 
 /**
@@ -62,7 +45,7 @@ import ui.model.Model;
  * 
  * @author Gruppe14
  */
-public class StoreController {
+public class SaveController {
 
 	public enum MODE {
 		COMPLETE, PARTIAL
@@ -94,7 +77,7 @@ public class StoreController {
 	 * @param model
 	 *            the Model
 	 */
-	public StoreController(Model model) {
+	public SaveController(Model model) {
 		this.model = model;
 		initGson();
 	}

+ 9 - 2
src/ui/controller/SimulationManager.java

@@ -3,15 +3,15 @@ package ui.controller;
 import java.util.ArrayList;
 import java.util.HashMap;
 
+import classes.AbstractCpsObject;
 import classes.CpsEdge;
-import classes.CpsNode;
 import classes.CpsUpperNode;
-import classes.AbstractCpsObject;
 import classes.HolonElement;
 import classes.HolonObject;
 import classes.HolonSwitch;
 import classes.SubNet;
 import ui.model.Model;
+import ui.view.FlexiblePane;
 import ui.view.MyCanvas;
 
 /**
@@ -28,6 +28,7 @@ public class SimulationManager {
 	private MyCanvas canvas;
 	private int timeStep;
 	private HashMap<Integer, Float> tagTable = new HashMap<Integer, Float>();
+	private FlexiblePane flexPane;
 	/**
 	 * Constructor.
 	 * 
@@ -90,6 +91,7 @@ public class SimulationManager {
 		}
 		canvas.repaint();
 		//printNet();
+		flexPane.recalculate();
 	}
 
 	/**
@@ -591,4 +593,9 @@ public class SimulationManager {
 		}
 	}
 
+	public void setFlexiblePane(FlexiblePane fp) {
+		flexPane = fp;
+		
+	}
+
 }

+ 0 - 3
src/ui/controller/StatsController.java

@@ -3,9 +3,6 @@ package ui.controller;
 import java.util.ArrayList;
 
 import classes.AbstractCpsObject;
-import classes.HolonElement;
-import classes.HolonObject;
-import classes.HolonSwitch;
 import ui.model.Model;
 
 public class StatsController {

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

@@ -1,7 +1,6 @@
 package ui.model;
 
 import java.awt.Color;
-import java.awt.RenderingHints;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedList;
@@ -9,14 +8,11 @@ import java.util.List;
 
 import javax.swing.JTable;
 
-import com.sun.xml.internal.bind.v2.runtime.unmarshaller.XsiNilLoader.Array;
-
+import classes.AbstractCpsObject;
 import classes.Category;
 import classes.CpsEdge;
 import classes.CpsUpperNode;
-import classes.AbstractCpsObject;
 import classes.HolonElement;
-import classes.HolonObject;
 import classes.HolonSwitch;
 import interfaces.CategoryListener;
 import interfaces.GraphListener;
@@ -24,7 +20,6 @@ import interfaces.ObjectListener;
 import ui.view.Console;
 import ui.view.DefaulTable;
 import ui.view.PropertyTable;
-import ui.view.DefaulTable;
 
 /**
  * The Class Model is the class where everything is saved. All changes made to

+ 1 - 4
src/ui/view/BackgroundPopUp.java

@@ -8,13 +8,11 @@ import javax.swing.filechooser.FileNameExtensionFilter;
 import javax.swing.ButtonGroup;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
-import org.eclipse.wb.swing.FocusTraversalOnArray;
 
 import classes.CpsUpperNode;
 import ui.controller.Control;
 import ui.model.Model;
 
-import java.awt.Component;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.ComponentAdapter;
@@ -193,7 +191,6 @@ public class BackgroundPopUp extends JDialog {
 
 		panelBrowse.add(textPath, BorderLayout.CENTER);
 		textPath.setColumns(20);
-		panelImageRadio.setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[] { btnBrowse, textPath }));
 		panelOK.setBackground(Color.WHITE);
 
 		getContentPane().add(panelOK, BorderLayout.SOUTH);
@@ -202,7 +199,7 @@ public class BackgroundPopUp extends JDialog {
 
 			@Override
 			public void actionPerformed(ActionEvent e) {
-				// Bild ausgewählt?
+				// picture selected?
 				if (!path.isEmpty()) {
 					if (rdbtnImagePixel.isSelected()) {
 						mode = 0;

+ 4 - 2
src/ui/view/ButtonTabComponent.java

@@ -31,7 +31,6 @@ package ui.view;
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
  
-import javax.swing.*;
 import javax.swing.*;
 import javax.swing.plaf.basic.BasicButtonUI;
 import java.awt.*;
@@ -44,14 +43,16 @@ import java.awt.event.*;
  */
 public class ButtonTabComponent extends JPanel {
     private final JTabbedPane pane;
+    private final JTabbedPane pane2;
  
-    public ButtonTabComponent(final JTabbedPane pane) {
+    public ButtonTabComponent(final JTabbedPane pane, final JTabbedPane pane2) {
         //unset default FlowLayout' gaps
         super(new FlowLayout(FlowLayout.LEFT, 0, 0));
         if (pane == null) {
             throw new NullPointerException("TabbedPane is null");
         }
         this.pane = pane;
+        this.pane2 = pane2;
         setOpaque(false);
          
         //make JLabel read titles from JTabbedPane
@@ -100,6 +101,7 @@ public class ButtonTabComponent extends JPanel {
             int i = pane.indexOfTabComponent(ButtonTabComponent.this);
             if (i != -1) {
                 pane.remove(i);
+                pane2.remove(i);
             }
         }
  

+ 7 - 10
src/ui/view/EditEdgesPopUp.java

@@ -1,29 +1,26 @@
 package ui.view;
 
+import java.awt.BorderLayout;
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
 import javax.swing.ButtonGroup;
+import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JFrame;
+import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JLabel;
-
-import java.awt.BorderLayout;
-import java.awt.Font;
-
 import javax.swing.JTextField;
-import javax.swing.JButton;
 import javax.swing.border.EmptyBorder;
 
 import classes.AbstractCpsObject;
 import classes.CpsEdge;
 import classes.CpsUpperNode;
-import classes.SubNet;
 import ui.controller.Control;
 
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-
 /**
  * Popup for Editing Edges.
  * 

+ 88 - 0
src/ui/view/FlexibleData.java

@@ -0,0 +1,88 @@
+package ui.view;
+
+import javax.swing.JPanel;
+import javax.swing.JLabel;
+import java.awt.Font;
+import java.awt.Dimension;
+import java.awt.Color;
+
+public class FlexibleData extends JPanel {
+	private JLabel name_lbl;
+	private JLabel lblProdVal;
+	private JLabel lblConsVal;
+	private JLabel lblProdConsVal;
+	public FlexibleData(String name, float prod, float cons) {
+		setPreferredSize(new Dimension(614, 100));
+		setMinimumSize(new Dimension(600, 150));
+		setLayout(null);
+		
+		name_lbl = new JLabel();
+		name_lbl.setFont(new Font("Tahoma", Font.PLAIN, 13));
+		name_lbl.setBounds(10, 11, 125, 27);
+		setlblName(name);
+		add(name_lbl);
+		
+		JLabel lblFlProd = new JLabel("Flex. Prod.  :");
+		lblFlProd.setForeground(new Color(0, 128, 0));
+		lblFlProd.setBounds(31, 46, 65, 27);
+		add(lblFlProd);
+		
+		JLabel lblFlexCons = new JLabel("Flex. Cons.  :\r\n");
+		lblFlexCons.setForeground(new Color(255, 0, 0));
+		lblFlexCons.setBounds(181, 46, 65, 27);
+		add(lblFlexCons);
+		
+		JLabel lblProdCons = new JLabel("Prod./Cons. :");
+		lblProdCons.setForeground(new Color(218, 165, 32));
+		lblProdCons.setBounds(327, 46, 65, 27);
+		add(lblProdCons);
+		
+		lblProdVal = new JLabel();
+		setProd(prod);
+		lblProdVal.setBounds(100, 47, 72, 24);
+		add(lblProdVal);
+		
+		lblConsVal = new JLabel();
+		setCons(cons);
+		lblConsVal.setBounds(252, 47, 72, 24);
+		add(lblConsVal);
+		
+		lblProdConsVal = new JLabel();
+		if(cons != 0 && prod != 0){
+		lblProdConsVal.setText(Float.toString((prod/cons)*(-1)));
+		}else if(prod == 0 && cons == 0){
+			lblProdConsVal.setText("not producing or consuming...");
+		}else if(prod == 0){
+			lblProdConsVal.setText("only consuming...");
+		}else if(cons == 0){
+			lblProdConsVal.setText("only producing...");
+		}
+		lblProdConsVal.setBounds(402, 46, 173, 24);
+		add(lblProdConsVal);
+	}
+	
+	public void setProd(float p){
+		lblProdVal.setText(Float.toString(p));
+	}
+	
+	public void setCons(float c){
+		lblConsVal.setText(Float.toString(c));
+	}
+	
+	public void setProdConsVal(float prod, float cons){
+		if(cons != 0 && prod != 0){
+		lblProdConsVal.setText(Float.toString((prod/cons)*(-1)));
+		}else if(prod == 0 && cons == 0){
+			lblProdConsVal.setText("not producing or consuming...");
+		}else if(prod == 0){
+			lblProdConsVal.setText("only consuming...");
+		}else if(cons == 0){
+			lblProdConsVal.setText("only producing...");
+		}
+	}
+	
+	public void setlblName(String name){
+		name_lbl.setText(name);
+	}
+
+}

+ 46 - 2
src/ui/view/FlexiblePane.java

@@ -1,9 +1,53 @@
 package ui.view;
 
 import javax.swing.JPanel;
+import javax.swing.JScrollPane;
 
-public class FlexiblePane extends JPanel {
-	public FlexiblePane() {
+import classes.HolonObject;
+import classes.SubNet;
+import ui.controller.Control;
+
+import java.awt.Color;
+import java.awt.Dimension;
+
+import javax.swing.BoxLayout;
+
+public class FlexiblePane extends JScrollPane {
+	private JPanel flexPanel;
+	private Control controller;
+	
+	public FlexiblePane(Control controller) {
+		this.controller = controller;
+		flexPanel = new JPanel();
+		flexPanel.setLayout(new BoxLayout(flexPanel, BoxLayout.Y_AXIS));
+		setViewportView(flexPanel);
+	}
+	
+	public void recalculate(){
+		flexPanel.removeAll();
+		flexPanel.add(new FlexibleData("Main Grid", 0,0));
+		float gridProd = 0;
+		float gridCons = 0;
+		int counter = 1;
+		for(SubNet sn: controller.getSimManager().getSubNets()){
+			float subProd = 0;
+			float subCons = 0;
+			for(HolonObject hl: sn.getObjects()){
+				subProd += hl.getFlexProd();
+				subCons += hl.getFlexCons();
+				flexPanel.add(new FlexibleData(hl.getName()+" "+hl.getId(),
+						hl.getFlexProd(), hl.getFlexCons()));
+			}
+			gridProd += subProd;
+			gridCons += subCons;
+			flexPanel.add(new FlexibleData("Subnet "+ counter, subProd, subCons));
+			counter++;
+		}
+		if (flexPanel.getComponent(0) instanceof FlexibleData){
+			((FlexibleData)flexPanel.getComponent(0)).setProd(gridProd);
+			((FlexibleData)flexPanel.getComponent(0)).setCons(gridCons);
+			((FlexibleData)flexPanel.getComponent(0)).setProdConsVal(gridProd, gridCons);
+		}
 	}
 
 }

+ 127 - 25
src/ui/view/GUI.java

@@ -5,10 +5,8 @@ import java.awt.Color;
 import java.awt.Component;
 import java.awt.Cursor;
 import java.awt.Dimension;
-import java.awt.Font;
 import java.awt.HeadlessException;
 import java.awt.Image;
-import java.awt.Label;
 import java.awt.Point;
 import java.awt.Toolkit;
 import java.awt.datatransfer.UnsupportedFlavorException;
@@ -26,7 +24,6 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Timer;
 import java.util.TimerTask;
-import java.util.zip.ZipException;
 
 import javax.swing.AbstractAction;
 import javax.swing.ActionMap;
@@ -125,6 +122,8 @@ public class GUI<E> implements CategoryListener {
 	private final JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
 	private final JTabbedPane tabbedPane2 = new JTabbedPane(JTabbedPane.TOP);
 	private final JButton splitButton = new JButton("Split View");
+	private JSplitPane tempSplit;
+	private boolean initSplit = true;
 
 	private final JPanel panelTapped_SimMenu = new JPanel();
 	private JPopupMenu popmenuEdit = new JPopupMenu();
@@ -302,7 +301,6 @@ public class GUI<E> implements CategoryListener {
 		initialize();
 		updateCategories(model.getCategories());
 		updCon = new UpdateController(model, controller);
-		flexPane = new FlexiblePane();
 	}
 
 	/**
@@ -703,6 +701,11 @@ public class GUI<E> implements CategoryListener {
 				} else {
 					canvas.repaint();
 				}
+				if (!initSplit && ((JScrollPane) tabbedPane2.getSelectedComponent()).getViewport()
+						.getComponent(0) instanceof UpperNodeCanvas) {
+					((UpperNodeCanvas) ((JScrollPane) tabbedPane2.getSelectedComponent()).getViewport().getComponent(0))
+							.repaint();
+				}
 			}
 		});
 
@@ -759,12 +762,15 @@ public class GUI<E> implements CategoryListener {
 
 		// Testing
 		menuBar.add(splitButton);
-		//Split View
+		// Split View
 		splitButton.addActionListener(new ActionListener() {
 			@Override
 			public void actionPerformed(ActionEvent e) {
 				if (panelTapped_SimMenu
 						.getComponent(panelTapped_SimMenu.getComponentCount() - 1) instanceof JSplitPane) {
+					initSplit = true;
+					Component tempC = tabbedPane2.getSelectedComponent();
+					tabbedPane.setComponentAt(tabbedPane2.getSelectedIndex(), tempC);
 					tabbedPane2.removeAll();
 					panelTapped_SimMenu
 							.remove(panelTapped_SimMenu.getComponent(panelTapped_SimMenu.getComponentCount() - 1));
@@ -772,20 +778,76 @@ public class GUI<E> implements CategoryListener {
 				} else {
 					for (int i = 0; i < tabbedPane.getTabCount(); i++) {
 						tabbedPane2.addTab(tabbedPane.getTitleAt(i), null);
+						if (i >= 4) {
+							//tabbedPane2.setTabComponentAt(tabbedPane.getTabCount() - 1,
+								//	new ButtonTabComponent(tabbedPane, tabbedPane2));
+						}
+					}
+					if (tabbedPane.getSelectedComponent() == statScrollPane) {
+						tabbedPane.setComponentAt(0, null);
+						tabbedPane2.setComponentAt(0, canvasSP);
+						tabbedPane2.setSelectedIndex(0);
+					} else {
+						tabbedPane.setComponentAt(1, null);
+						tabbedPane2.setComponentAt(1, statScrollPane);
+						tabbedPane2.setSelectedIndex(1);
 					}
-					JSplitPane tempSplit = new JSplitPane();
+					tempSplit = new JSplitPane();
 					tempSplit.setBorder(null);
 					tempSplit.setRightComponent(tabbedPane2);
 					tempSplit.setLeftComponent(tabbedPane);
-					tempSplit.setDividerLocation(tabbedPane.getWidth()/2);
+					tempSplit.setDividerLocation(tabbedPane.getWidth() / 2);
+					tempSplit.setResizeWeight(0.9);
 					panelTapped_SimMenu.remove(tabbedPane);
 					panelTapped_SimMenu.add(tempSplit);
+					initSplit = false;
 				}
 				contentPane.updateUI();
 			}
 
 		});
 
+		tabbedPane.addChangeListener(new ChangeListener() {
+
+			@Override
+			public void stateChanged(ChangeEvent e) {
+				if (tabbedPane.getSelectedComponent() == null) {
+					Component tempC = tabbedPane2.getSelectedComponent();
+					tabbedPane2.setComponentAt(tabbedPane.getSelectedIndex(), null);
+					tabbedPane.setComponentAt(tabbedPane.getSelectedIndex(), tempC);
+					tempC = tabbedPane.getComponentAt((tabbedPane.getSelectedIndex() + 1) % (tabbedPane.getTabCount()));
+					tabbedPane.setComponentAt((tabbedPane.getSelectedIndex() + 1) % (tabbedPane.getTabCount()), null);
+					tabbedPane2.setComponentAt((tabbedPane.getSelectedIndex() + 1) % (tabbedPane.getTabCount()), tempC);
+					tabbedPane2.setSelectedIndex((tabbedPane.getSelectedIndex() + 1) % (tabbedPane.getTabCount()));
+					contentPane.updateUI();
+				}
+			}
+		});
+
+		tabbedPane2.addChangeListener(new ChangeListener() {
+
+			@Override
+			public void stateChanged(ChangeEvent e) {
+				if (tabbedPane2.getSelectedComponent() == null && !initSplit) {
+					Component tempC = tabbedPane.getComponentAt(tabbedPane2.getSelectedIndex());
+					tabbedPane.setComponentAt(tabbedPane2.getSelectedIndex(), null);
+					tabbedPane2.setComponentAt(tabbedPane2.getSelectedIndex(), tempC);
+					for (int i = 0; i < tabbedPane.getTabCount(); i++) {
+						if (tabbedPane2.getComponentAt(i) != null && tabbedPane2.getComponentAt(i) != tempC) {
+							tempC = tabbedPane2.getComponentAt(i);
+							tabbedPane2.setComponentAt(i, null);
+							tabbedPane.setComponentAt(i, tempC);
+							break;
+						}
+					}
+					if (tabbedPane.getSelectedIndex() == tabbedPane2.getSelectedIndex()) {
+						tabbedPane.setSelectedIndex((tabbedPane2.getSelectedIndex() + 1) % tabbedPane.getTabCount());
+					}
+					contentPane.updateUI();
+				}
+			}
+		});
+
 		mnNewMenuOptions.add(mnLanguage);
 		canvas.setBackground(Color.WHITE);
 		canvas.setPreferredSize(new Dimension(model.getCanvasX(), model.getCanvasY()));
@@ -849,7 +911,6 @@ public class GUI<E> implements CategoryListener {
 			public void actionPerformed(ActionEvent arg0) {
 				if (model.getSelectedCpsObjects().size() == 1) {
 					AbstractCpsObject tempCpsObject = updCon.getActualCps();
-					System.out.println(tempCpsObject.getName());
 					if (tempCpsObject != null && tempCpsObject.getClass() == HolonObject.class
 							&& tempCpsObject.getId() != 0) {
 						addElementPopUp = new AddElementPopUp();
@@ -1095,7 +1156,6 @@ public class GUI<E> implements CategoryListener {
 					yProThis = e.getY();
 					xProThis = e.getX();
 				}
-
 			}
 		});
 
@@ -1111,14 +1171,13 @@ public class GUI<E> implements CategoryListener {
 					Point mousePos = tableProperties.getMousePosition();
 					int selValueY = (int) Math.floor(yProThis / 16);
 					int selValueX = (int) Math.floor(xProThis / (tableProperties.getWidth() / 2));
-					if (updCon.getActualCps() != null) {
+					if (updCon.getActualCps() != null && selValueX != 0) {
 						temp = model.getPropertyTable().getValueAt(selValueY, selValueX);
 						if (updCon.getActualCps() instanceof HolonSwitch) {
 							btemp = model.getPropertyTable().getValueAt(mousePos.y / tableProperties.getRowHeight(),
 									mousePos.x / (tableProperties.getWidth() / 2));
 							if (mousePos.y / tableProperties.getRowHeight() == 0) {
 								updCon.getActualCps().setName(btemp.toString());
-
 							} else if (mousePos.y / tableProperties.getRowHeight() == 2) {
 								Boolean bbTemp = Boolean.parseBoolean(btemp.toString());
 								((HolonSwitch) updCon.getActualCps()).setManualMode(bbTemp);
@@ -1134,9 +1193,8 @@ public class GUI<E> implements CategoryListener {
 									((HolonSwitch) updCon.getActualCps()).setManualState(bTemp);
 								}
 							}
-						}
-						updCon.getActualCps().setName(temp.toString());
-						if (updCon.getActualCps() instanceof CpsUpperNode) {
+						} else if (updCon.getActualCps() instanceof CpsUpperNode) {
+							updCon.getActualCps().setName(temp.toString());
 							for (int index = 4; index < tabbedPane.getTabCount(); index++) {
 								UpperNodeCanvas unc = ((UpperNodeCanvas) ((JScrollPane) tabbedPane.getComponent(index))
 										.getViewport().getComponent(0));
@@ -1145,8 +1203,9 @@ public class GUI<E> implements CategoryListener {
 									tabbedPane.updateUI();
 								}
 							}
+						} else if (updCon.getActualCps() instanceof HolonObject) {
+							updCon.getActualCps().setName(temp.toString());
 						}
-						// }
 					} else {
 						temp = model.getPropertyTable().getValueAt(selValueY, selValueX);
 						btemp = model.getPropertyTable().getValueAt(mousePos.y / tableProperties.getRowHeight(),
@@ -1793,12 +1852,14 @@ public class GUI<E> implements CategoryListener {
 		splitPane1.setDividerLocation(500);
 		splitPaneCanvasConsole.setDividerLocation(550);
 		splitPaneCanvasConsole.setResizeWeight(0.9);
-		
+
 		splitPane.setLeftComponent(scrollPane1);
 		splitPaneCanvasConsole.setLeftComponent(panelTapped_SimMenu);
 		tabbedPane.addTab("View", canvasSP);
 		tabbedPane.addTab("Statistics", statScrollPane);
 		tabbedPane.addTab("Holon", holonCanvas);
+		flexPane = new FlexiblePane(controller);
+		controller.setFlexiblePane(flexPane);
 		tabbedPane.addTab("Flexibility", flexPane);
 
 		splitPaneCanvasConsole.setRightComponent(console);
@@ -2078,12 +2139,18 @@ public class GUI<E> implements CategoryListener {
 	 * Open a new Tab with an UpperNodeCanvas
 	 */
 	private void openNewUpperNodeTab() {
-
-		if (((JScrollPane) tabbedPane.getSelectedComponent()).getViewport().getComponent(0) instanceof MyCanvas) {
+		// is the uppernode on tabbedPane or tabbedPane2
+		JTabbedPane tabTemp;
+		if (tabbedPane.getMousePosition() != null) {
+			tabTemp = tabbedPane;
+		} else {
+			tabTemp = tabbedPane2;
+		}
+		if (((JScrollPane) tabTemp.getSelectedComponent()).getViewport().getComponent(0) instanceof MyCanvas) {
 			unc = new UpperNodeCanvas(model, controller, (CpsUpperNode) temp, "");
 		} else {
 			unc = new UpperNodeCanvas(model, controller, (CpsUpperNode) temp,
-					((UpperNodeCanvas) ((JScrollPane) tabbedPane.getSelectedComponent()).getViewport()
+					((UpperNodeCanvas) ((JScrollPane) tabTemp.getSelectedComponent()).getViewport()
 							.getComponent(0)).path + " -> ");
 		}
 		unc.setShowedInformation(canvas.getShowedInformation());
@@ -2091,11 +2158,17 @@ public class GUI<E> implements CategoryListener {
 		// check if tab already open for clicked NodeOfNode
 		boolean dupl = false;
 		for (int i = 4; i < tabbedPane.getTabCount() && dupl == false; i++) {
-			if (((UpperNodeCanvas) ((JScrollPane) tabbedPane.getComponentAt(i)).getViewport().getComponent(0)).upperNode
-					.getId() == temp.getId()) {
+			if (tabbedPane.getComponentAt(i) != null && ((UpperNodeCanvas) ((JScrollPane) tabbedPane.getComponentAt(i))
+					.getViewport().getComponent(0)).upperNode.getId() == temp.getId()) {
 				dupl = true;
 				tabbedPane.setSelectedComponent(tabbedPane.getComponentAt(i));
 			}
+			if (!initSplit && tabbedPane2.getComponentAt(i) != null
+					&& ((UpperNodeCanvas) ((JScrollPane) tabbedPane2.getComponentAt(i)).getViewport()
+							.getComponent(0)).upperNode.getId() == temp.getId()) {
+				dupl = true;
+				tabbedPane2.setSelectedComponent(tabbedPane2.getComponentAt(i));
+			}
 		}
 		if (!dupl) {
 			unc.setBorder(null);
@@ -2108,7 +2181,13 @@ public class GUI<E> implements CategoryListener {
 					unitGraph.empty();
 					holonEleNamesDisplayed = Languages.getLanguage()[25];
 					elementGraph.setText(holonEleNamesDisplayed);
-					temp = ((UpperNodeCanvas) ((JScrollPane) tabbedPane.getSelectedComponent()).getViewport()
+					JTabbedPane tabTemp;
+					if (tabbedPane.getMousePosition() != null) {
+						tabTemp = tabbedPane;
+					} else {
+						tabTemp = tabbedPane2;
+					}
+					temp = ((UpperNodeCanvas) ((JScrollPane) tabTemp.getSelectedComponent()).getViewport()
 							.getComponent(0)).tempCps;
 					if (doubleClick() && MouseEvent.BUTTON3 != e.getButton() && temp instanceof CpsUpperNode) {
 						openNewUpperNodeTab();
@@ -2122,9 +2201,32 @@ public class GUI<E> implements CategoryListener {
 
 			JScrollPane sp = new JScrollPane(unc);
 			sp.setBorder(null);
-			tabbedPane.add(temp.getName(), sp);
-			tabbedPane.setSelectedComponent(sp);
-			tabbedPane.setTabComponentAt(tabbedPane.getTabCount() - 1, new ButtonTabComponent(tabbedPane));
+			if (tabTemp == tabbedPane) {
+				tabbedPane.add(temp.getName(), sp);
+				tabbedPane.setSelectedComponent(sp);
+				tabbedPane.setTabComponentAt(tabbedPane.getTabCount() - 1,
+						new ButtonTabComponent(tabbedPane, tabbedPane2));
+				if (!initSplit) {
+					tabbedPane2.add(temp.getName(), null);
+					// tabbedPane2.setTabComponentAt(tabbedPane2.getTabCount() -
+					// 1,
+					// new ButtonTabComponent(tabbedPane, tabbedPane2));
+				}
+			} else {
+				tabbedPane2.add(temp.getName(), sp);
+				Component tempC = tabbedPane2.getSelectedComponent();
+				tabbedPane2.setComponentAt(tabbedPane2.getSelectedIndex(), null);
+				tabbedPane.setComponentAt(tabbedPane2.getSelectedIndex(), tempC);
+				tabbedPane2.setSelectedComponent(sp);
+				
+				// tabbedPane2.setTabComponentAt(tabbedPane2.getTabCount() - 1,
+				// new ButtonTabComponent(tabbedPane, tabbedPane2));
+
+				tabbedPane.add(temp.getName(), null);
+				tabbedPane.setTabComponentAt(tabbedPane.getTabCount() - 1,
+						new ButtonTabComponent(tabbedPane, tabbedPane2));
+			}
+
 			temp = null;
 		}
 	}

+ 0 - 5
src/ui/view/HolonCanvas.java

@@ -20,14 +20,9 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
-import javax.swing.plaf.BorderUIResource.BevelBorderUIResource;
 
 import classes.AbstractCpsObject;
-import classes.Constants;
-import classes.CpsUpperNode;
 import classes.HolonBody;
-import classes.HolonElement;
-import classes.HolonObject;
 import classes.SubNet;
 import classes.Vector2d;
 import ui.controller.Control;

+ 73 - 72
src/ui/view/MyCanvas.java

@@ -341,10 +341,10 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 					if (cps instanceof CpsUpperNode) {
 						JTabbedPane tabbedPane = (JTabbedPane) getParent().getParent().getParent();
 						for (int i = 4; i < tabbedPane.getTabCount(); i++) {
-							if (((UpperNodeCanvas) ((JScrollPane) tabbedPane.getComponentAt(i)).getViewport()
+							if (tabbedPane.getComponentAt(i) != null && ((UpperNodeCanvas) ((JScrollPane) tabbedPane.getComponentAt(i)).getViewport()
 									.getComponent(0)).upperNode.getId() == cps.getId()) {
 								tabbedPane.remove(i);
-								i = tabbedPane.getTabCount();
+								break;
 							}
 						}
 					}
@@ -555,13 +555,12 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 			// Border Highlighting
 			if (showedInformation[3]) {
 				g2.setColor(cps.getBorderColor());
-				if (!(cps instanceof CpsNode)){
-					//if (g2.getColor() != Color.WHITE) {
-						g2.fillRect((int) (cps.getPosition().x - controller.getScaleDiv2() - scalediv20 - 3),
-								(int) (cps.getPosition().y - controller.getScaleDiv2() - scalediv20 - 3),
-								(int) (controller.getScale() + ((scalediv20 + 3) * 2)),
-								(int) (controller.getScale() + ((scalediv20 + 3) * 2)));
-					}
+				if (g2.getColor() != Color.WHITE && !(cps instanceof CpsNode)) {
+					g2.fillRect((int) (cps.getPosition().x - controller.getScaleDiv2() - scalediv20 - 3),
+							(int) (cps.getPosition().y - controller.getScaleDiv2() - scalediv20 - 3),
+							(int) (controller.getScale() + ((scalediv20 + 3) * 2)),
+							(int) (controller.getScale() + ((scalediv20 + 3) * 2)));
+				}
 			}
 			// node image
 			if (cps instanceof CpsNode && (cps == tempCps || model.getSelectedCpsObject() == cps
@@ -941,88 +940,90 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 	 * Draws or Deletes an Edge.
 	 */
 	private void drawDeleteEdge() {
-		boolean node = true;
-		boolean newEdge = true;
-		boolean onEdge = true;
-		boolean deleteNode = false;
-		CpsEdge e = null;
-		for (AbstractCpsObject cps : model.getObjectsOnCanvas()) {
-			cx = cps.getPosition().x - controller.getScaleDiv2();
-			cy = cps.getPosition().y - controller.getScaleDiv2();
-			if (x - controller.getScale() <= cx && y - controller.getScale() <= cy && x >= cx && y >= cy
-					&& cps != tempCps) {
-				node = false;
-				onEdge = false;
-				for (CpsEdge p : tempCps.getConnections()) {
-					if ((p.getA() == tempCps && p.getB() == cps) || (p.getB() == tempCps && p.getA() == cps)) {
-						newEdge = false;
-						e = p;
+		if (getMousePosition() != null) {
+			boolean node = true;
+			boolean newEdge = true;
+			boolean onEdge = true;
+			boolean deleteNode = false;
+			CpsEdge e = null;
+			for (AbstractCpsObject cps : model.getObjectsOnCanvas()) {
+				cx = cps.getPosition().x - controller.getScaleDiv2();
+				cy = cps.getPosition().y - controller.getScaleDiv2();
+				if (x - controller.getScale() <= cx && y - controller.getScale() <= cy && x >= cx && y >= cy
+						&& cps != tempCps) {
+					node = false;
+					onEdge = false;
+					for (CpsEdge p : tempCps.getConnections()) {
+						if ((p.getA() == tempCps && p.getB() == cps) || (p.getB() == tempCps && p.getA() == cps)) {
+							newEdge = false;
+							e = p;
+						}
 					}
-				}
-				if (!newEdge) {
-					controller.removeEdgesOnCanvas(e);
-					// Node ohne Edge?
-					if (e.getA().getClass() == CpsNode.class && e.getA().getConnections().isEmpty()) {
-						tempCps = e.getA();
-						deleteNode = true;
+					if (!newEdge) {
+						controller.removeEdgesOnCanvas(e);
+						// Node ohne Edge?
+						if (e.getA().getClass() == CpsNode.class && e.getA().getConnections().isEmpty()) {
+							tempCps = e.getA();
+							deleteNode = true;
+						}
+						if (e.getB().getClass() == CpsNode.class && e.getB().getConnections().isEmpty()) {
+							deleteNode = true;
+						}
 					}
-					if (e.getB().getClass() == CpsNode.class && e.getB().getConnections().isEmpty()) {
-						deleteNode = true;
+					if (newEdge) {
+						e = new CpsEdge(cps, tempCps, model.getMaxCapacity());
+						controller.addEdgeOnCanvas(e);
 					}
 				}
-				if (newEdge) {
-					e = new CpsEdge(cps, tempCps, model.getMaxCapacity());
-					controller.addEdgeOnCanvas(e);
-				}
 			}
-		}
-		// Edge auf eine Edge gezogen?
-		if (onEdge) {
-			CpsEdge p = mousePositionOnEdge(x, y);
-			if (p != null) {
-				CpsEdge e1 = null;
-				CpsEdge e2 = null;
+			// Edge auf eine Edge gezogen?
+			if (onEdge) {
+				CpsEdge p = mousePositionOnEdge(x, y);
+				if (p != null) {
+					CpsEdge e1 = null;
+					CpsEdge e2 = null;
 
-				node = false;
+					node = false;
 
-				CpsNode n = new CpsNode("Node");
+					CpsNode n = new CpsNode("Node");
 
-				n.setPosition(x, y);
-				controller.addObjectCanvas(n);
+					n.setPosition(x, y);
+					controller.addObjectCanvas(n);
 
-				AbstractCpsObject r, k;
-				r = p.getA();
-				k = p.getB();
+					AbstractCpsObject r, k;
+					r = p.getA();
+					k = p.getB();
 
-				e = new CpsEdge(n, tempCps, model.getMaxCapacity());
+					e = new CpsEdge(n, tempCps, model.getMaxCapacity());
 
-				e1 = new CpsEdge(n, r, model.getMaxCapacity());
+					e1 = new CpsEdge(n, r, model.getMaxCapacity());
 
-				e2 = new CpsEdge(n, k, model.getMaxCapacity());
+					e2 = new CpsEdge(n, k, model.getMaxCapacity());
 
-				controller.removeEdgesOnCanvas(p);
-				controller.addEdgeOnCanvas(e);
-				controller.addEdgeOnCanvas(e1);
-				controller.addEdgeOnCanvas(e2);
+					controller.removeEdgesOnCanvas(p);
+					controller.addEdgeOnCanvas(e);
+					controller.addEdgeOnCanvas(e1);
+					controller.addEdgeOnCanvas(e2);
+				}
 			}
-		}
 
-		// ins leere Gedragged
-		if (node) {
-			CpsNode n = new CpsNode("Node");
+			// ins leere Gedragged
+			if (node) {
+				CpsNode n = new CpsNode("Node");
 
-			n.setPosition(x, y);
-			controller.addObjectCanvas(n);
+				n.setPosition(x, y);
+				controller.addObjectCanvas(n);
 
-			e = new CpsEdge(n, tempCps, model.getMaxCapacity());
+				e = new CpsEdge(n, tempCps, model.getMaxCapacity());
 
-			controller.addEdgeOnCanvas(e);
-		}
+				controller.addEdgeOnCanvas(e);
+			}
 
-		// Wenn ein Node ohne Connections da ist
-		if (deleteNode) {
-			controller.delCanvasObject(tempCps, true);
-			tempCps = null;
+			// Wenn ein Node ohne Connections da ist
+			if (deleteNode) {
+				controller.delCanvasObject(tempCps, true);
+				tempCps = null;
+			}
 		}
 	}
 

+ 4 - 8
src/ui/view/ShowedInformationPopUp.java

@@ -1,19 +1,15 @@
 package ui.view;
 
 import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
 import javax.swing.JDialog;
-import javax.swing.JFrame;
 import javax.swing.JPanel;
 import javax.swing.border.EmptyBorder;
 
-import classes.IdCounter;
-
-import javax.swing.JCheckBox;
-import javax.swing.JButton;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-
 /**
  * This Class represents a Popup to edit the shown Information.
  * 

+ 12 - 17
src/ui/view/SimulationMenu.java

@@ -1,33 +1,28 @@
 package ui.view;
 
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.HashMap;
+
 import javax.swing.JButton;
 import javax.swing.JComboBox;
 import javax.swing.JFileChooser;
 import javax.swing.JFrame;
-import javax.swing.JLabel;
 import javax.swing.JMenuBar;
 import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.JTextField;
-import javax.swing.event.CaretEvent;
-import javax.swing.event.CaretListener;
 import javax.tools.JavaCompiler;
 import javax.tools.ToolProvider;
 
 import ui.controller.Control;
 import ui.model.Model;
-import java.util.HashMap;
-import java.awt.GridBagLayout;
-import java.awt.Dimension;
-import java.awt.GridBagConstraints;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.net.URL;
-import java.net.URLClassLoader;
 
 /**
  * This Class represents the Menu, where you can edit stuff about the

+ 36 - 50
src/ui/view/StatPanel2.java

@@ -1,25 +1,36 @@
 package ui.view;
 
-import javax.swing.JSplitPane;
-import javax.swing.JScrollPane;
-import javax.swing.JPanel;
-
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Random;
 
-import javax.swing.GroupLayout;
-import javax.swing.GroupLayout.Alignment;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
 import javax.swing.JLabel;
-import javax.swing.LayoutStyle.ComponentPlacement;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTextField;
+import javax.swing.JTree;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.LineBorder;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
 import javax.swing.event.TreeSelectionEvent;
 import javax.swing.event.TreeSelectionListener;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.MutableTreeNode;
-import javax.swing.tree.TreeNode;
 
 import DataSets.GraphDataSet;
 import DataSets.PropertyDataSet;
@@ -31,31 +42,6 @@ import classes.TrackedDataSet;
 import interfaces.GraphListener;
 import ui.controller.Control;
 
-import javax.swing.JTextField;
-import javax.swing.JComboBox;
-import javax.swing.JButton;
-import javax.swing.JTree;
-import java.awt.Color;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-
-import javax.swing.border.CompoundBorder;
-import javax.swing.border.LineBorder;
-import javax.swing.JPopupMenu;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import javax.swing.JMenuItem;
-import javax.swing.BorderFactory;
-import javax.swing.Box;
-import javax.swing.BoxLayout;
-import java.awt.FlowLayout;
-import java.awt.BorderLayout;
-import javax.swing.border.EmptyBorder;
-
 public class StatPanel2 extends JSplitPane implements GraphListener {
 	public static final String MAIN_GRID = "Main Grid";
 	public static final String HOLON = "Holons";
@@ -621,67 +607,67 @@ public class StatPanel2 extends JSplitPane implements GraphListener {
 		editPanel.setLayout(null);
 		
 		JLabel lblObject = new JLabel("Object(s):");
-		lblObject.setBounds(10, 11, 49, 14);
+		lblObject.setBounds(10, 11, 59, 20);
 		editPanel.add(lblObject);
 		
 		showObjectlbl = new JLabel("...");
-		showObjectlbl.setBounds(69, 11, 86, 14);
+		showObjectlbl.setBounds(69, 11, 101, 20);
 		editPanel.add(showObjectlbl);
 		
 		JLabel lblProperty = new JLabel("Property:");
-		lblProperty.setBounds(10, 36, 46, 14);
+		lblProperty.setBounds(10, 36, 59, 20);
 		editPanel.add(lblProperty);
 		
 		showPropertylbl = new JLabel("...");
-		showPropertylbl.setBounds(69, 36, 86, 14);
+		showPropertylbl.setBounds(69, 36, 101, 20);
 		editPanel.add(showPropertylbl);
 		
 		JLabel lblGraph = new JLabel("Graph:");
-		lblGraph.setBounds(10, 61, 33, 14);
+		lblGraph.setBounds(10, 61, 49, 23);
 		editPanel.add(lblGraph);
 		
 		graphNrTxtField.setColumns(10);
-		graphNrTxtField.setBounds(69, 61, 86, 20);
+		graphNrTxtField.setBounds(69, 61, 101, 23);
 		editPanel.add(graphNrTxtField);
 		
 		JLabel lblColor = new JLabel("Color:");
-		lblColor.setBounds(10, 86, 29, 14);
+		lblColor.setBounds(10, 95, 49, 23);
 		editPanel.add(lblColor);
 		
-		colorComboBox.setBounds(69, 83, 86, 20);
+		colorComboBox.setBounds(69, 95, 101, 23);
 		editPanel.add(colorComboBox);
 		
 		JLabel lblR = new JLabel("R");
-		lblR.setBounds(10, 111, 11, 14);
+		lblR.setBounds(10, 139, 11, 14);
 		editPanel.add(lblR);
 		
 		redField.setColumns(10);
-		redField.setBounds(20, 108, 37, 20);
+		redField.setBounds(22, 136, 37, 20);
 		editPanel.add(redField);
 		
 		JLabel lblG = new JLabel("G");
-		lblG.setBounds(58, 111, 11, 14);
+		lblG.setBounds(68, 139, 11, 14);
 		editPanel.add(lblG);
 		
 		greenField.setColumns(10);
-		greenField.setBounds(69, 108, 37, 20);
+		greenField.setBounds(79, 136, 37, 20);
 		editPanel.add(greenField);
 		
 		JLabel lblB = new JLabel("B");
-		lblB.setBounds(108, 111, 10, 14);
+		lblB.setBounds(126, 139, 10, 14);
 		editPanel.add(lblB);
 		
 		blueField.setColumns(10);
-		blueField.setBounds(116, 108, 39, 20);
+		blueField.setBounds(133, 136, 37, 20);
 		editPanel.add(blueField);
 		
 		colorPanel = new JPanel();
 		colorPanel.setBorder(new LineBorder(new Color(0, 0, 0)));
 		colorPanel.setBackground(Color.WHITE);
-		colorPanel.setBounds(10, 136, 49, 36);
+		colorPanel.setBounds(10, 164, 59, 38);
 		editPanel.add(colorPanel);
 
-		btnAdd.setBounds(10, 175, 51, 23);
+		btnAdd.setBounds(10, 213, 59, 23);
 		editPanel.add(btnAdd);
 		splitPane.setDividerLocation(220);
 		

+ 12 - 25
src/ui/view/StatisticGraphPanel.java

@@ -1,32 +1,14 @@
 package ui.view;
 
-import javax.swing.JPanel;
-import javax.swing.JTextPane;
-
-import classes.TrackedDataSet;
-import ui.controller.Control;
-import ui.model.Model;
-
-import javax.swing.JLabel;
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.SwingConstants;
-import javax.swing.Timer;
-import javax.swing.border.Border;
-import javax.swing.text.StyledDocument;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
+import java.awt.Component;
 import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.LayoutManager;
+import java.awt.GridLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
 import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
@@ -34,12 +16,17 @@ import java.util.Hashtable;
 
 import javax.imageio.ImageIO;
 import javax.swing.BorderFactory;
-import javax.swing.BoxLayout;
-import javax.swing.GroupLayout.Alignment;
-
-import java.awt.GridLayout;
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingConstants;
 import javax.swing.border.EmptyBorder;
-import java.awt.Component;
+
+import classes.TrackedDataSet;
+import ui.controller.Control;
+import ui.model.Model;
 
 public class StatisticGraphPanel extends JPanel {
 

+ 34 - 1
src/ui/view/TimePanel.java

@@ -4,10 +4,12 @@ import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.FlowLayout;
 import java.awt.Image;
+import java.awt.Point;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
 
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
@@ -21,6 +23,8 @@ import javax.swing.event.CaretEvent;
 import javax.swing.event.CaretListener;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
+import javax.swing.plaf.basic.BasicSliderUI;
+import javax.swing.plaf.synth.SynthSliderUI;
 
 import ui.controller.Control;
 import ui.model.Model;
@@ -39,7 +43,29 @@ public class TimePanel extends JPanel {
 
 	JLabel simSpeedLabel = new JLabel(Languages.getLanguage()[84]);
 	private JTextField simSpeedText = new JTextField("1000");
-	JSlider timeSlider = new JSlider();
+	JSlider timeSlider = new JSlider(){
+	    {
+	    	// Make the slider jump to mouse position on left click
+	        MouseListener[] listeners = getMouseListeners();
+	        for (MouseListener l : listeners)
+	            removeMouseListener(l); // remove UI-installed TrackListener
+	        final BasicSliderUI ui = (BasicSliderUI) getUI();
+	        BasicSliderUI.TrackListener tl = ui.new TrackListener() {
+	            // this is where we jump to absolute value of click
+	            @Override public void mouseClicked(MouseEvent e) {
+	                Point p = e.getPoint();
+	                int value = ui.valueForXPosition(p.x);
+
+	                setValue(value);
+	            }
+	            // disable check that will invoke scrollDueToClickInTrack
+	            @Override public boolean shouldScroll(int dir) {
+	                return false;
+	            }
+	        };
+	        addMouseListener(tl);
+	    }
+	};;
 	private final JPanel timeBtnPanel = new JPanel();
 	final JButton playBtn = new JButton();
 	final JButton timeResetBtn = new JButton();
@@ -104,6 +130,13 @@ public class TimePanel extends JPanel {
 				controller.resetSimulation();
 			}
 		});
+		
+		timeSlider.addMouseMotionListener(new MouseAdapter() {
+			@Override
+			public void mouseDragged(MouseEvent e) {
+				controller.resetSimulation();
+			}
+		});
 
 		// Panel
 		timeBtnPanel.setBorder(null);

+ 18 - 21
src/ui/view/UpperNodeCanvas.java

@@ -139,7 +139,7 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
 		scalediv20 = model.getScale() / 20;
 
 		// Cps objecte aus dem border links schieben
-		borderPos = (int) (model.getScale() + controller.getScaleDiv2() + scalediv20 + scalediv20 + 10);
+		borderPos = (int) (50 + scalediv20 + scalediv20 + 10);
 		for (AbstractCpsObject cps : upperNode.getNodes()) {
 			if (cps.getPosition().x < model.getScaleDiv2() + borderPos + 5) {
 				cps.setPosition(new Position(borderPos + 5, cps.getPosition().y));
@@ -422,9 +422,6 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
 		RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
 		g2.setRenderingHints(rh);
 
-		// Left Border
-		borderPos = (int) (model.getScale() + scalediv20 + scalediv20 + 10);
-
 		// Paint the Background
 		if (!upperNode.getImagePath().isEmpty()) {
 			img = new ImageIcon(upperNode.getImagePath()).getImage();
@@ -676,8 +673,8 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
 					if (obj != null) {
 						g2.setColor(Color.BLUE);
 						g2.drawLine(obj.getPosition().x, obj.getPosition().y, (borderPos >> 1),
-								(int) (scalediv20 + 5 + (model.getScale() + scalediv20 + 10) * count)
-										+ model.getScaleDiv2());
+								(int) (scalediv20 + 5 + (50 + scalediv20 + 10) * count)
+										+ 25);
 					}
 				}
 			}
@@ -686,10 +683,10 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
 			if (showedInformation[3]) {
 				g2.setColor(cps.getBorderColor());
 				if (g2.getColor() != Color.WHITE) {
-					g2.fillRect((int) ((borderPos >> 1) - model.getScaleDiv2() - scalediv20) - 3,
-							(int) (scalediv20 + 5 + (model.getScale() + scalediv20 + 10) * count - scalediv20) - 3,
-							(int) (controller.getScale() + ((scalediv20 + 3) * 2)),
-							(int) (controller.getScale() + ((scalediv20 + 3) * 2)));
+					g2.fillRect((int) ((borderPos >> 1) - 25 - scalediv20) - 3,
+							(int) (scalediv20 + 5 + (25 + scalediv20 + 10) * count - scalediv20) - 3,
+							(int) (50 + ((scalediv20 + 3) * 2)),
+							(int) (50 + ((scalediv20 + 3) * 2)));
 				}
 			}
 
@@ -709,17 +706,17 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
 				if ((cps == tempCps && model.getSelectedCpsObjects().size() == 0 && tempSelected.size() == 0)
 						|| model.getSelectedCpsObjects().contains(cps) || tempSelected.contains(cps)) {
 					g2.setColor(Color.BLUE);
-					g2.fillRect((int) ((borderPos >> 1) - model.getScaleDiv2() - scalediv20),
-							(int) (scalediv20 + 5 + (model.getScale() + scalediv20 + 10) * count - scalediv20),
-							(int) (controller.getScale() + (scalediv20 * 2)),
-							(int) (controller.getScale() + (scalediv20 * 2)));
+					g2.fillRect((int) ((borderPos >> 1) - 25 - scalediv20),
+							(int) (scalediv20 + 5 + (50 + scalediv20 + 10) * count - scalediv20),
+							(int) (50 + (scalediv20 * 2)),
+							(int) (50 + (scalediv20 * 2)));
 				} else if (cps instanceof HolonObject) {
 					g2.setColor(((HolonObject) cps).getColor());
 
-					g2.fillRect((int) ((borderPos >> 1) - model.getScaleDiv2() - scalediv20),
-							(int) (scalediv20 + 5 + (model.getScale() + scalediv20 + 10) * count - scalediv20),
-							(int) (controller.getScale() + (scalediv20 * 2)),
-							(int) (controller.getScale() + (scalediv20 * 2)));
+					g2.fillRect((int) ((borderPos >> 1) - 25 - scalediv20),
+							(int) (scalediv20 + 5 + (50 + scalediv20 + 10) * count - scalediv20),
+							(int) (50 + (scalediv20 * 2)),
+							(int) (50 + (scalediv20 * 2)));
 				}
 				// draw image
 				File checkPath = new File(cps.getImage());
@@ -729,9 +726,9 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
 					img = new ImageIcon(this.getClass().getResource(cps.getImage())).getImage();
 				}
 			}
-			g2.drawImage(img, (borderPos >> 1) - model.getScaleDiv2(),
-					(int) (scalediv20 + 5 + (model.getScale() + scalediv20 + 10) * count), controller.getScale(),
-					controller.getScale(), null);
+			g2.drawImage(img, (borderPos >> 1) - 25,
+					(int) (scalediv20 + 5 + (50 + scalediv20 + 10) * count), 50,
+					50, null);
 			count++;
 		}