diff --git a/AlgebraicDataflowArchitectureModel/src/graphicalrefactor/layouts/DAGLayout.java b/AlgebraicDataflowArchitectureModel/src/graphicalrefactor/layouts/DAGLayout.java index 1417c37..0d434dc 100644 --- a/AlgebraicDataflowArchitectureModel/src/graphicalrefactor/layouts/DAGLayout.java +++ b/AlgebraicDataflowArchitectureModel/src/graphicalrefactor/layouts/DAGLayout.java @@ -6,6 +6,7 @@ import com.mxgraph.layout.mxGraphLayout; import com.mxgraph.model.mxCell; +import com.mxgraph.model.mxGeometry; import com.mxgraph.model.mxICell; import com.mxgraph.model.mxIGraphModel; import com.mxgraph.util.mxRectangle; @@ -24,8 +25,8 @@ public void execute(Object parent) { mxIGraphModel model = graph.getModel(); - model.beginUpdate(); + model.beginUpdate(); try { List> map = new ArrayList>(); List moved = new ArrayList<>(); @@ -59,8 +60,10 @@ for(int i = 0; i < map.size(); i++) { for(int j = 0; j < map.get(i).size(); j++) { if(checkmoved(moved, map.get(i).get(j))) { - map.get(i).get(j).getGeometry().setX(100+j*150); - map.get(i).get(j).getGeometry().setY(100+i*100); + mxGeometry geom = (mxGeometry) map.get(i).get(j).getGeometry().clone(); + geom.setX(100 + j*150); + geom.setY(100 + i*100); + model.setGeometry(map.get(i).get(j), geom); moved.add(map.get(i).get(j).getId()); } }