diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java index 4f891eb..346f738 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java @@ -307,13 +307,9 @@ fileString.append("geometry {\n"); - mxCell root = (mxCell) graph.getDefaultParent(); - mxCell nodeLayer = (mxCell) root.getChildAt(Stage.NODE_LAYER); - mxCell dataFlowLayer = (mxCell) root.getChildAt(Stage.DATA_FLOW_LAYER); - - // Node layer - for (int i = 0; i < graph.getModel().getChildCount(nodeLayer); i++) { - Object cell = graph.getModel().getChildAt(nodeLayer, i); + Object root = graph.getDefaultParent(); + for (int i = 0; i < graph.getModel().getChildCount(root); i++) { + Object cell = graph.getModel().getChildAt(root, i); if (graph.getModel().isVertex(cell)) { mxGraphView view = graph.getView(); mxCellState state = view.getState(cell); @@ -342,29 +338,6 @@ } } } - - // Data-Flow layer - // From controlFlowModeling branch - for (int i = 0; i < graph.getModel().getChildCount(dataFlowLayer); i++) { - Object cell = graph.getModel().getChildAt(dataFlowLayer, i); - if (graph.getModel().isVertex(cell)) { - mxGraphView view = graph.getView(); - mxCellState state = view.getState(cell); - int x = (int) state.getX(); - int y = (int) state.getY(); - int w = (int) state.getWidth(); - int h = (int) state.getHeight(); - - for (Channel ch : model.getChannels()) { - if (ch instanceof FormulaChannel && state.getLabel().equals(ch.getChannelName())) { - fileString.append("\tnode fc ").append(state.getLabel()).append(":").append(x).append(",").append(y).append(",").append(w).append(",").append(h).append("\n"); - } else if (ch != null && state.getLabel().equals(ch.getChannelName())) { - fileString.append("\tnode c ").append(state.getLabel()).append(":").append(x).append(",").append(y).append(",").append(w).append(",").append(h).append("\n"); - } - } - } - } - fileString.append("}\n"); return fileString.toString(); } @@ -379,12 +352,11 @@ public void setDAGLayout() { mxCell root = (mxCell) graph.getDefaultParent(); - mxCell dataFlowLayer = (mxCell) root.getChildAt(Stage.DATA_FLOW_LAYER); graph.getModel().beginUpdate(); try { DAGLayout ctl = new DAGLayout(graph); - ctl.execute(dataFlowLayer); + ctl.execute(root); } finally { graph.getModel().endUpdate(); }