diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/DraggingModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/DraggingModel.java index 6308ff70b5..95e003faf3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/DraggingModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/DraggingModel.java @@ -14,7 +14,6 @@ public class DraggingModel { private MouseEvent currentDragEvent; private int creatorLeftTopX = -999; // 隐藏 private int creatorLeftTopY = -999; // 隐藏 - private boolean dragNewWidget; // 是否正在拖拽一个新的组件下来 public DraggingModel() { @@ -40,11 +39,6 @@ public class DraggingModel { return this; } - public DraggingModel dragNewWidget(boolean dragNewWidget) { - this.dragNewWidget = dragNewWidget; - return this; - } - public FormDesigner getDesigner() { return designer; } @@ -79,10 +73,6 @@ public class DraggingModel { return creatorLeftTopY; } - public boolean isDragNewWidget() { - return dragNewWidget; - } - public void moveTo(int x, int y) { XLayoutContainer container = designer.getDraggingHotspotLayout(); LayoutAdapter adapter = container.getLayoutAdapter(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index aa58d713e5..62e256379c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -264,11 +264,7 @@ public class FormCreatorDropTarget extends DropTarget { Point loc = dtde.getLocation(); int x = designer.getRelativeX(loc.x); int y = designer.getRelativeY(loc.y); - if (model.isDragNewWidget()) { - designer.addNewWidget(creator, x, y); - } else { - designer.changeWidgetPlace(creator, x, y); - } + designer.addWidgetToForm(creator, x, y); // 放到事件末尾执行 SwingUtilities.invokeLater(new Runnable() { @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index a703512aba..0e28ef3b69 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1252,12 +1252,12 @@ public class FormDesigner extends TargetComponent