diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyCellEditor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyCellEditor.java index f190926..dd200c7 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyCellEditor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DependencyCellEditor.java @@ -24,11 +24,9 @@ // Do not edit if the cell is null or not a vertex if (cellObj == null || !(cellObj instanceof mxCell)) return; - mxCell cell = (mxCell) cellObj; if (!(eventObj instanceof MouseEvent)) return; - MouseEvent mouseEvent = (MouseEvent) eventObj; // Right-click @@ -85,7 +83,11 @@ }); popup.add(reverseItem); - popup.show(graphComponent, mouseEvent.getX(), mouseEvent.getY()); + popup.show( + graphComponent, + mouseEvent.getXOnScreen() - graphComponent.getLocationOnScreen().x, + mouseEvent.getYOnScreen() - graphComponent.getLocationOnScreen().y + ); } /** @@ -227,9 +229,25 @@ midY - ddmStage.DEPENDENCY_NODE_SIZE / 2, ddmStage.DEPENDENCY_NODE_SIZE, ddmStage.DEPENDENCY_NODE_SIZE, - "shape=interface;strokeColor=green;fillColor=#BBFFBB;perimeter=rectanglePerimeter;resizable=0;" + "shape=interface;strokeColor=green;fillColor=#BBFFBB;perimeter=interfacePerimeter;resizable=0;" ); + // Input Interface Name + String defaultName = "Interface"; + String newName = JOptionPane.showInputDialog( + graphComponent, + "Interface name:", + defaultName + ); + + if (newName != null && !newName.trim().isEmpty()) { + interfaceNode.setValue(newName.trim()); + } + + // Setting Interface Name + InterfaceNode modelNode = new InterfaceNode(interfaceNode.getValue().toString()); + ddmStage.setInterfaceNode(interfaceNode, modelNode); + // Get the original edge's style and value String edgeStyle = edgeCell.getStyle(); Object edgeValue = edgeCell.getValue();