Explorar el Código

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

Teh-Hai Julian Zheng hace 7 años
padre
commit
39cf61cfb2

+ 2 - 0
src/ui/view/EditEdgesPopUp.java

@@ -183,6 +183,7 @@ public class EditEdgesPopUp extends JDialog {
 	 */
 	public void changeForNew(float cap) {
 		controller.setMaxCapacity(cap);
+		controller.resetSimulation();
 	}
 
 	/**
@@ -207,6 +208,7 @@ public class EditEdgesPopUp extends JDialog {
 				changeInUpperNode((CpsUpperNode) abs, cap);
 			}
 		}
+		controller.resetSimulation();
 		controller.calculateStateForCurrentTimeStep();
 		canvas.repaint();
 	}

+ 1 - 2
src/ui/view/StatisticPanel.java

@@ -629,7 +629,7 @@ public class StatisticPanel extends JSplitPane implements GraphListener {
 		
 		JPanel editPanel = new JPanel();
 		//editPanel.setBounds(0,0,600,600);
-		editPanel.setPreferredSize(new Dimension(170, 210));
+		editPanel.setPreferredSize(new Dimension(170, 240));
 		//scrollPane.setBounds(0,0,600,600);
 		scrollPane.setViewportView(editPanel);
 		editPanel.setLayout(null);
@@ -698,7 +698,6 @@ public class StatisticPanel extends JSplitPane implements GraphListener {
 
 		btnAdd.setBounds(10, 213, 59, 23);
 		editPanel.add(btnAdd);
-		splitPane.setDividerLocation(0.5);
 		
 		//============================= WINDOWBUILDER COMPONENTS END =================//
 		

+ 3 - 4
src/ui/view/UnitGraph.java

@@ -486,8 +486,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 			}
 
 			// Delete a Point
-			if (deletePoint && tempP.getX() != 0
-					&& (tempP.getX() != this.getWidth() / scaleX || tempP != pointList.getLast())) {
+			if (deletePoint && tempP != pointList.getFirst() && tempP != pointList.getLast()) {
 				int i = pointList.indexOf(tempP);
 				// If Right, else if Left
 				if (tempP.getY() == (int) (height / 6) && i < pointList.size() - 1 && i > 0) {
@@ -579,7 +578,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 		pointList.removeAll(pointList);
 		if (isSwitch) {
 			pointList.addFirst(new Point(-border, (int) (height / 6)));
-			pointList.addLast(new Point((int) (width) + 4, (int) (height / 6)));
+			pointList.addLast(new Point((int) ((this.getWidth()) / scaleX), (int) (height / 6)));
 		} else {
 			pointList.addFirst(new Point(0, 0));
 			pointList.addLast(new Point((int) ((this.getWidth() - (border * 2)) / scaleX), 0));
@@ -644,7 +643,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 		// First time clicked on the Element
 		if (pointList.isEmpty()) {
 			pointList.addFirst(new Point(-border, (int) (height / 6)));
-			pointList.addLast(new Point((int) ((this.getWidth() - border) / scaleX), (int) (height / 6)));
+			pointList.addLast(new Point((int) ((this.getWidth()) / scaleX), (int) (height / 6)));
 		}
 		repaint();
 	}