From 367c8f23ea295d6fe653e221538be566662e4d42 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 17:17:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 39 ++++++------------- 1 file changed, 12 insertions(+), 27 deletions(-) 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 f275fa312..2d9df7126 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 @@ -177,6 +177,7 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { + if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( designer.getHorizontalScaleValue() + e.getX(), @@ -360,7 +361,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -402,7 +403,16 @@ public class EditingMouseListener extends MouseInputAdapter { } private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { + if (xElementCase != null) { + int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); + int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); + Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); + if (rect.contains(e.getPoint())) { + return; + } + xElementCase.displayCoverPane(false); + } if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } @@ -413,15 +423,6 @@ public class EditingMouseListener extends MouseInputAdapter { if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); } - //不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后 - if (xElementCase != null) { - int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); - int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); - Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); - if (!rect.contains(e.getPoint())) { - xElementCase.displayCoverPane(false); - } - } designer.repaint(); } @@ -459,7 +460,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -697,7 +698,6 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; - refreshTopXCreator(); return true; } return true; @@ -725,19 +725,4 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(boolean isEditing){ - designer.refreshTopXCreator(isEditing); - } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(){ - refreshTopXCreator(false); - } - }