diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java index e2dc634..22c8ff0 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java @@ -175,9 +175,6 @@ // Force to change PushPullSelectionStage to construct mxGraph boolean stageChanged = changeStage(STAGE_PUSH_PULL_SELECTION); - if (stageChanged && curStage instanceof PushPullSelectionStage) { - ((PushPullSelectionStage) curStage).constructGraph(); // Construction of data-flow graph - } // Set layout setDAGLayout(); @@ -211,9 +208,6 @@ // Force to change PushPullSelectionStage to construct mxGraph boolean stageChanged = changeStage(STAGE_PUSH_PULL_SELECTION); - if (stageChanged && curStage instanceof PushPullSelectionStage) { - ((PushPullSelectionStage) curStage).constructGraph(); // Construction of data-flow graph - } // Restore the geometry parser.doParseGeometry(graph); diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java index 06b5b47..b1e32e7 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java @@ -81,8 +81,12 @@ private DataFlowGraph analyzeDataTransferModel(DataTransferModel model) { DataFlowGraph flowGraph = DataTransferModelAnalyzer.createDataFlowGraphWithStateStoringAttribute(model); - DataFlowGraph dataFlowGraph = DataTransferModelAnalyzer.annotateWithSelectableDataTransferAttiribute(flowGraph); - updateEdgeAttributes(dataFlowGraph); + dataFlowGraph = DataTransferModelAnalyzer.annotateWithSelectableDataTransferAttiribute(flowGraph); + mxCell parent = (mxCell) graph.getDefaultParent(); + if (parent.getChildCount() == 0) { + constructGraph(); // Construct data-flow graph (on file open action) + } + updateEdgeAttributes(dataFlowGraph); // Update push/pull selection pull-downs return dataFlowGraph; }