Просмотр исходного кода

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

# Conflicts:
#	src/ui/controller/NodeController.java
Teh-Hai Julian Zheng 8 лет назад
Родитель
Сommit
a2f29f6e43

BIN
bin/ui/controller/Control.class


BIN
build/resources/main/Images/Thumbs.db


BIN
build/resources/test/Images/Thumbs.db


BIN
res/Images/Thumbs.db


BIN
res/Images/upper_node.png


+ 25 - 1
src/ui/controller/Control.java

@@ -38,6 +38,7 @@ public class Control {
 	private final LoadController loadController;
 	private final AutoSaveController autoSaveController;
 	private SimulationManager simulationManager;
+	private final StatsController statsController;
 	private String autoPath = "";
 
 	/**
@@ -60,6 +61,7 @@ public class Control {
 		this.simulationManager = new SimulationManager(model);
 		this.autoSaveController = new AutoSaveController(model);
 		this.consoleController = new ConsoleController(model);
+		this.statsController = new StatsController(model);
 		autoPath = System.getProperty("user.home") + "/HolonGUI/Autosave/";
 		File dest = new File(autoPath);
 		// deleteDirectory(dest);
@@ -399,7 +401,7 @@ public class Control {
 	public void addSubNetColor(Color c) {
 		globalController.addSubNetColor(c);
 	}
-	
+
 	/**
 	 * Returns SCALE.
 	 * 
@@ -701,4 +703,26 @@ public class Control {
 		}
 	}
 
+	/**
+	 * Set Tracking Objects
+	 */
+	public void setTrackingObj(ArrayList<HolonObject> objArr) {
+		statsController.setTrackingObj(objArr);
+	}
+
+	/**
+	 * Get Tracking Objects
+	 */
+	public ArrayList<HolonObject> getTrackingObj() {
+		return statsController.getTrackingObj();
+	}
+
+	public void addTrackingObj(HolonObject obj) {
+		statsController.addTrackingObj(obj);
+	}
+
+	public void removeTrackingObj(HolonObject obj) {
+		statsController.removeTrackingObj(obj);
+	}
+
 }

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

@@ -0,0 +1,37 @@
+package ui.controller;
+
+import java.util.ArrayList;
+
+import classes.HolonElement;
+import classes.HolonObject;
+import ui.model.Model;
+
+public class StatsController {
+
+	private Model model;
+
+	public StatsController(Model mod) {
+		this.model = mod;
+
+	}
+
+	public void setTrackingObj(ArrayList<HolonObject> objArr) {
+		model.setTrackingObj(objArr);
+	}
+
+	public ArrayList<HolonObject> getTrackingObj() {
+		return model.getTrackingObj();
+	}
+
+	public void addTrackingObj(HolonObject obj) {
+		ArrayList<HolonObject> objArr = model.getTrackingObj();
+		objArr.add(obj);
+		model.setTrackingObj(objArr);
+	}
+
+	public void removeTrackingObj(HolonObject obj) {
+		ArrayList<HolonObject> objArr = model.getTrackingObj();
+		objArr.remove(obj);
+		model.setTrackingObj(objArr);
+	}
+}

+ 16 - 0
src/ui/model/Model.java

@@ -11,6 +11,7 @@ import classes.Category;
 import classes.CpsEdge;
 import classes.AbstractCpsObject;
 import classes.HolonElement;
+import classes.HolonObject;
 import interfaces.CategoryListener;
 import interfaces.ObjectListener;
 import ui.view.Console;
