From 0a72458f03d62304f3d13c9ecf191ffcd98383b2 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 22 Oct 2021 09:36:13 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-61302=20=E3=80=90FR11=E3=80=91=E3=80=90?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91?= =?UTF-8?q?&=E3=80=90=E5=9B=BA=E5=AE=9A=E5=B8=83=E5=B1=80-=E5=8E=9F?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=8E=A8=E8=8D=904.1=E3=80=91=E5=86=B3?= =?UTF-8?q?=E7=AD=96=E6=8A=A5=E8=A1=A8-=E7=BB=84=E4=BB=B6=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E5=88=86=E7=A6=BB=E5=81=9A=E8=BF=87=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=A7=BB=E5=85=A5tab=E5=9D=97=EF=BC=8C?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=82=AC=E5=81=9C=E5=9C=A8tab=E4=B8=8A?= =?UTF-8?q?=E8=B6=85=E8=BF=871s=E5=B0=B1=E5=88=A4=E6=96=AD=E4=B8=BA?= =?UTF-8?q?=E7=A7=BB=E5=85=A5tab=E5=86=85=E9=83=A8=EF=BC=8C=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E5=92=8C10.0=E7=9A=84=E6=95=88=E6=9E=9C=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E6=A0=B7=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/FormCreatorDropTarget.java | 3 ++- .../com/fr/design/mainframe/TabDragInner.java | 17 ++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) 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 af4d2ae2de..82befa2731 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 @@ -96,11 +96,13 @@ public class FormCreatorDropTarget extends DropTarget { boolean formSubmit2Adapt = !addingModel.getXCreator().canEnterIntoAdaptPane() && container.acceptType(XWFitLayout.class); if (model != null && !chartEnter2Para && !formSubmit2Adapt) { + tabDragInner.tryDragIn(); success = model.add2Container(designer, container, x, y); } cancelPromptWidgetForbidEnter(); } if (success) { + tabDragInner.reset(); // 如果添加成功,则触发相应事件 XCreator xCreator = container.acceptType(XWParameterLayout.class) ? designer.getParaComponent() : designer.getRootComponent(); //SetSelection时要确保选中的是最顶层的布局 @@ -143,7 +145,6 @@ public class FormCreatorDropTarget extends DropTarget { designer.getSelectionModel().setSelectedCreators( FormSelectionUtils.rebuildSelection(xCreator, new Widget[]{widget})); designer.getEditListenerTable().fireCreatorModified(addingModel.getXCreator(), DesignerEvent.CREATOR_ADDED); - tabDragInner.tryDragIn(); } else { Toolkit.getDefaultToolkit().beep(); // 拖入失败 取消选中 diff --git a/designer-form/src/main/java/com/fr/design/mainframe/TabDragInner.java b/designer-form/src/main/java/com/fr/design/mainframe/TabDragInner.java index fb6608c43a..9b524f28e6 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/TabDragInner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/TabDragInner.java @@ -1,7 +1,5 @@ package com.fr.design.mainframe; -import com.fr.design.designer.beans.AdapterBus; -import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; @@ -64,16 +62,13 @@ public class TabDragInner { */ public void tryDragIn() { if (belowXLayoutContainer != null && belowXLayoutContainer.isDragInAble()) { - EditingMouseListener editingMouseListener = new EditingMouseListener(designer); - editingMouseListener.refreshTopXCreator(); belowXLayoutContainer.setEditable(true); - if (editingMouseListener.stopEditing() && belowXLayoutContainer != designer.getRootComponent()) { - ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, belowXLayoutContainer); - if (adapter != null) { - editingMouseListener.startEditing(belowXLayoutContainer, adapter.getDesignerEditor(), adapter); - belowXLayoutContainer.setDragInAble(false); - } - } + } + } + + public void reset() { + if (belowXLayoutContainer != null) { + belowXLayoutContainer.setDragInAble(false); } }