dominik.rieder 7 anni fa
parent
commit
d1ddc68c29

+ 7 - 0
src/ui/controller/SimulationManager.java

@@ -559,6 +559,13 @@ public class SimulationManager {
 		return subNets;
 	}
 	
+	/**
+	 * Get broken Edges
+	 */
+	public ArrayList<CpsEdge> getBrokenEdges(){
+		return brokenEdges;
+	}
+	
 	/**
 	 * checks wether a given object is connected to an object inside the upperNode.
 	 * if yes, the state for the edge is changed in "connected" or "not connected"

+ 11 - 1
src/ui/view/EditEdgesPopUp.java

@@ -16,6 +16,7 @@ import javax.swing.JButton;
 import javax.swing.border.EmptyBorder;
 
 import classes.CpsEdge;
+import classes.SubNet;
 import ui.controller.Control;
 
 import java.awt.event.ActionListener;
@@ -192,9 +193,18 @@ public class EditEdgesPopUp extends JDialog {
 	 *            the Capacity
 	 */
 	public void changeForExisting(float cap) {
-		for (CpsEdge edge : controller.getModel().getEdgesOnCanvas()) {
+		for(SubNet sn: controller.getSimManager().getSubNets()){
+			for(CpsEdge edge: sn.getEdges()){
+				edge.setCapacity(cap);
+			}
+		}
+		for(CpsEdge edge: controller.getSimManager().getBrokenEdges()){
 			edge.setCapacity(cap);
 		}
+		/*
+		for (CpsEdge edge : controller.getModel().getEdgesOnCanvas()) {
+			edge.setCapacity(cap);
+		}*/
 		controller.calculateStateForCurrentTimeStep();
 		canvas.repaint();
 	}