@@ -57,6 +58,12 @@ public class Model {
 	 */
 	private ArrayList<Category> categories;
 
+	/*
+	 * Array of all HolonObj, that should be tracked through out the statistics
+	 * tab
+	 */
+	private ArrayList<HolonObject> trackingObj;
+
 	/*
 	 * Array of all CpsObjects in our canvas. It is set by default as an empty
 	 * list.
@@ -97,6 +104,7 @@ public class Model {
 		setCgIdx(new HashMap<String, Integer>());
 		setCvsObjIdx(new HashMap<Integer, Integer>());
 		setClipboradObjects(new ArrayList<AbstractCpsObject>());
+		setTrackingObj(new ArrayList<HolonObject>());
 	}
 
 	/**
@@ -605,4 +613,12 @@ public class Model {
 		return this.subNetColors;
 	}
 
+	public void setTrackingObj(ArrayList<HolonObject> toTrack) {
+		trackingObj = toTrack;
+	}
+
+	public ArrayList<HolonObject> getTrackingObj() {
+		return trackingObj;
+	}
+
 }

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

@@ -110,6 +110,9 @@ public class GUI<E> implements CategoryListener {
 	private JMenuItem editItem = new JMenuItem("Edit Object");
 	private String catOfObjToBeEdited;
 	private final JScrollPane statTab = new JScrollPane();
+	
+	private StatisticPane statPane = new StatisticPane();
+	private JScrollPane statScrollPane = new JScrollPane(statPane);
 
 	private final JLabel maxGraph = new JLabel("100%");
 	private final JLabel medGraph = new JLabel("50%");
@@ -218,8 +221,8 @@ public class GUI<E> implements CategoryListener {
 
 	private Console console = new Console();
 	private MyCanvas canvas;
-	private StatisticsTab stats;
 	private UnitGraph unitGraph;
+	private StatisticGraph statGraph;
 	private final JSplitPane splitPane3 = new JSplitPane();
 	private final JSlider sizeSlider = new JSlider();
 	private final JLabel lblImageSize = new JLabel(Languages.getLanguage()[94]);
@@ -262,8 +265,8 @@ public class GUI<E> implements CategoryListener {
 		this.controller = control;
 		this.model = control.getModel();
 		this.canvas = new MyCanvas(model, control);
-		this.stats = new StatisticsTab(model, control);
 		this.unitGraph = new UnitGraph(model, control);
+		this.statGraph = new StatisticGraph(model, controller);
 		control.initListener(this);
 		controller.setCanvas(canvas);
 		model.setConsole(console);
@@ -595,8 +598,6 @@ public class GUI<E> implements CategoryListener {
 
 		canvas.setBackground(Color.WHITE);
 		canvas.setPreferredSize(new Dimension(model.getCanvasX(), model.getCanvasY()));
-		stats.setBackground(Color.WHITE);
-		stats.setPreferredSize(new Dimension(model.getCanvasX(), model.getCanvasY()));
 
 		/********************
 		 * RIGHT CONTAINER (INFORMATION)
@@ -1571,6 +1572,7 @@ public class GUI<E> implements CategoryListener {
 				controller.calculateStateForTimeStep(i);
 
 				unitGraph.repaint();
+				statGraph.repaint();
 			}
 		});
 		splitPane.setRightComponent(splitPane1);
@@ -1581,7 +1583,7 @@ public class GUI<E> implements CategoryListener {
 		splitPane.setLeftComponent(scrollPane1);
 		splitPaneCanvasConsole.setLeftComponent(panelTapped_SimMenu);
 		tabbedPane.addTab("View", canvasSP);
-		tabbedPane.addTab("Statistics", statTab);
+		tabbedPane.addTab("Statistics", statScrollPane);
 		// splitPaneCanvasConsole.setLeftComponent(canvasSP);
 		splitPaneCanvasConsole.setRightComponent(console);
 		splitPane1.setLeftComponent(splitPaneCanvasConsole);
@@ -1596,7 +1598,6 @@ public class GUI<E> implements CategoryListener {
 		splitGraphHolonEl.setTopComponent(scrollGraph);
 		splitGraphHolonEl.setBottomComponent(scrollElements);
 		canvasSP.setViewportView(canvas);
-		statTab.setViewportView(stats);
 		panelTapped_SimMenu.setLayout(new BorderLayout());
 		panelTapped_SimMenu.add(simMenu, BorderLayout.NORTH);
 		panelTapped_SimMenu.add(tabbedPane);

+ 55 - 8
src/ui/view/MyCanvas.java

@@ -26,6 +26,7 @@ import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.JToolTip;
 
+import api.CpsAPI;
 import classes.CpsEdge;
 import classes.CpsNode;
 import classes.AbstractCpsObject;
@@ -75,6 +76,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 	public JMenuItem itemPaste = new JMenuItem("Paste");
 	public JMenuItem itemCollapse = new JMenuItem("Colapse Nodes");
 	public JMenuItem itemTrack = new JMenuItem("Track");
+	public JMenuItem itemUntrack = new JMenuItem("Untrack");
 	private JToolTip objectTT = new JToolTip();
 
 	private Point mousePosition = new Point(); // Mouse Position when
@@ -109,6 +111,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 		popmenu.addSeparator();
 		popmenu.add(itemCollapse);
 		popmenu.add(itemTrack);
+		popmenu.add(itemUntrack);
 
 		itemDelete.setEnabled(false);
 		itemCut.setEnabled(false);
@@ -116,23 +119,63 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 		itemPaste.setEnabled(false);
 		itemCollapse.setEnabled(false);
 		itemTrack.setEnabled(false);
+		itemUntrack.setEnabled(false);
 
 		itemCollapse.addActionListener(new ActionListener() {
 			@Override
 			public void actionPerformed(ActionEvent e) {
-				
+
 				repaint();
 			}
 		});
-		
+
 		itemTrack.addActionListener(new ActionListener() {
 			@Override
 			public void actionPerformed(ActionEvent e) {
-				
+				for (AbstractCpsObject o : model.getSelectedCpsObjects()) {
+					if (o instanceof HolonObject) {
+						boolean found = false;
+						if (control.getTrackingObj() != null) {
+							for (HolonObject obj : control.getTrackingObj()) {
+								if (obj.getID() == o.getID()) {
+									found = true;
+								}
+							}
+						}
+						if (!found) {
+							control.addTrackingObj((HolonObject) o);
+						}
+					}
+				}
+				System.out.println(control.getTrackingObj());
+			}
+		});
+
+		itemUntrack.addActionListener(new ActionListener() {
+
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				for (AbstractCpsObject o : model.getSelectedCpsObjects()) {
+					if (o instanceof HolonObject) {
+						boolean found = false;
+						if (control.getTrackingObj() != null) {
+							for (HolonObject obj : control.getTrackingObj()) {
+								if (obj.getID() == o.getID()) {
+									found = true;
+								}
+							}
+						}
+						if (found) {
+							control.removeTrackingObj((HolonObject) o);
+						}
+					}
+				}
+				System.out.println(control.getTrackingObj());
 			}
 		});
-		
+
 		itemDelete.addActionListener(new ActionListener() {
+
 			@Override
 			public void actionPerformed(ActionEvent e) {
 				// Remove the selected Object objects
@@ -192,11 +235,12 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 		// Test SubNet Coloring
 		int i = 0;
 		for (SubNet s : controller.getSimManager().getSubNets()) {
-			
-			if(model.getSubNetColors().size()-1 < i){
-				controller.addSubNetColor(new Color((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random() * 255)));
+
+			if (model.getSubNetColors().size() - 1 < i) {
+				controller.addSubNetColor(new Color((int) (Math.random() * 255), (int) (Math.random() * 255),
+						(int) (Math.random() * 255)));
 			}
-			
+
 			for (HolonObject cps : s.getObjects()) {
 				cps.setBorderColor(model.getSubNetColors().get(i));
 			}
@@ -471,8 +515,10 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 				itemCollapse.setEnabled(true);
 				if (!(tempCps instanceof HolonSwitch)) {
 					itemTrack.setEnabled(true);
+					itemUntrack.setEnabled(true);
 				} else {
 					itemTrack.setEnabled(false);
+					itemUntrack.setEnabled(false);
 				}
 				if (model.getSelectedCpsObjects().size() == 0) {
 					controller.addSelectedObject(tempCps);
@@ -483,6 +529,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 				itemDelete.setEnabled(false);
 				itemCollapse.setEnabled(false);
 				itemTrack.setEnabled(false);
+				itemUntrack.setEnabled(false);
 			}
 			mousePosition = this.getMousePosition();
 			popmenu.show(e.getComponent(), e.getX(), e.getY());

+ 1 - 0
src/ui/view/SimulationMenu.java

@@ -148,6 +148,7 @@ public class SimulationMenu extends JMenuBar {
 
 		// timerSpeed
 		simSpeedText.setMaximumSize(new Dimension(300, 300));
+		//simSpeedText.setMinimumSize(new Dimension(300, 300));
 		simSpeedText.addCaretListener(new CaretListener() {
 			@Override
 			public void caretUpdate(CaretEvent e) {

+ 193 - 0
src/ui/view/StatisticGraph.java

@@ -0,0 +1,193 @@
+package ui.view;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.GeneralPath;
+import java.util.ArrayList;
+
+import javax.swing.JPanel;
+
+import classes.HolonElement;
+import classes.HolonObject;
+import ui.controller.Control;
+import ui.model.Model;
+
+public class StatisticGraph extends JPanel {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	// Max Objects
+	final int MAX_OBJECTS = 8;
+
+	// Maximum y Value
+	double maximum = 0;
+
+	// is the Simulation running?
+	private boolean isSimRunning;
+
+	// Colours
+	private ArrayList<Color> colors = new ArrayList<>();
+
+	// model and controller
+	private Model model;
+	private Control controller;
+
+	// Graphics2D
+	private Graphics2D g2;
+	GeneralPath path = new GeneralPath();
+
+	// Data
+	private ArrayList<HolonObject> objects = new ArrayList<>();
+	private ArrayList<GeneralPath> objPaths = new ArrayList<>();
+
+	/**
+	 * Constructor.
+	 * 
+	 * @param model
+	 *            the Model
+	 * @param control
+	 *            the Controller
+	 */
+	public StatisticGraph(final Model model, Control control) {
+		this.controller = control;
+		this.model = model;
+		colors.add(Color.BLUE);
+		colors.add(Color.RED);
+		colors.add(Color.GREEN);
+		colors.add(Color.CYAN);
+		colors.add(Color.ORANGE);
+		colors.add(Color.PINK);
+		colors.add(Color.MAGENTA);
+		colors.add(Color.YELLOW);
+		
+		
+		
+		this.setBackground(Color.WHITE);
+	}
+
+	/**
+	 * Paints all Components on the Canvas.
+	 * 
+	 * @param g
+	 *            Graphics
+	 * 
+	 */
+	public void paintComponent(Graphics g) {
+		super.paintComponent(g);
+
+		// Graphics2D init
+		g2 = (Graphics2D) g;
+		RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		g2.setRenderingHints(rh);
+
+		// Paint the Grid
+		g2.setStroke(new BasicStroke(0));
+		g2.setColor(Color.BLACK);
+		for (int i = 0; i <= this.getWidth(); i += 10) {
+			g2.drawLine(i, 0, i, this.getHeight());
+		}
+		for (int i = 0; i <= this.getHeight(); i += 5) {
+			g2.drawLine(0, i, this.getWidth(), i);
+		}
+
+		// Reset?
+		if (!isSimRunning && model.getIsSimulation()) {
+			for (int i = 0; i < objects.size(); i++) {
+				objPaths.get(i).reset();
+				objPaths.get(i).moveTo(model.getCurIteration() * this.getWidth() / model.getIterations() - 1,
+						convertToCanvasY(Math.abs(objects.get(i).getCurrentEnergy())));
+			}
+		}
+
+		isSimRunning = model.getIsSimulation();
+
+		// if sim is on
+		if (isSimRunning) {
+			maximum = 0;
+			for (HolonObject obj : objects) {
+				if (maximum <= (Math.abs(obj.getCurrentEnergy()))) {
+					maximum = (Math.abs(obj.getCurrentEnergy()));
+				}
+			}
+
+			for (int i = 0; i < objects.size(); i++) {
+				g2.setColor(new Color((int) (Math.random() * 255), (int) (Math.random() * 255),
+						(int) (Math.random() * 255)));
+				objPaths.get(i).lineTo(model.getCurIteration() * this.getWidth() / model.getIterations() - 1,
+						convertToCanvasY(Math.abs(getEnergyAtCurrentTimeStep(objects.get(i)))));
+				objPaths.get(i).moveTo(model.getCurIteration() * this.getWidth() / model.getIterations() - 1,
+						convertToCanvasY(Math.abs(getEnergyAtCurrentTimeStep(objects.get(i)))));
+
+			}
+		}
+		g2.setStroke(new BasicStroke(3));
+		for (int i = 0; i < objPaths.size(); i++) {
+			g2.setColor(colors.get(i));
+			g2.draw(objPaths.get(i));
+		}
+
+	}
+
+	/**
+	 * Add an Object to the Graph if the maximum has not reached yet.
+	 * 
+	 * @param obj
+	 *            the Object to add
+	 */
+	public void addObject(HolonObject obj) {
+		if (objects.size() < MAX_OBJECTS && !objects.contains(obj)) {
+			objects.add((HolonObject) obj);
+			objPaths.add(new GeneralPath());
+			objPaths.get(objPaths.size() - 1)
+					.moveTo(model.getCurIteration() * this.getWidth() / model.getIterations() - 1, convertToCanvasY(Math
+							.abs(objects.get(objects.size() - 1).getCurrentEnergyAtTimeStep(model.getCurIteration()))));
+		}
+	}
+
+	/**
+	 * Removes an Object from the Graph.
+	 * 
+	 * @param obj
+	 *            the Object to remove
+	 */
+	public void removeObject(HolonObject obj) {
+		if (objects.contains(obj)) {
+			objPaths.remove(objects.indexOf(obj));
+			objects.remove(obj);
+		}
+	}
+
+	/**
+	 * converts the number to fit the canvas.
+	 * 
+	 * @param d
+	 *            the number to convert
+	 * @return the converted number
+	 */
+	public double convertToCanvasY(float d) {
+		return Math.abs((this.getHeight() - (d * (this.getHeight() / maximum))));
+	}
+	
+	/**
+	 * Does take into account which timestep is watched, calculates the max
+	 * values.
+	 * 
+	 * @return the currentEnergy
+	 */
+	public float getEnergyAtCurrentTimeStep(HolonObject obj) {
+		float temp = 0;
+		for (HolonElement e : obj.getElements()) {
+			if (e.getActive()) {
+				temp = temp + e.getEnergyAt()[model.getCurIteration()];
+			}
+		}
+		return temp;
+	}
+
+}

