From 78aab5a8781ff246e38bbdb9f3e6d7c4b31fc10f Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 12 Nov 2021 14:33:20 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-62400=20&&=20REPORT-62399=20&&=20REPORT-?= =?UTF-8?q?62547=E3=80=90=E6=8E=A5=E8=A7=A6=E7=82=B9=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E6=8B=96=E6=8B=BD=E5=8A=A8=E6=95=88=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=A2=84=E8=A7=88=E5=9B=BE=E4=B8=8D=E6=B6=88?= =?UTF-8?q?=E5=A4=B1=EF=BC=9B=E3=80=90=E6=8E=A5=E8=A7=A6=E7=82=B9=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E8=BD=AE=E6=92=AD=E7=9A=84=E5=90=8C=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E9=BC=A0=E6=A0=87=E6=82=AC=E6=B5=AE=E5=9C=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=EF=BC=8C=E8=BD=AE=E6=92=AD=E5=9B=BE=E4=B8=8D?= =?UTF-8?q?=E6=B6=88=E5=A4=B1=EF=BC=8C=E4=B8=8E=E7=BB=84=E4=BB=B6=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=9B=BE=E5=90=8C=E6=97=B6=E5=87=BA=E7=8E=B0=EF=BC=9B?= =?UTF-8?q?=E3=80=90=E6=8E=A5=E8=A7=A6=E7=82=B9=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E8=BD=AE=E6=92=AD=E7=9A=84=E5=9B=BE=E7=89=87=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=EF=BC=8C=E5=AF=BC=E8=87=B4=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=9B=BE=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../embed/OnlineEmbedFilterSelectPane.java | 4 +++- .../share/ui/online/embed/PreviewDialog.java | 18 ++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java index b7f62e564..0d3a757f3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java @@ -95,7 +95,7 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane this.doLayout(); this.validate(); this.repaint(); - previewDialog.setImage(getPreviewImage(shareWidget)); + previewDialog.setImage(getPreviewImage(shareWidget), widgetPane.getLocationOnScreen()); //展示弹出框 service.schedule(new Runnable() { @Override @@ -114,6 +114,7 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane if (!CarouselStateManger.getInstance().isSuspend()) { showCurrentLoadBlock(integer, widgetPane); } else { + previewDialog.setVisible(false); pollingCarouselState(integer, widgetPane); } } @@ -130,6 +131,7 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane return; } if (!CarouselStateManger.getInstance().isSuspend()) { + previewDialog.setVisible(true); showCurrentLoadBlock(integer, widgetPane); service.shutdown(); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/PreviewDialog.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/PreviewDialog.java index 086f4d2bd..3ef29c8cb 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/PreviewDialog.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/PreviewDialog.java @@ -6,35 +6,33 @@ import com.fr.design.mainframe.EastRegionContainerPane; import javax.swing.ImageIcon; import javax.swing.JDialog; +import java.awt.Dimension; import java.awt.Image; +import java.awt.Point; /** * Created by kerry on 2021/10/22 */ public class PreviewDialog extends JDialog { + private static final int OFFSET_Y = 9; public PreviewDialog() { super(DesignerContext.getDesignerFrame()); setUndecorated(true); - setSize(300, 300); - adjustLocation(); this.setVisible(false); } - public void setImage(Image image) { + public void setImage(Image image, Point point) { this.getContentPane().removeAll(); this.getContentPane().add(new UILabel(new ImageIcon(image))); + int width = image.getWidth(null); + this.setSize(width, image.getHeight(null)); + this.setLocation(point.x - width, point.y + OFFSET_Y); this.doLayout(); + this.validate(); this.repaint(); } - public void adjustLocation() { - - this.setLocation( - EastRegionContainerPane.getInstance().getX() - 300, - 20 - ); - } }