diff --git a/AlgebraicDataflowArchitectureModel/src/application/actions/InsertStatelessObjectAction.java b/AlgebraicDataflowArchitectureModel/src/application/actions/InsertStatelessObjectAction.java index 4f616c0..80c0fb5 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/actions/InsertStatelessObjectAction.java +++ b/AlgebraicDataflowArchitectureModel/src/application/actions/InsertStatelessObjectAction.java @@ -63,7 +63,7 @@ return; } - stage.insertObjectNodeCellInControlFlowLayer(graphComponent.getGraph(), edgeCell, objName); + stage.insertObjectNodeCellInControlFlowLayer(edgeCell, objName); } /************************************************************* diff --git a/AlgebraicDataflowArchitectureModel/src/application/actions/ShowDependentableMediatorAction.java b/AlgebraicDataflowArchitectureModel/src/application/actions/ShowDependentableMediatorAction.java index 82ed4b5..630d7fe 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/actions/ShowDependentableMediatorAction.java +++ b/AlgebraicDataflowArchitectureModel/src/application/actions/ShowDependentableMediatorAction.java @@ -44,6 +44,6 @@ if(callEdgeAttr == null) return; ControlFlowDelegationStage cfdStage = (ControlFlowDelegationStage)stage; - cfdStage.showDependentableNodes(this.graphComponent.getGraph(), callEdgeAttr);; + cfdStage.showDependentableNodes(callEdgeAttr); } } diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationCellEditor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationCellEditor.java index f3caaaf..73bd178 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationCellEditor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationCellEditor.java @@ -157,7 +157,7 @@ return; ControlFlowDelegationStage cfdStage = (ControlFlowDelegationStage) stage; - cfdStage.showDelegatableNodes(graphComponent.getGraph(), callEdgeAttr); + cfdStage.showDelegatableNodes(callEdgeAttr); } /************************************************************ @@ -167,7 +167,7 @@ if(targetMediatorCell == null) return; ControlFlowDelegationStage cfdStage = (ControlFlowDelegationStage) stage; - cfdStage.dependsOnMediatorObject(graphComponent.getGraph(), targetEdgeCell, targetMediatorCell); + cfdStage.dependsOnMediatorObject(targetEdgeCell, targetMediatorCell); } /************************************************************ diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationStage.java index 802dac5..d9fbfee 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationStage.java @@ -199,7 +199,7 @@ /************************************************************* * control-flow-delegation */ - public void showDelegatableNodes(mxGraph graph, final CallEdgeAttribute callEdgeAttr){ + public void showDelegatableNodes(final CallEdgeAttribute callEdgeAttr){ mxCell root = (mxCell)graph.getDefaultParent(); graph.getModel().beginUpdate(); try { @@ -239,7 +239,7 @@ /************************************************************* * dependent-on-mediator */ - public void showDependentableNodes(mxGraph graph, final CallEdgeAttribute callEdgeAttr) { + public void showDependentableNodes(final CallEdgeAttribute callEdgeAttr) { mxCell root = (mxCell)graph.getDefaultParent(); mxCell layerCell = (mxCell)root.getChildAt(PULL_FLOW_LAYER); graph.getModel().beginUpdate(); @@ -320,7 +320,7 @@ /************************************************************* * */ - public void dependsOnMediatorObject(mxGraph graph, mxCell targetEdgeCell ,mxCell targetMediatorObjNodeCell) { + public void dependsOnMediatorObject(mxCell targetEdgeCell, mxCell targetMediatorObjNodeCell) { CallEdgeAttribute targetCallEdgeAttr = (CallEdgeAttribute)targetEdgeCell.getValue(); if(targetCallEdgeAttr == null) return; @@ -444,7 +444,7 @@ /************************************************************* * Inserting an intermediation object type of . */ - public void insertObjectNodeCellInControlFlowLayer(mxGraph graph, mxCell targetEdge, final String insertObjName) { + public void insertObjectNodeCellInControlFlowLayer(mxCell targetEdge, final String insertObjName) { CallEdgeAttribute callEdgeAttr = (CallEdgeAttribute)targetEdge.getValue(); if(callEdgeAttr == null) throw new NullPointerException(); @@ -574,15 +574,15 @@ graph.getModel().beginUpdate(); try { // Creating Control-Flow and separeted Push/Pull which types of - Map pushResNodeCells = createCellsOfResourceMap(graph, PUSH_FLOW_LAYER, controlFlowGraph); - Map pullResNodeCells = createCellsOfResourceMap(graph, PULL_FLOW_LAYER, controlFlowGraph); + Map pushResNodeCells = createCellsOfResourceMap(PUSH_FLOW_LAYER); + Map pullResNodeCells = createCellsOfResourceMap(PULL_FLOW_LAYER); // Creating Entry-Point Object - Map pushFlowEntryNodeCells = createCellsOfInputChannel(graph, PUSH_FLOW_LAYER, controlFlowGraph, pushResNodeCells); + Map pushFlowEntryNodeCells = createCellsOfInputChannel(PUSH_FLOW_LAYER); // Inserting edges of each transfer - graph = insertControlFlowEdges(graph, PUSH_FLOW_LAYER, controlFlowGraph.getPushCallGraph(), pushResNodeCells, pushFlowEntryNodeCells); - graph = insertControlFlowEdges(graph, PULL_FLOW_LAYER, controlFlowGraph.getPullCallGraph(), pullResNodeCells, null); + graph = insertControlFlowEdges(PUSH_FLOW_LAYER, pushResNodeCells, pushFlowEntryNodeCells); + graph = insertControlFlowEdges(PULL_FLOW_LAYER, pullResNodeCells, null); } finally { graph.getModel().endUpdate(); @@ -616,7 +616,7 @@ * Creating a map of to and Creating 's vertices * @return constructed the view of the graph */ - private Map createCellsOfResourceMap(mxGraph graph, final int layerNumber, final ControlFlowGraph controlFlowGraph) { + private Map createCellsOfResourceMap(final int layerNumber) { Map resNodeCells = new HashMap<>(); mxCell root = (mxCell)graph.getDefaultParent(); @@ -671,7 +671,7 @@ /************************************************************* * Create an input channel object */ - private Map createCellsOfInputChannel(mxGraph graph, final int layerNumber, final ControlFlowGraph controlGraph, final Map resNodeCell){ + private Map createCellsOfInputChannel(final int layerNumber){ if(layerNumber == PULL_FLOW_LAYER) return null; mxCell root = (mxCell)graph.getDefaultParent(); @@ -730,10 +730,14 @@ /************************************************************* * */ - private mxGraph insertControlFlowEdges(mxGraph graph, final int layerNumber, final CallGraph callGraph ,final Map resNodeCells, final Map entryNodeCells) { + private mxGraph insertControlFlowEdges(final int layerNumber,final Map resNodeCells, final Map entryNodeCells) { mxCell root = (mxCell)graph.getDefaultParent(); mxCell layerCell = (mxCell)root.getChildAt(layerNumber); - + + CallGraph callGraph = (layerNumber == PUSH_FLOW_LAYER) + ? controlFlowGraph.getPushCallGraph() + : controlFlowGraph.getPullCallGraph(); + for (Edge callGraphEdge : callGraph.getEdges()) { if ( !(callGraphEdge instanceof CallEdge))continue; CallEdge callEdge = (CallEdge) callGraphEdge;