diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java index 59a09c466..987cfface 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java @@ -72,22 +72,6 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { return false; } - protected JPanel createWidgetPane() { - return new JPanel() { - @Override - public void paint(Graphics g) { - super.paint(g); - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.65f); - g2d.setComposite(composite); - g2d.setColor(Color.DARK_GRAY); - g2d.fillRect(0, 0, getWidth(), getHeight()); - g2d.setComposite(oldComposite); - } - }; - } - protected JPanel createContentPane(JPanel widgetPane) { JPanel panel = new JPanel() { @Override @@ -114,7 +98,20 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { parentPane.resetWidgetDetailPane(packageId, getSharableWidgetProviders()); } } - }); + }) { + @Override + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + Composite oldComposite = g2d.getComposite(); + AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.65f); + g2d.setComposite(composite); + g2d.setColor(Color.DARK_GRAY); + g2d.fillRect(0, 0, getWidth(), getHeight()); + g2d.setComposite(oldComposite); + + super.paint(g); + } + }; panel.add(downloadProgressPane); panel.add(widgetPane, BorderLayout.CENTER); return panel; @@ -125,10 +122,16 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { final com.fr.design.extra.Process downloadProcess = aDouble -> { OnlineDownloadPackagePane.this.process = 0.8 * aDouble; downloadProgressPane.updateProgress(process); + if (downloadProgressPane != null) { + downloadProgressPane.repaint(); + } }; final com.fr.design.extra.Process installProcess = aDouble -> { OnlineDownloadPackagePane.this.process = 0.8 + 0.2 * aDouble; downloadProgressPane.updateProgress(process); + if (downloadProgressPane != null) { + downloadProgressPane.repaint(); + } }; downloadProcess.process(0.0D); @@ -220,6 +223,9 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { File file = new File(filePath); installProcess.process(0.0D); downloadProgressPane.changeState(); + if (downloadProgressPane != null) { + downloadProgressPane.repaint(); + } InstallUtils.InstallResult result = null; try { if (file.exists()) {