+ 120 - 0
src/ui/view/StatisticPane.java

@@ -0,0 +1,120 @@
+package ui.view;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import javax.swing.GroupLayout;
+import javax.swing.GroupLayout.Alignment;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JCheckBox;
+import javax.swing.LayoutStyle.ComponentPlacement;
+import java.awt.Color;
+import javax.swing.SwingConstants;
+import javax.swing.JComboBox;
+
+public class StatisticPane extends JPanel{
+	private JScrollPane listScrollPane = new JScrollPane();
+    private JList objectList;
+    private DefaultListModel model =  new DefaultListModel();
+    
+    public StatisticPane(){
+    	objectList = new JList(model);
+    	listScrollPane.setViewportView(objectList);
+    	
+    	JLabel lblOverallStatistics = new JLabel("Overall Statistics:");
+    	lblOverallStatistics.setFont(new Font("Tahoma", Font.PLAIN, 13));
+    	
+    	JCheckBox chckbxNewCheckBox = new JCheckBox("total consumption");
+    	chckbxNewCheckBox.setForeground(Color.RED);
+    	
+    	JCheckBox chckbxNewCheckBox_1 = new JCheckBox("total production");
+    	chckbxNewCheckBox_1.setForeground(Color.BLUE);
+    	
+    	JLabel lblObject = new JLabel("Object:");
+    	lblObject.setFont(new Font("Tahoma", Font.PLAIN, 13));
+    	
+    	JLabel lblName = new JLabel("Name:");
+    	
+    	JLabel lblNewLabel = new JLabel("...");
+    	lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
+    	
+    	JCheckBox checkBox = new JCheckBox("total consumption");
+    	checkBox.setForeground(Color.RED);
+    	
+    	JCheckBox checkBox_1 = new JCheckBox("total production");
+    	checkBox_1.setForeground(Color.BLUE);
+    	
+    	JLabel lblGraph = new JLabel("  Graph:");
+    	
+    	JComboBox comboBox = new JComboBox();
+    	GroupLayout groupLayout = new GroupLayout(this);
+    	groupLayout.setHorizontalGroup(
+    		groupLayout.createParallelGroup(Alignment.LEADING)
+    			.addGroup(groupLayout.createSequentialGroup()
+    				.addContainerGap()
+    				.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
+    					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
+    						.addGroup(groupLayout.createSequentialGroup()
+    							.addGap(10)
+    							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
+    								.addComponent(chckbxNewCheckBox_1)
+    								.addComponent(chckbxNewCheckBox)))
+    						.addComponent(lblObject, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)
+    						.addGroup(groupLayout.createSequentialGroup()
+    							.addGap(10)
+    							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
+    								.addGroup(groupLayout.createSequentialGroup()
+    									.addGap(4)
+    									.addComponent(lblName)
+    									.addPreferredGap(ComponentPlacement.RELATED)
+    									.addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 107, GroupLayout.PREFERRED_SIZE))
+    								.addComponent(checkBox_1, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE)
+    								.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
+    									.addGroup(groupLayout.createSequentialGroup()
+    										.addComponent(lblGraph, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
+    										.addPreferredGap(ComponentPlacement.RELATED)
+    										.addComponent(comboBox, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+    									.addComponent(checkBox, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)))))
+    					.addComponent(lblOverallStatistics, GroupLayout.PREFERRED_SIZE, 126, GroupLayout.PREFERRED_SIZE)
+    					.addComponent(listScrollPane, GroupLayout.PREFERRED_SIZE, 177, GroupLayout.PREFERRED_SIZE))
+    				.addContainerGap(263, Short.MAX_VALUE))
+    	);
+    	groupLayout.setVerticalGroup(
+    		groupLayout.createParallelGroup(Alignment.LEADING)
+    			.addGroup(groupLayout.createSequentialGroup()
+    				.addContainerGap()
+    				.addComponent(lblOverallStatistics)
+    				.addPreferredGap(ComponentPlacement.UNRELATED)
+    				.addComponent(chckbxNewCheckBox)
+    				.addPreferredGap(ComponentPlacement.UNRELATED)
+    				.addComponent(chckbxNewCheckBox_1)
+    				.addGap(18)
+    				.addComponent(lblObject)
+    				.addPreferredGap(ComponentPlacement.UNRELATED)
+    				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
+    					.addComponent(lblNewLabel)
+    					.addComponent(lblName))
+    				.addPreferredGap(ComponentPlacement.UNRELATED)
+    				.addComponent(checkBox)
+    				.addPreferredGap(ComponentPlacement.UNRELATED)
+    				.addComponent(checkBox_1)
+    				.addPreferredGap(ComponentPlacement.UNRELATED)
+    				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
+    					.addComponent(lblGraph)
+    					.addComponent(comboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+    				.addGap(57)
+    				.addComponent(listScrollPane, GroupLayout.PREFERRED_SIZE, 177, GroupLayout.PREFERRED_SIZE)
+    				.addContainerGap(23, Short.MAX_VALUE))
+    	);
+    	setLayout(groupLayout);
+    	
+    	for(int i = 0; i < 20; i++){
+    		model.addElement(i*2000000000);
+    	}
+
+    }
+}

+ 1 - 1
src/ui/view/UnitGraph.java

@@ -20,6 +20,7 @@ import java.awt.Point;
 import javax.swing.JPanel;
 
 import classes.HolonElement;
+import classes.HolonObject;
 import ui.controller.Control;
 import ui.model.Model;
 import classes.HolonSwitch;
@@ -747,5 +748,4 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 											// (py + z * ry));
 		}
 	} // end intersection line-line
-
 }