From bd2f4287505d9668dc7f1f634ef13bc1b892f6f2 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 23 Jul 2021 22:53:41 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-55228=20ctrl/shift=E5=A4=9A=E9=80=89?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E5=87=BA=E7=8E=B0=E5=B7=A5=E5=85=B7=E6=A0=8F?= =?UTF-8?q?=20+=20=E8=80=81=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/PluginWebBridge.java | 2 ++ .../main/java/com/fr/design/mainframe/ComponentTree.java | 6 ++++++ .../java/com/fr/design/mainframe/EditingMouseListener.java | 2 +- .../java/com/fr/design/mainframe/FormCreatorDropTarget.java | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java index 93f8021d8..f45568641 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java @@ -399,6 +399,8 @@ public class PluginWebBridge { if (uiDialog != null) { uiDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); uiDialog.setVisible(false); + } + if (uiDialog == DesignerPluginContext.getPluginDialog()) { DesignerPluginContext.setPluginDialog(null); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java index 0c838b61e..f9a944091 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java @@ -408,6 +408,9 @@ public class ComponentTree extends JTree { @Override public void mouseReleased(MouseEvent e) { + if (e.isControlDown() || e.isShiftDown()) { + return; + } if (e.getButton() == MouseEvent.BUTTON1 && selectedCreator != null) { showSelectedPopup(selectedCreator); } @@ -426,6 +429,9 @@ public class ComponentTree extends JTree { * @param consumer */ private void onMouseEvent(final MouseEvent e, Consumer consumer) { + if (e.isControlDown() || e.isShiftDown()) { + return; + } Point p = e.getPoint(); // 解析组件树路径 获取选中的组件 int selRow = tree.getRowForLocation(p.x, p.y); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index c1d834fa9..4e44e134e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -647,7 +647,7 @@ public class EditingMouseListener extends MouseInputAdapter { @Override public void run() { for (XCreator xCreator : xCreators) { - xCreator.setSelected(!e.isShiftDown()); + xCreator.setSelected(!e.isShiftDown() && !e.isControlDown()); } } }); 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 d1aa9fc56..7a6a73f4b 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 @@ -145,6 +145,11 @@ public class FormCreatorDropTarget extends DropTarget { tabDragInner.tryDragIn(); } else { Toolkit.getDefaultToolkit().beep(); + // 拖入失败 取消选中 + XCreator creator = addingModel.getXCreator(); + if (creator != null) { + creator.setSelected(false); + } } // 取消提示 designer.setPainter(null);