Browse Source

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

Teh-Hai Julian Zheng 8 years ago
parent
commit
b19f956f18

+ 2 - 2
src/classes/AbstractCpsObject.java

@@ -2,7 +2,7 @@ package classes;
 
 import java.awt.Color;
 import java.util.ArrayList;
-import ui.model.idCounter;
+import ui.model.IdCounter;
 
 /**
  * The abstract class "CpsObject" represents any possible object in the system
@@ -62,7 +62,7 @@ public abstract class AbstractCpsObject {
 		setName(obj.getObjName());
 		setConnections(new ArrayList<CpsEdge>());
 		setPosition(new Position());
-		setID(idCounter.nextId());
+		setID(IdCounter.nextId());
 		setImage(obj.getImage());
 	}
 

+ 2 - 2
src/classes/CpsNode.java

@@ -2,7 +2,7 @@ package classes;
 
 import java.util.ArrayList;
 
-import ui.model.idCounter;
+import ui.model.IdCounter;
 
 /**
  * The class "CpsNode" represents empty Objects in the system. They are just
@@ -24,6 +24,6 @@ public class CpsNode extends AbstractCpsObject {
 		this.setConnections(new ArrayList<CpsEdge>());
 		this.setImage("/Images/node.png");
 		this.setSav("CVS");
-		this.setID(idCounter.nextId());
+		this.setID(IdCounter.nextId());
 	}
 }

+ 3 - 3
src/classes/HolonElement.java

@@ -2,7 +2,7 @@ package classes;
 
 import java.awt.Point;
 import java.util.LinkedList;
-import ui.model.idCounterElem;
+import ui.model.IdCounterElem;
 
 /**
  * The class "HolonElement" represents any possible element that can be added to
@@ -59,7 +59,7 @@ public class HolonElement {
 		setActive(true);
 		setSign(energy);
 		setEnergyAt(energy);
-		setId(idCounterElem.nextId());
+		setId(IdCounterElem.nextId());
 	}
 
 	/**
@@ -77,7 +77,7 @@ public class HolonElement {
 		setEnergyAt(element.getEnergy());
 		setSav("CVS");
 		setObj(element.getObj());
-		setId(idCounterElem.nextId());
+		setId(IdCounterElem.nextId());
 	}
 
 	/**

+ 8 - 0
src/exceptions/NewException1.java

@@ -0,0 +1,8 @@
+package exceptions;
+
+/**
+ * First Exception.
+ */
+public class NewException1 {
+
+}

+ 0 - 10
src/exceptions/newException1.java

@@ -1,10 +0,0 @@
-package exceptions;
-
-/**
- * First Exception
- *
- */
-
-public class newException1 {
-
-}

+ 1 - 1
src/tests/praktikumHolonsAdapter.java → src/tests/PraktikumHolonsAdapter.java

@@ -15,7 +15,7 @@ import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 
 
