From 815f2a4cedae37d5d4c64c612fc7e34ea1f7d653 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 26 Jul 2021 17:14:12 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-55757=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-=E6=A0=87=E9=A2=98=E5=9B=BE=E6=A1=88?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9B=BE=EF=BC=8C=E6=82=AC=E6=B5=AE=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=E9=81=AE=E7=BD=A9=E5=92=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=9B=BE=E6=A0=87=EF=BC=8C=E9=BC=A0=E6=A0=87=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E4=BB=8E=E5=B7=A6=E8=BE=B9/=E4=B8=8A=E8=BE=B9?= =?UTF-8?q?=E6=BB=91=E5=87=BA=EF=BC=8C=E5=88=99=E5=88=A0=E9=99=A4=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=B6=88=E5=A4=B1=EF=BC=9B=E4=BD=86=E4=BB=8E=E5=8F=B3?= =?UTF-8?q?=E8=BE=B9/=E4=B8=8B=E8=BE=B9=E6=BB=91=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9B=BE=E6=A0=87=E8=BF=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 不需要在mouseExited里加多余的判断 【改动思路】 同上 --- .../design/gui/xpane/TitleInsetImagePane.java | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java index 2573f6adfa..870cab22d4 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java @@ -24,6 +24,7 @@ import com.fr.general.Background; import com.fr.general.IOUtils; import com.fr.general.ImageWithSuffix; import com.fr.general.act.TitlePacker; +import com.fr.report.core.cal.Rect; import com.fr.stable.Constants; import javax.swing.*; @@ -115,9 +116,13 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { @Override public void mouseExited(MouseEvent e) { super.mouseExited(e); - imagePreviewOverlayPane.setVisible(false); - imageDeleteButton.setVisible(false); - imageDeleteButton.setEnabled(false); + int x = e.getX(); + int y = e.getY(); + if (x <= 0 || getWidth() <= x || y <= 0 || y >= getHeight()) { + imagePreviewOverlayPane.setVisible(false); + imageDeleteButton.setVisible(false); + imageDeleteButton.setEnabled(false); + } } }); @@ -146,6 +151,7 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { IOUtils.readIcon("/com/fr/design/images/buttonicon/icon_delete_inset.png"), new Color(51, 51, 52, 178), 2); + imageDeleteButton.setEnabled(false); imageDeleteButton.setPreferredSize(new Dimension(DELETE_BUTTON_SIZE, DELETE_BUTTON_SIZE)); imagePreviewPane = new ImagePreviewPane(); @@ -207,20 +213,6 @@ public class TitleInsetImagePane extends JPanel implements UIObserver { }).dealWithImageFile(returnVal); } }); - this.imageDeleteButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - imagePreviewPane.setImageWithSuffix(null); - imageLocationPane.setSelectedIndex(DEFAULT_INSET_LOCATION_INDEX); - imagePaddingPane.setValue(DEFAULT_INSET_PADDING); - imagePreviewOverlayPane.setVisible(false); - imageDeleteButton.setVisible(false); - imageDeleteButton.setEnabled(false); - getComponent(1).setVisible(false); - - fireStateChanged(); - } - }); } public void populateBean(TitlePacker packer) {