|
@@ -15,7 +15,9 @@ 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;
|
|
|
|
|
@@ -193,6 +195,7 @@ public class EditEdgesPopUp extends JDialog {
|
|
|
* the Capacity
|
|
|
*/
|
|
|
public void changeForExisting(float cap) {
|
|
|
+ /*
|
|
|
for(SubNet sn: controller.getSimManager().getSubNets()){
|
|
|
for(CpsEdge edge: sn.getEdges()){
|
|
|
edge.setCapacity(cap);
|
|
@@ -201,13 +204,32 @@ public class EditEdgesPopUp extends JDialog {
|
|
|
for(CpsEdge edge: controller.getSimManager().getBrokenEdges()){
|
|
|
edge.setCapacity(cap);
|
|
|
}
|
|
|
- /*
|
|
|
+ */
|
|
|
for (CpsEdge edge : controller.getModel().getEdgesOnCanvas()) {
|
|
|
edge.setCapacity(cap);
|
|
|
- }*/
|
|
|
+ }
|
|
|
+ for(AbstractCpsObject abs: controller.getModel().getObjectsOnCanvas()){
|
|
|
+ if(abs instanceof CpsUpperNode){
|
|
|
+ changeInUpperNode((CpsUpperNode)abs, cap);
|
|
|
+ }
|
|
|
+ }
|
|
|
controller.calculateStateForCurrentTimeStep();
|
|
|
canvas.repaint();
|
|
|
}
|
|
|
+
|
|
|
+ public void changeInUpperNode(CpsUpperNode uN, float cap){
|
|
|
+ for(CpsEdge e: uN.getNodeEdges()){
|
|
|
+ e.setCapacity(cap);
|
|
|
+ }
|
|
|
+ for(CpsEdge e: uN.getOldEdges()){
|
|
|
+ e.setCapacity(cap);
|
|
|
+ }
|
|
|
+ for(AbstractCpsObject abs: uN.getNodes()){
|
|
|
+ if(abs instanceof CpsUpperNode){
|
|
|
+ changeInUpperNode((CpsUpperNode)abs, cap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Set the Capacity for all existing and new edges.
|