-public class praktikumHolonsAdapter {
+public class PraktikumHolonsAdapter {
 
 	
 	/**

+ 5 - 5
src/tests/praktikumHolonsTestAutoSaveController.java → src/tests/PraktikumHolonsTestAutoSaveControlle.java

@@ -11,10 +11,10 @@ import ui.controller.MultiPurposeController;
 import ui.controller.ObjectController;
 import ui.controller.StoreController;
 import ui.model.Model;
-import ui.model.idCounter;
+import ui.model.IdCounter;
 
-public class praktikumHolonsTestAutoSaveController {
-	protected praktikumHolonsAdapter adapter;
+public class PraktikumHolonsTestAutoSaveControlle {
+	protected PraktikumHolonsAdapter adapter;
 	protected Model model;
 	protected MultiPurposeController mp;
 	protected CategoryController cg;
@@ -22,7 +22,7 @@ public class praktikumHolonsTestAutoSaveController {
 	protected ObjectController obj;
 	protected StoreController storeController;
 	protected LoadController loadController;
-	protected idCounter id;
+	protected IdCounter id;
 	protected String path = System.getProperty("user.home") + "/HolonGUI/Test/";
 
 	/**
@@ -30,7 +30,7 @@ public class praktikumHolonsTestAutoSaveController {
 	 */
 	@Before
 	public void setUp() {
-		adapter = new praktikumHolonsAdapter();
+		adapter = new PraktikumHolonsAdapter();
 		model = new Model();
 		mp = new MultiPurposeController(model);
 		cg = new CategoryController(model, mp);

+ 5 - 5
src/tests/praktikumHolonsTestCanvasController.java → src/tests/PraktikumHolonsTestCanvasController.java

@@ -9,15 +9,15 @@ import ui.controller.CanvasController;
 import ui.controller.CategoryController;
 import ui.controller.MultiPurposeController;
 import ui.model.Model;
-import ui.model.idCounter;
+import ui.model.IdCounter;
 
 import org.junit.Test;
 import org.junit.Before;
 import static org.junit.Assert.assertTrue;
 
-public class praktikumHolonsTestCanvasController {
+public class PraktikumHolonsTestCanvasController {
 
-	protected praktikumHolonsAdapter adapter;
+	protected PraktikumHolonsAdapter adapter;
 	protected Model model;
 	protected MultiPurposeController mp;
 	protected CategoryController cg;
@@ -28,12 +28,12 @@ public class praktikumHolonsTestCanvasController {
 	 */
 	@Before
 	public void setUp() {
-		adapter = new praktikumHolonsAdapter();
+		adapter = new PraktikumHolonsAdapter();
 		model = new Model();
 		mp = new MultiPurposeController(model);
 		cg = new CategoryController(model, mp);
 		controller = new CanvasController(model, mp);
-		idCounter.setCounter(1);
+		IdCounter.setCounter(1);
 	}
 
 	/**

+ 3 - 3
src/tests/praktikumHolonsTestCategoryController.java → src/tests/PraktikumHolonsTestCategoryController.java

@@ -10,9 +10,9 @@ import ui.controller.CategoryController;
 import ui.controller.MultiPurposeController;
 import ui.model.Model;
 
-public class praktikumHolonsTestCategoryController {
+public class PraktikumHolonsTestCategoryController {
 
-	protected praktikumHolonsAdapter adapter;
+	protected PraktikumHolonsAdapter adapter;
 	protected Model model;
 	protected MultiPurposeController mp;
 	protected CategoryController controller;
@@ -22,7 +22,7 @@ public class praktikumHolonsTestCategoryController {
 	 */
 	@Before
 	public void setUp() {
-		adapter = new praktikumHolonsAdapter();
+		adapter = new PraktikumHolonsAdapter();
 		model = new Model();
 		mp = new MultiPurposeController(model);
 		controller = new CategoryController(model, mp);

+ 1 - 1
src/tests/praktikumHolonsTestClasses.java → src/tests/PraktikumHolonsTestClasses.java

@@ -9,7 +9,7 @@ import java.util.ArrayList;
 import org.junit.Before;
 import org.junit.Test;
 
-public class praktikumHolonsTestClasses {
+public class PraktikumHolonsTestClasses {
 
 	@Test
 	public void testCategory() {

+ 1 - 1
src/tests/praktikumHolonsTestGlobalController.java → src/tests/PraktikumHolonsTestGlobalController.java

@@ -9,7 +9,7 @@ import java.util.ArrayList;
 import ui.controller.GlobalController;
 import ui.model.Model;
 
-public class praktikumHolonsTestGlobalController {
+public class PraktikumHolonsTestGlobalController {
 
 	protected Model model;
 	protected GlobalController controller;

+ 5 - 5
src/tests/praktikumHolonsTestLoadAndStoreController.java → src/tests/PraktikumHolonsTestLoadAndStoreController.java

@@ -35,12 +35,12 @@ import ui.controller.MultiPurposeController;
 import ui.controller.ObjectController;
 import ui.controller.StoreController;
 import ui.model.Model;
-import ui.model.idCounter;
+import ui.model.IdCounter;
 import ui.view.UnitGraph;
 
-public class praktikumHolonsTestLoadAndStoreController {
+public class PraktikumHolonsTestLoadAndStoreController {
 
-	protected praktikumHolonsAdapter adapter;
+	protected PraktikumHolonsAdapter adapter;
 	protected Model model;
 	protected MultiPurposeController mp;
 	protected CategoryController cg;
@@ -48,7 +48,7 @@ public class praktikumHolonsTestLoadAndStoreController {
 	protected ObjectController obj;
 	protected StoreController storeController;
 	protected LoadController loadController;
-	protected idCounter id;
+	protected IdCounter id;
 	protected String path = System.getProperty("user.home") + "/HolonGUI/Test/";
 
 	/**
@@ -56,7 +56,7 @@ public class praktikumHolonsTestLoadAndStoreController {
 	 */
 	@Before
 	public void setUp() {
-		adapter = new praktikumHolonsAdapter();
+		adapter = new PraktikumHolonsAdapter();
 		model = new Model();
 		mp = new MultiPurposeController(model);
 		cg = new CategoryController(model, mp);

+ 3 - 3
src/tests/praktikumHolonsTestObjectController.java → src/tests/PraktikumHolonsTestObjectController.java

@@ -13,9 +13,9 @@ import ui.controller.MultiPurposeController;
 import ui.controller.ObjectController;
 import ui.model.Model;
 
-public class praktikumHolonsTestObjectController {
+public class PraktikumHolonsTestObjectController {
 
-	protected praktikumHolonsAdapter adapter;
+	protected PraktikumHolonsAdapter adapter;
 	protected Model model;
 	protected MultiPurposeController mp;
 	protected CategoryController cg;
@@ -27,7 +27,7 @@ public class praktikumHolonsTestObjectController {
 	 */
 	@Before
 	public void setUp() {
-		adapter = new praktikumHolonsAdapter();
+		adapter = new PraktikumHolonsAdapter();
 		model = new Model();
 		mp = new MultiPurposeController(model);
 		cg = new CategoryController(model, mp);

+ 7 - 7
src/tests/praktikumHolonsTestSuite.java → src/tests/PraktikumHolonsTestSuite.java

@@ -4,7 +4,7 @@ import junit.framework.JUnit4TestAdapter;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-public class praktikumHolonsTestSuite {
+public class PraktikumHolonsTestSuite {
 
 
 	/**
@@ -14,13 +14,13 @@ public class praktikumHolonsTestSuite {
 	 */
 	public static Test suite() {
 		TestSuite suite = new TestSuite("Tests for prakikum-holons");
-		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(praktikumHolonsTestGlobalController.class));
+		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(PraktikumHolonsTestGlobalController.class));
 //		suite.addTest(new JUnit4TestAdapter(praktikumHolonsTestAutoSaveController.class));
-		suite.addTest(new JUnit4TestAdapter(praktikumHolonsTestClasses.class));
+		suite.addTest(new JUnit4TestAdapter(PraktikumHolonsTestClasses.class));
 		return suite;
 	}
 }

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

@@ -22,7 +22,7 @@ import classes.HolonObject;
 import classes.HolonSwitch;
 import classes.HolonTransformer;
 import ui.model.Model;
-import ui.model.idCounter;
+import ui.model.IdCounter;
 
 public class LoadController {
 
@@ -83,7 +83,7 @@ public class LoadController {
 			if (key.equals("CG"))
 				readCategory((JSONArray) json.get(key));
 			else if (key.equals("ID"))
-				idCounter.setCounter(Integer.parseInt(json.get(key.toString()).toString()));
+				IdCounter.setCounter(Integer.parseInt(json.get(key.toString()).toString()));
 			else if (key.toString().contains("CGO") || key.toString().contains("CVSO"))
 				obj.add(key.toString());
 			else if (key.toString().contains("CGE") || key.toString().contains("CVSE"))

+ 3 - 3
src/ui/controller/StoreController.java

@@ -16,7 +16,7 @@ import classes.HolonObject;
 import classes.HolonSwitch;
 import classes.HolonTransformer;
 import ui.model.Model;
-import ui.model.idCounter;
+import ui.model.IdCounter;
 
 public class StoreController {
 
@@ -38,7 +38,7 @@ public class StoreController {
 		JSONObject json = new JSONObject();
 
 		json.put("MODE", "ALL");
-		json.put("ID", idCounter.getCounter());
+		json.put("ID", IdCounter.getCounter());
 		writeCategory(json);
 		writeCategoryObjects(json);
 		writeCanvasObjects(json);
@@ -60,7 +60,7 @@ public class StoreController {
 		JSONObject json = new JSONObject();
 		
 		json.put("MODE", "CANVAS");
-		json.put("ID", idCounter.getCounter());
+		json.put("ID", IdCounter.getCounter());
 		writeCanvasObjects(json);
 		writeCanvasElements(json);
 		writeEdges(json);

+ 18 - 2
src/ui/model/idCounter.java → src/ui/model/IdCounter.java

@@ -1,14 +1,25 @@
 package ui.model;
 
-public class idCounter {
+/**
+ * ID-Counter for all Cps Objects.
+ * 
+ * @author Gruppe14
+ */
+public class IdCounter {
 	private static int counter = 1;
 
+	/**
+	 * Return the next ID and increment the ID counter by 1.
+	 * @return the next ID
+	 */
 	public static synchronized int nextId() {
 		return counter++;
 
 	}
 
 	/**
+	 * Return the Counter.
+	 * 
 	 * @return the counter
 	 */
 	public static int getCounter() {
@@ -16,13 +27,18 @@ public class idCounter {
 	}
 
 	/**
+	 * Set the Counter.
+	 * 
 	 * @param counter
 	 *            the counter to set
 	 */
 	public static void setCounter(int counter) {
-		idCounter.counter = counter;
+		IdCounter.counter = counter;
 	}
 
+	/**
+	 * Reset the Counter.
+	 */
 	public static void resetCounter() {
 		counter = 1;
 	}

+ 19 - 2
src/ui/model/idCounterElem.java → src/ui/model/IdCounterElem.java

@@ -1,14 +1,26 @@
 package ui.model;
 
-public class idCounterElem {
+/**
+ * ID-Counter for all Holon Elements.
+ * 
+ * @author Gruppe14
+ */
+public class IdCounterElem {
 	private static int counter = 1;
 
+	/**
+	 * Return the next ID and increment the ID counter by 1.
+	 * 
+	 * @return the next ID
+	 */
 	public static synchronized int nextId() {
 		return counter++;
 
 	}
 
 	/**
+	 * Return the Counter.
+	 * 
 	 * @return the counter
 	 */
 	public static int getCounter() {
@@ -16,13 +28,18 @@ public class idCounterElem {
 	}
 
 	/**
+	 * Set the Counter.
+	 * 
 	 * @param counter
 	 *            the counter to set
 	 */
 	public static void setCounter(int counter) {
-		idCounterElem.counter = counter;
+		IdCounterElem.counter = counter;
 	}
 
+	/**
+	 * Reset the Counter.
+	 */
 	public static void resetCounter() {
 		counter = 1;
 	}

+ 14 - 4
src/ui/view/AboutUsPopUp.java

@@ -9,17 +9,27 @@ import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 
+/**
+ * AboutUs Pop Up Window.
+ * 
+ * @author Gruppe14
+ */
 public class AboutUsPopUp extends JFrame {
+	/**
+	 * Serial.
+	 */
+	private static final long serialVersionUID = 1L;
 	private final JPanel contentPanel = new JPanel();
 	private final JPanel contentPanel2 = new JPanel();
 	private final JPanel contentPanel3 = new JPanel();
 	private JLabel titel = new JLabel("Cyber Physical Systems");
 	private JLabel text = new JLabel("Something nice for the user :D");
-	private JLabel names_developers = new JLabel("K. Trometer, D. Rieder, T. Zheng, J. Widhalm and E. Palza");
-	private JLabel names_client = new JLabel("");
-	private JLabel name_leader = new JLabel("");
+	private JLabel namesDevelopers = new JLabel("K. Trometer, D. Rieder, T. Zheng, J. Widhalm and E. Palza");
 	private JLabel credits = new JLabel();
 
+	/**
+	 * Constructor.
+	 */
 	public AboutUsPopUp() {
 		super("About Us");
 		this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
@@ -35,7 +45,7 @@ public class AboutUsPopUp extends JFrame {
 		contentPanel2.add(text);
 		contentPanel2.add(credits);
 		getContentPane().add(contentPanel2, BorderLayout.CENTER);
-		contentPanel3.add(names_developers);
+		contentPanel3.add(namesDevelopers);
 		getContentPane().add(contentPanel3, BorderLayout.SOUTH);
 	}
 }

+ 21 - 7
src/ui/view/AddElementPopUp.java

@@ -4,8 +4,6 @@ import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.FlowLayout;
 import java.awt.Image;
-import java.util.ArrayList;
-
 import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JPanel;
@@ -14,22 +12,26 @@ import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JTextField;
-import javax.swing.JComboBox;
-import javax.swing.DefaultComboBoxModel;
 import javax.swing.ImageIcon;
 
 import classes.AbstractCpsObject;
 import classes.HolonElement;
 import classes.HolonObject;
-import ui.model.Model;
-
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
 import java.awt.event.ActionEvent;
-
+/**
+ * popup for adding an Holon Element to a holon Object.
+ * 
+ * @author Gruppe14
+ */
 public class AddElementPopUp extends JDialog {
 
+	/**
+	 * Serial.
+	 */
+	private static final long serialVersionUID = 1L;
 	private final JPanel contentPanel = new JPanel();
 	private JTextField elementName;
 	private JTextField providedEnergy;
@@ -39,6 +41,8 @@ public class AddElementPopUp extends JDialog {
 
 	/**
 	 * Launch the application.
+	 * 
+	 * @param args standard
 	 */
 	public static void main(String[] args) {
 		try {
@@ -173,10 +177,20 @@ public class AddElementPopUp extends JDialog {
 
 	}
 
+	/**
+	 * Sets the actual Cps.
+	 * 
+	 * @param cps actual Cps
+	 */
 	public void setActualCps(AbstractCpsObject cps) {
 		this.tempCps = cps;
 	}
 
+	/**
+	 * Returns the created Element.
+	 * 
+	 * @return the Element
+	 */
 	public HolonElement getElement() {
 		return hl;
 	}

+ 78 - 15
src/ui/view/AddObjectPopUp.java

@@ -40,8 +40,14 @@ import classes.HolonElement;
 import classes.HolonObject;
 import ui.controller.Control;
 
+/**
+ * Popup for adding a Holon Object to a Category.
+ * 
+ * @author Gruppe14
+ */
 public class AddObjectPopUp extends JDialog {
 
+	private static final long serialVersionUID = 1L;
 	private final JPanel contentPanel = new JPanel();
 	private AddElementPopUp addElement;
 	private JTextField objectName;
@@ -62,6 +68,9 @@ public class AddObjectPopUp extends JDialog {
 
 	/**
 	 * Launch the application.
+	 * 
+	 * @param args
+	 *            standard
 	 */
 	public static void main(String[] args) {
 		try {
@@ -75,6 +84,13 @@ public class AddObjectPopUp extends JDialog {
 
 	/**
 	 * Create the dialog.
+	 * 
+	 * @param edit
+	 *            true if edit
+	 * @param obj
+	 *            the object
+	 * @param cat
+	 *            the categorie
 	 */
 	public AddObjectPopUp(boolean edit, AbstractCpsObject obj, String cat) {
 		toEdit = obj;
@@ -168,8 +184,8 @@ public class AddObjectPopUp extends JDialog {
 				sourcePath.setText(filePath);
 				ImageIcon icon = new ImageIcon(
 						new ImageIcon(filePath).getImage().getScaledInstance(50, 50, Image.SCALE_SMOOTH));
-				if(icon != null)
-				lblImagePreview.setIcon(icon);
+				if (icon != null)
+					lblImagePreview.setIcon(icon);
 			}
 			sourcePath.setBounds(148, 77, 271, 20);
 			contentPanel.add(sourcePath);
@@ -183,6 +199,11 @@ public class AddObjectPopUp extends JDialog {
 					addElement.setActualCps(toEdit);
 					addElement.setVisible(true);
 					HolonElement hl = addElement.getElement();
+					
+					if (hl != null) {
+						addElement(hl);
+					}
+
 					hl.setSav(givenCategory);
 					hl.setObj(objectName.getText());
 					addElement(hl);
@@ -199,11 +220,11 @@ public class AddObjectPopUp extends JDialog {
 			{
 
 				listModel = new DefaultListModel();
-				HolonElement hel = new HolonElement("Test", 100, 5);
-				String name = hel.getEleName();
+
 				/*
-				 * for (int i = 0; i < 11; i++) { hel.setEleName(name + i);
-				 * addElement(hel); }
+				 * HolonElement hel = new HolonElement("Test", 100, 5); String
+				 * name = hel.getEleName(); for (int i = 0; i < 11; i++) {
+				 * hel.setEleName(name + i); addElement(hel); }
 				 */
 				list = new JList(listModel);
 				scrollPane.setViewportView(list);
@@ -228,7 +249,7 @@ public class AddObjectPopUp extends JDialog {
 			btnNewButton.setBounds(270, 182, 142, 27);
 			contentPanel.add(btnNewButton);
 		}
-		
+
 		{
 			JPanel buttonPane = new JPanel();
 			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
@@ -241,8 +262,8 @@ public class AddObjectPopUp extends JDialog {
 						if (objectName.getText().length() > 0) {
 							if (sourcePath.getText().equals(filePath)) {
 								imagePath = filePath;
-								if(imageChanged)
-								copieFile();
+								if (imageChanged)
+									copieFile();
 								imageChanged = false;
 								// theObject = new
 								// HolonObject(objectName.getText());
@@ -290,19 +311,28 @@ public class AddObjectPopUp extends JDialog {
 		}
 	}
 
+	/**
+	 * adds a Holon Element.
+	 * 
+	 * @param hl
+	 *            the HolonElement
+	 */
 	public void addElement(HolonElement hl) {
 		hElements.add(hl);
 		listModel.addElement(hl.getAmount() + "x: " + hl.getEleName() + " " + hl.getEnergy() + "U");
 	}
 
+	/**
+	 * Choose the file.
+	 */
 	protected void fileChooser() {
 		// TODO Auto-generated method stub
-		JFileChooser FileChooser = new JFileChooser();
+		JFileChooser fileChooser = new JFileChooser();
 		FileNameExtensionFilter filter = new FileNameExtensionFilter("png, jpg or jpeg", "png", "jpg", "jpeg");
-		FileChooser.setFileFilter(filter);
-		int returnValue = FileChooser.showOpenDialog(null);
+		fileChooser.setFileFilter(filter);
+		int returnValue = fileChooser.showOpenDialog(null);
 		if (returnValue == JFileChooser.APPROVE_OPTION) {
-			selectedFile = FileChooser.getSelectedFile();
+			selectedFile = fileChooser.getSelectedFile();
 			filePath = selectedFile.getAbsolutePath();
 			sourcePath.setText(filePath);
 			ImageIcon icon = new ImageIcon(
@@ -315,6 +345,9 @@ public class AddObjectPopUp extends JDialog {
 
 	}
 
+	/**
+	 * Copies the File.
+	 */
 	protected void copieFile() {
 		InputStream inStream = null;
 		OutputStream outStream = null;
@@ -339,15 +372,30 @@ public class AddObjectPopUp extends JDialog {
 			if (outStream != null)
 				outStream.close();
 			System.out.println("File Copied..");
-		} catch (IOException e1) {
-			e1.printStackTrace();
+		} catch (IOException eex) {
+			eex.printStackTrace();
 		}
 	}
 
+	/**
+	 * Edit the Information.
+	 * 
+	 * @param obj
+	 *            the CpsObject
+	 */
 	public void editInformation(HolonObject obj) {
 		objectName.setText(obj.getName());
 	}
 
+	/**
+	 * Get Jar Containing Folder.
+	 * 
+	 * @param aclass
+	 *            aClass
+	 * @return String
+	 * @throws Exception
+	 *             Exception
+	 */
 	public static String getJarContainingFolder(Class aclass) throws Exception {
 		CodeSource codeSource = aclass.getProtectionDomain().getCodeSource();
 
@@ -364,14 +412,29 @@ public class AddObjectPopUp extends JDialog {
 		return jarFile.getParentFile().getAbsolutePath();
 	}
 
+	/**
+	 * Return the Object.
+	 * 
+	 * @return the CpsObject
+	 */
 	public HolonObject getObject() {
 		return theObject;
 	}
 
+	/**
+	 * Sets the Controller.
+	 * 
+	 * @param controller the controller
+	 */
 	public void setController(Control controller) {
 		this.controller = controller;
 	}
 
+	/**
+	 * Set the Category.
+	 * 
+	 * @param cat the Category
+	 */
 	public void setCategory(String cat) {
 		givenCategory = cat;
 	}

+ 5 - 2
src/ui/view/CategoryPanel.java

@@ -1,7 +1,10 @@
 package ui.view;
-
+/**
+ * Here should be the Category Panel.
+ * 
+ * @author Gruppe14
+ */
 public class CategoryPanel {
 
 }
 
-//hier müsste das Panel eigentlich sein

+ 14 - 8
src/ui/view/Console.java

@@ -19,11 +19,14 @@ import javax.swing.JMenuItem;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 
+/**
+ * A Console is a Pane where text can be Printed on.
+ * 
+ * @author Gruppe14
+ * 
+ */
 public class Console extends JScrollPane {
 
-	/**
-	 * 
-	 */
 	private static final long serialVersionUID = 1L;
 	private final JTextPane consoleText = new JTextPane();
 	private final JPanel panel = new JPanel();
@@ -35,6 +38,9 @@ public class Console extends JScrollPane {
 	private JMenuItem itemCopy = new JMenuItem("Copy");
 	private JMenuItem itemClear = new JMenuItem("Clear Console");
 
+	/**
+	 * Constructor.
+	 */
 	public Console() {
 		super();
 		this.setBackground(Color.WHITE);
@@ -73,6 +79,7 @@ public class Console extends JScrollPane {
 
 		// MouseListener
 		consoleText.addMouseListener(new MouseAdapter() {
+			@SuppressWarnings("static-access")
 			@Override
 			public void mouseReleased(MouseEvent e) {
 				if (e.getButton() == e.BUTTON3) {
@@ -85,7 +92,7 @@ public class Console extends JScrollPane {
 	}
 
 	/**
-	 * Print Text on the console
+	 * Print Text on the console.
 	 *
 	 * @param text
 	 *            String the Text
@@ -97,10 +104,9 @@ public class Console extends JScrollPane {
 	 *            bold or not
 	 * @param italic
 	 *            italic or not
-	 * @param ln
+	 * @param nl
 	 *            new line or not
 	 * 
-	 * @return selected CpsObject
 	 */
 	public void addText(String text, Color color, int p, boolean bold, boolean italic, boolean nl) {
 		StyleConstants.setForeground(style, color);
@@ -118,7 +124,7 @@ public class Console extends JScrollPane {
 	}
 
 	/**
-	 * Print Text on the console in black and font size 12
+	 * Print Text on the console in black and font size 12.
 	 *
 	 * @param text
 	 *            String the Text
@@ -136,7 +142,7 @@ public class Console extends JScrollPane {
 	}
 
 	/**
-	 * Clears the console
+	 * Clears the console.
 	 */
 	public void clearConsole() {
 		consoleText.setText("");

+ 21 - 4
src/ui/view/DefaulTable.java

@@ -2,22 +2,39 @@ package ui.view;
 
 import javax.swing.table.DefaultTableModel;
 
+/**
+ * Default Table.
+ * 
+ * @author Gruppe14
+ */
 public class DefaulTable extends DefaultTableModel {
-	private boolean[][] editable_cells; // 2d array to represent rows and
+	private boolean[][] editableCells; // 2d array to represent rows and
 										// columns
 
+	/**
+	 * Constructor.
+	 * 
+	 * @param rows the Rows
+	 * @param cols the Cols
+	 */
 	DefaulTable(int rows, int cols) { // constructor
 		super(rows, cols);
-		this.editable_cells = new boolean[rows][cols];
+		this.editableCells = new boolean[rows][cols];
 	}
 
 	@Override
 	public boolean isCellEditable(int row, int column) {
-		return this.editable_cells[row][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.editable_cells[row][col] = value; // set cell true/false
+		this.editableCells[row][col] = value; // set cell true/false
 		this.fireTableCellUpdated(row, col);
 	}
 

+ 91 - 49
src/ui/view/EditEdgesPopUp.java

@@ -21,21 +21,29 @@ import ui.controller.Control;
 import java.awt.event.ActionListener;
 import java.awt.event.ActionEvent;
 
-public class EditEdgesPopUp extends JDialog{
+/**
+ * Popup for Editing Edges.
+ * 
+ * @author Gruppe14
+ */
+public class EditEdgesPopUp extends JDialog {
+
+	private static final long serialVersionUID = 1L;
 	private final JPanel contentPanel = new JPanel();
-	private JTextField textField;
-	private final JButton btnOk = new JButton("OK");
 	private JTextField capacityField;
 	private float capacity;
 	private JRadioButton rdbtnChangeForAll;
 	private JRadioButton rdbtnChangeForNew;
-	private JRadioButton rdbtnChangeForAll_1;
+	private JRadioButton rdbtnChangeForAll1;
 	private Control controller;
 	private MyCanvas canvas;
 	private JLabel lblenterinfiniteFor;
-	
+
 	/**
 	 * Launch the application.
+	 * 
+	 * @param args
+	 *            standard
 	 */
 	public static void main(String[] args) {
 		try {
@@ -47,7 +55,10 @@ public class EditEdgesPopUp extends JDialog{
 			e.printStackTrace();
 		}
 	}
-	
+
+	/**
+	 * Constructor.
+	 */
 	public EditEdgesPopUp() {
 		super((java.awt.Frame) null, true);
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
@@ -57,29 +68,29 @@ public class EditEdgesPopUp extends JDialog{
 		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
 		getContentPane().add(contentPanel, BorderLayout.CENTER);
 		contentPanel.setLayout(null);
-		
+
 		JLabel lblMaximumCapacity = new JLabel("Maximum Capacity:");
 		lblMaximumCapacity.setFont(new Font("Tahoma", Font.PLAIN, 11));
 		lblMaximumCapacity.setBounds(10, 11, 98, 14);
 		contentPanel.add(lblMaximumCapacity);
-		
+
 		capacityField = new JTextField();
 		capacityField.setBounds(107, 8, 120, 20);
 		contentPanel.add(capacityField);
 		capacityField.setColumns(10);
-		
+
 		rdbtnChangeForAll = new JRadioButton("Change for all existing Edges only");
 		rdbtnChangeForAll.setBounds(10, 39, 265, 23);
 		contentPanel.add(rdbtnChangeForAll);
-		
+
 		rdbtnChangeForNew = new JRadioButton("Change for new created Edges only");
 		rdbtnChangeForNew.setBounds(10, 65, 265, 23);
 		contentPanel.add(rdbtnChangeForNew);
-		
-		rdbtnChangeForAll_1 = new JRadioButton("Change for all existing and new created Edges");
-		rdbtnChangeForAll_1.setBounds(10, 95, 296, 23);
-		contentPanel.add(rdbtnChangeForAll_1);
-		
+
+		rdbtnChangeForAll1 = new JRadioButton("Change for all existing and new created Edges");
+		rdbtnChangeForAll1.setBounds(10, 95, 296, 23);
+		contentPanel.add(rdbtnChangeForAll1);
+
 		JButton btnCancel = new JButton("Cancel");
 		btnCancel.setActionCommand("Cancel");
 		btnCancel.addActionListener(new ActionListener() {
@@ -89,82 +100,113 @@ public class EditEdgesPopUp extends JDialog{
 		});
 		btnCancel.setBounds(285, 147, 89, 23);
 		contentPanel.add(btnCancel);
-		
-		JButton btnOk_1 = new JButton("OK");
-		btnOk_1.addActionListener(new ActionListener() {
+
+		JButton btnOk1 = new JButton("OK");
+		btnOk1.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent e) {
-				if(capacityField.getText().equals("infinite")){
+				if (capacityField.getText().equals("infinite")) {
 					capacity = -1;
-					if(rdbtnChangeForAll.isSelected()){
+					if (rdbtnChangeForAll.isSelected()) {
 						changeForExisting(capacity);
 						dispose();
-					}else if (rdbtnChangeForNew.isSelected()){
+					} else if (rdbtnChangeForNew.isSelected()) {
 						changeForNew(capacity);
 						dispose();
-					}else if(rdbtnChangeForAll_1.isSelected()){
+					} else if (rdbtnChangeForAll1.isSelected()) {
 						changeForExAndNew(capacity);
 						dispose();
-					}else{
-						JOptionPane.showMessageDialog(new JFrame(),
-								"Please select one of the options");
+					} else {
+						JOptionPane.showMessageDialog(new JFrame(), "Please select one of the options");
 					}
-				}else{
+				} else {
 					try {
 						capacity = Float.parseFloat(capacityField.getText().toString());
-						if(capacity < 0){
+						if (capacity < 0) {
 							throw new NumberFormatException();
 						}
-						if(rdbtnChangeForAll.isSelected()){
+						if (rdbtnChangeForAll.isSelected()) {
 							changeForExisting(capacity);
 							dispose();
-						}else if (rdbtnChangeForNew.isSelected()){
+						} else if (rdbtnChangeForNew.isSelected()) {
 							changeForNew(capacity);
 							dispose();
-						}else if(rdbtnChangeForAll_1.isSelected()){
+						} else if (rdbtnChangeForAll1.isSelected()) {
 							changeForExAndNew(capacity);
 							dispose();
-						}else{
-							JOptionPane.showMessageDialog(new JFrame(),
-									"Please select one of the options");
+						} else {
+							JOptionPane.showMessageDialog(new JFrame(), "Please select one of the options");
 						}
-					} catch (NumberFormatException e1) {
+					} catch (NumberFormatException eex) {
 						JOptionPane.showMessageDialog(new JFrame(),
-							"Please enter a number greater or equal 0 in the Field for Maximum Capacity");
+								"Please enter a number greater or equal 0 in the Field for Maximum Capacity");
 					}
-				}			}
+				}
+			}
 		});
-		btnOk_1.setBounds(186, 147, 89, 23);
-		contentPanel.add(btnOk_1);
+		btnOk1.setBounds(186, 147, 89, 23);
+		contentPanel.add(btnOk1);
 		this.setTitle("Edit Edge Capacities");
 		ButtonGroup bG = new ButtonGroup();
-		bG.add(rdbtnChangeForAll_1);
+		bG.add(rdbtnChangeForAll1);
 		bG.add(rdbtnChangeForNew);
 		bG.add(rdbtnChangeForAll);
-		
+
 		lblenterinfiniteFor = new JLabel("(enter \"infinite\" for infinite Capacity)");
 		lblenterinfiniteFor.setBounds(237, 11, 175, 14);
 		contentPanel.add(lblenterinfiniteFor);
 	}
-	
-	public void setCanvas(MyCanvas can){
+
+	/**
+	 * Set the Canvas.
+	 * 
+	 * @param can
+	 *            the Canvas
+	 */
+	public void setCanvas(MyCanvas can) {
 		canvas = can;
 	}
-	
-	public void setController(Control cont){
+
+	/**
+	 * set the Controller.
+	 * 
+	 * @param cont
+	 *            the Controller
+	 */
+	public void setController(Control cont) {
 		controller = cont;
 	}
-	
-	public void changeForNew(float cap){
+
+	/**
+	 * set edge capacity for new edges.
+	 * 
+	 * @param cap
+	 *            the capacity
+	 */
+	public void changeForNew(float cap) {
 		canvas.setEdgeCapacity(cap);
 	}
-	public void changeForExisting(float cap){
-		for(CpsEdge edge : controller.getModel().getEdgesOnCanvas()){
+
+	/**
+	 * Set Capacity for all existing Edges.
+	 * 
+	 * @param cap
+	 *            the Capacity
+	 */
+	public void changeForExisting(float cap) {
+		for (CpsEdge edge : controller.getModel().getEdgesOnCanvas()) {
 			edge.setCapacity(cap);
 		}
 		controller.calculateStateForCurrentTimeStep();
 		canvas.repaint();
 	}
-	public void changeForExAndNew(float cap){
+
+	/**
+	 * Set the Capacity for all existing and new edges.
+	 * 
+	 * @param cap
+	 *            the capacity
+	 */
+	public void changeForExAndNew(float cap) {
 		changeForNew(cap);
 		changeForExisting(cap);
 	}

+ 13 - 7
src/ui/view/GUI.java

@@ -70,9 +70,15 @@ import classes.HolonSwitch;
 import classes.HolonTransformer;
 import ui.controller.Control;
 import ui.model.Model;
-import ui.model.idCounter;
-import ui.model.idCounterElem;;
-
+import ui.model.IdCounter;
+import ui.model.IdCounterElem;;
+
+/**
+ * Graphical User Interface.
+ * @author Gruppe14
+ * 
+ * @param <E> Generic
+ */
 public class GUI<E> implements CategoryListener {
 
 	private JFrame frmCyberPhysical;
@@ -399,7 +405,7 @@ public class GUI<E> implements CategoryListener {
 
 			@Override
 			public void actionPerformed(ActionEvent e) {
-				searchPopUp dialog = new searchPopUp(controller, canvas);
+				SearchPopUp dialog = new SearchPopUp(controller, canvas);
 				dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
 				dialog.setVisible(true);
 			}
@@ -484,7 +490,7 @@ public class GUI<E> implements CategoryListener {
 			public void actionPerformed(ActionEvent e) {
 				try {
 
-					searchPopUp dialog = new searchPopUp(controller, canvas);
+					SearchPopUp dialog = new SearchPopUp(controller, canvas);
 					dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
 					dialog.setVisible(true);
 				} catch (Exception e1) {
@@ -1339,8 +1345,8 @@ public class GUI<E> implements CategoryListener {
 				canvas.tempCps = null;
 				canvas.objectSelectionHighlighting();
 				canvas.repaint();
-				idCounter.resetCounter();
-				idCounterElem.resetCounter();
+				IdCounter.resetCounter();
+				IdCounterElem.resetCounter();
 			}
 		});
 

+ 2 - 2
src/ui/view/searchPopUp.java → src/ui/view/SearchPopUp.java

@@ -24,7 +24,7 @@ import java.awt.event.ActionListener;
 import java.util.ArrayList;
 import java.awt.event.ActionEvent;
 
-public class searchPopUp extends JDialog {
+public class SearchPopUp extends JDialog {
 	private final JPanel contentPanel = new JPanel();
 	private JTextField replaceTextField;
 	private JTextField findTextField;
@@ -36,7 +36,7 @@ public class searchPopUp extends JDialog {
 	private JRadioButton rdbtnSingle;
 	private int idx;
 
-	searchPopUp(Control contr, MyCanvas can) {
+	SearchPopUp(Control contr, MyCanvas can) {
 		super((java.awt.Frame) null, true);
 		idx = -1;
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);