diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyModelingStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyModelingStage.java index 4f63dbb..d8d8352 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyModelingStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyModelingStage.java @@ -102,6 +102,10 @@ return true; } + //-------------------------------------------------- + // dependencyModeling + //-------------------------------------------------- + private void clearDependencyGraphCells(mxGraph graph) { mxCell root = (mxCell) graph.getDefaultParent(); mxCell dependencyLayer = (mxCell) root.getChildAt(DEPENDENCY_LAYER); @@ -167,26 +171,21 @@ String label = (String) oldCell.getValue(); String newStyle = "shape=ellipse;perimeter=ellipsePerimeter;verticalAlign=top"; - // 新セルを作成して親に追加 - mxCell newCell = (mxCell) graph.insertVertex( - newParent, - null, - label, - x, y, w, h, - newStyle - ); + mxCell newCell = (mxCell) graph.insertVertex(newParent,null, label, x, y, w, h, newStyle); - // ResourceNode対応づけ(valueまたは他のMap経由で取得) ResourceNode node = findResourceNodeByCell(oldCell); if (node != null) { resNodeCells.put(node, newCell); } - // 子セルも再帰的にコピー + // Recursively copy child cells int childCount = oldCell.getChildCount(); for (int i = 0; i < childCount; i++) { mxCell oldChild = (mxCell) oldCell.getChildAt(i); - cloneResourceCellHierarchy(oldChild, newCell, resNodeCells); + mxCell newChild = cloneResourceCellHierarchy(oldChild, newCell, resNodeCells); + + //拡張DTRAMに対する依存関係の追加を行う用 + //insertTopAnchorEdge(newParent, newCell, newChild); } return newCell; @@ -205,12 +204,27 @@ return null; } + private void insertTopAnchorEdge(mxCell parentLayer, mxCell outerCell, mxCell innerCell) { + mxGeometry gOuter = outerCell.getGeometry(); + mxGeometry gInner = innerCell.getGeometry(); + if (gOuter == null || gInner == null) return; + + mxGeometry geoSrc = new mxGeometry(0.5, 0.0, 0, 0); + geoSrc.setRelative(true); + + mxGeometry geoDst = new mxGeometry(0.5, 0.0, 0, 0); + geoDst.setRelative(true); + + graph.insertEdge(parentLayer, null, null, outerCell, innerCell, dependencyEdgeStyle); + } + private Map createEventChannelCells() { Map eventChannelCells = new HashMap<>(); mxCell root = (mxCell) graph.getDefaultParent(); mxCell dependencyLayer = (mxCell) root.getChildAt(DEPENDENCY_LAYER); - // Recursively copy the EventChannel hierarchy + + // Recursively copy the EventChannel hierarchy for (ChannelNode channelNode : dependencyGraph.getDataFlowGraph().getRootChannelNodes()) { DataTransferChannel channel = channelNode.getChannel(); if (channel.getInputResources().isEmpty()) { @@ -227,7 +241,6 @@ private mxCell cloneEventChannelHierarchy(mxCell oldCell, mxCell newParent, Map eventChannelCells, DataTransferChannel rootChannel) { - mxGeometry geo = (mxGeometry) oldCell.getGeometry(); if (geo != null) geo = (mxGeometry) geo.clone(); @@ -288,7 +301,6 @@ mxCell root = (mxCell) graph.getDefaultParent(); mxCell layerCell = (mxCell) root.getChildAt(DEPENDENCY_LAYER); - // DependencyGraphのエッジを使用(依存関係の視覚化) for (CallEdge callEdge : dependencyGraph.getDependencyEdges()) { Node srcNode = callEdge.getSource(); Node dstNode = callEdge.getDestination();