diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java index 62c3780..2516a92 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java @@ -181,6 +181,9 @@ // Set layout setDAGLayout(); + changeStage(STAGE_DEPENDENCY_MODELING); + changeStage(STAGE_PUSH_PULL_SELECTION); + // Update current file info curFilePath = file.getAbsolutePath(); curFileName = file.getName(); diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyModelingStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyModelingStage.java index df78af7..406c148 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyModelingStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyModelingStage.java @@ -1,5 +1,6 @@ package application.editor.stages; +import algorithms.Validation; import application.editor.Editor; import application.editor.FlowCellEditor; import application.editor.Stage; @@ -17,7 +18,6 @@ import models.dataConstraintModel.ChannelMember; import models.dataConstraintModel.ResourcePath; import models.dataFlowModel.*; -import models.dependencyModel.CheckMxCellLayer; import models.dependencyModel.DependencyGraph; import java.awt.event.MouseAdapter; @@ -85,7 +85,6 @@ clearDependencyGraphCells(graph); graph = constructGraph(graph, dependencyGraph); } - CheckMxCellLayer.printGraphLayers(graph); } } @@ -189,7 +188,6 @@ mxCell child = (mxCell) dependencyLayer.getChildAt(i); graph.getModel().remove(child); } - CheckMxCellLayer.printGraphLayers(graph); } finally { graph.getModel().endUpdate(); graph.refresh(); @@ -226,7 +224,7 @@ double h = geo.getHeight(); String label = (String) oldCell.getValue(); - String newStyle = "strokeColor=green;fillColor=#BBFFBB;shape=ellipse;perimeter=ellipsePerimeter;verticalAlign=top"; + String newStyle = "shape=ellipse;perimeter=ellipsePerimeter;verticalAlign=top"; // 新セルを作成して親に追加 mxCell newCell = (mxCell) graph.insertVertex( @@ -311,13 +309,13 @@ geoPort.setOffset(new mxPoint(-5, -5)); } - String portStyle = "strokeColor=green;fillColor=#BBFFBB;shape=ellipse;perimeter=ellipsePerimeter"; + String portStyle = "shape=ellipse;perimeter=ellipsePerimeter"; newCell = new mxCell(null, geoPort, portStyle); newCell.setVertex(true); graph.addCell(newCell, newParent); } else { // EventChannel - String newStyle = "strokeColor=green;fillColor=#BBFFBB;verticalAlign=top"; + String newStyle = "verticalAlign=top"; newCell = (mxCell) graph.insertVertex(newParent, null, label, x, y, w, h, newStyle); } } else { @@ -358,17 +356,17 @@ // output edge DataTransferChannel channel = ((ChannelNode) dataFlowEdge.getSource()).getChannel(); ResourcePath dstRes = ((ResourceNode) dataFlowEdge.getDestination()).getInSideResource(channel); - graph.insertEdge(dependencyLayerCell, null, new Editor.SrcDstAttribute(channel, dstRes), eventChNodeCells.get(channel), resNodeCells.get((ResourceNode) dataFlowEdge.getDestination()), "strokeColor=green;movable=false"); + graph.insertEdge(dependencyLayerCell, null, new Editor.SrcDstAttribute(channel, dstRes), eventChNodeCells.get(channel), resNodeCells.get((ResourceNode) dataFlowEdge.getDestination()), "strokeWidth=3;strokeColor=green;movable=false"); } else { // input edge DataTransferChannel channel = ((ChannelNode) dataFlowEdge.getDestination()).getChannel(); ResourcePath srcRes = ((ResourceNode) dataFlowEdge.getSource()).getOutSideResource(channel); Set> toRes = getResourceDependencyForChannel(channel, dependencyGraph.getDataFlowGraph()); for (Map.Entry RtoR : toRes) { - graph.insertEdge(dependencyLayerCell, null, null, resNodeCells.get(RtoR.getValue()), resNodeCells.get(RtoR.getKey()), "strokeColor=green;dashed=true;movable=false"); + graph.insertEdge(dependencyLayerCell, null, null, resNodeCells.get(RtoR.getValue()), resNodeCells.get(RtoR.getKey()), "strokeWidth=3;strokeColor=green;dashed=true;movable=false"); } - graph.insertEdge(dependencyLayerCell, null, new Editor.SrcDstAttribute(srcRes, channel), resNodeCells.get((ResourceNode) dataFlowEdge.getSource()), eventChNodeCells.get(channel), "strokeColor=green;movable=false"); + graph.insertEdge(dependencyLayerCell, null, new Editor.SrcDstAttribute(srcRes, channel), resNodeCells.get((ResourceNode) dataFlowEdge.getSource()), eventChNodeCells.get(channel), "strokeWidth=3;strokeColor=green;movable=false"); } } @@ -376,7 +374,7 @@ // reference edges DataTransferChannel channel = (DataTransferChannel) ch; for (ResourcePath refRes : channel.getReferenceResources()) { - graph.insertEdge(dependencyLayerCell, null, null, resNodeCells.get(dependencyGraph.getDataFlowGraph().getResourceNode(refRes)), eventChNodeCells.get(channel), "strokeColor=green;dashed=true;movable=false"); + graph.insertEdge(dependencyLayerCell, null, null, resNodeCells.get(dependencyGraph.getDataFlowGraph().getResourceNode(refRes)), eventChNodeCells.get(channel), "strokeWidth=3;strokeColor=green;dashed=true;movable=false"); } } } finally { @@ -410,6 +408,12 @@ return resourceDependency; } + public boolean isValid() { + if (model == null) { + return false; + } + return Validation.checkUpdateConflict(model); + } } diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java index eab8368..e869fbe 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java @@ -78,6 +78,9 @@ if (prevStage instanceof DataFlowModelingStage) { return ((DataFlowModelingStage) prevStage).isValid(); } + if (prevStage instanceof DependencyModelingStage) { + return ((DependencyModelingStage) prevStage).isValid(); + } return false; } diff --git a/AlgebraicDataflowArchitectureModel/src/application/views/FlowLayerWindow.java b/AlgebraicDataflowArchitectureModel/src/application/views/FlowLayerWindow.java index ae4c57f..7793d24 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/views/FlowLayerWindow.java +++ b/AlgebraicDataflowArchitectureModel/src/application/views/FlowLayerWindow.java @@ -92,6 +92,9 @@ pushFlowCheckBox.setSelected(false); pullFlowCheckBox.setSelected(false); dependencyCheckBox.setSelected(true); + newStage.setLayerEnabled(Stage.DATA_FLOW_LAYER, false); + newStage.setLayerEnabled(Stage.PUSH_FLOW_LAYER, false); + newStage.setLayerEnabled(Stage.PULL_FLOW_LAYER, false); newStage.setLayerEnabled(Stage.DEPENDENCY_LAYER, true); } else if (newStage instanceof PushPullSelectionStage) {