diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java index 3eacc52261..61c913201b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java @@ -337,41 +337,42 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { null, this ); - return; - } - //如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层 - if (!isRightClickPopupMenuVisible() && (isMouseEnter || downloading)) { - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - //画白色的编辑层 - g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 20 / 100.0F)); - g2d.setColor(COVER_COLOR); - g2d.fillRect(x, y, w, h); - g2d.setComposite(oldComposite); - //画编辑按钮图标 - BufferedImage image = (process > 0 || downloading) ? WIDGET_DOWNLOADING_ICON : WIDGET_DOWNLOAD_ICON; - g2d.drawImage( - image, - (x + w / 2 - 12), - (y + h / 2 - 16), - image.getWidth(), - image.getHeight(), - null, - this - ); - Stroke oldStroke = g2d.getStroke(); - g2d.setStroke(XCreatorConstants.STROKE); - g2d.setColor(Color.decode("#419BF9")); - double arcAngle = downloading ? (36 + 360 * 0.9 * process) : 0.0; - g2d.drawArc(x + w / 2 - 12, y + h / 2 - 16, 24, 24, 90, -(int) arcAngle); - g2d.setColor(Color.WHITE); - g2d.setStroke(oldStroke); - } + } else { + //如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层 + if (!isRightClickPopupMenuVisible() && (isMouseEnter || downloading)) { + Graphics2D g2d = (Graphics2D) g; + Composite oldComposite = g2d.getComposite(); + //画白色的编辑层 + g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 20 / 100.0F)); + g2d.setColor(COVER_COLOR); + g2d.fillRect(x, y, w, h); + g2d.setComposite(oldComposite); + //画编辑按钮图标 + BufferedImage image = (process > 0 || downloading) ? WIDGET_DOWNLOADING_ICON : WIDGET_DOWNLOAD_ICON; + g2d.drawImage( + image, + (x + w / 2 - 12), + (y + h / 2 - 16), + image.getWidth(), + image.getHeight(), + null, + this + ); + Stroke oldStroke = g2d.getStroke(); + g2d.setStroke(XCreatorConstants.STROKE); + g2d.setColor(Color.decode("#419BF9")); + double arcAngle = downloading ? (36 + 360 * 0.9 * process) : 0.0; + g2d.drawArc(x + w / 2 - 12, y + h / 2 - 16, 24, 24, 90, -(int) arcAngle); + g2d.setColor(Color.WHITE); + g2d.setStroke(oldStroke); + } - boolean isUnusable = !getWidget().isCompatibleWithCurrentEnv(); - if (isUnusable) { - paintUnusableMask((Graphics2D) g); + boolean isUnusable = !getWidget().isCompatibleWithCurrentEnv(); + if (isUnusable) { + paintUnusableMask((Graphics2D) g); + } } + if (this.parentPane != null) { this.parentPane.refreshShowPaneUI(); } 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 987cffaceb..1d4990c7d7 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 @@ -256,4 +256,12 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { } } } + + @Override + public void refreshShowPaneUI() { + if (downloadProgressPane != null && downloadProgressPane.isShowing()) { + downloadProgressPane.invalidate(); + downloadProgressPane.repaint(); + } + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java index cfa5d799f1..ca0e8aa6a8 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java @@ -16,6 +16,7 @@ import com.fr.form.share.bean.OnlineShareWidget; import javax.swing.BorderFactory; import javax.swing.JButton; +import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.plaf.basic.BasicButtonUI; import java.awt.BorderLayout; @@ -44,6 +45,7 @@ public class OnlineWidgetTabPane extends JPanel { private boolean packagePaneCreated = false; private final List tabChangeListeners; private OnlineEmbedFilterShowPane embedFilterShowPane; + private OnlineWidgetPackagesShowPane widgetPackagesShowPane; public OnlineWidgetTabPane(OnlineShareWidget[] sharableWidgets, OnlineShareWidget[] sharableWidgetPackage) { tabChangeListeners = new ArrayList<>(); @@ -70,7 +72,8 @@ public class OnlineWidgetTabPane extends JPanel { ComponentCollector.getInstance().collectCmpPktClick(); //延迟组件包面板的初始化,防止组件面板里组件和缩略图和组件包面板里组件的缩略图一起加载 if (!packagePaneCreated) { - centerPane.add(new OnlineWidgetPackagesShowPane(sharableWidgetPackages), COMPONENT_PACKAGE); + widgetPackagesShowPane = new OnlineWidgetPackagesShowPane(sharableWidgetPackages); + centerPane.add(widgetPackagesShowPane, COMPONENT_PACKAGE); packagePaneCreated = true; } cardLayout.show(centerPane, COMPONENT_PACKAGE); @@ -89,6 +92,8 @@ public class OnlineWidgetTabPane extends JPanel { this.add(centerPane, BorderLayout.CENTER); } + + private JPanel createMiniShopEntryPane() { JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane(); container.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); @@ -136,6 +141,10 @@ public class OnlineWidgetTabPane extends JPanel { if (embedFilterShowPane != null) { this.embedFilterShowPane.refreshUI(); } + + if (headGroup.getSelectedIndex() == COMPONENT_PACKAGE_TAB_INDEX && widgetPackagesShowPane != null) { + widgetPackagesShowPane.refreshShowPaneUI(); + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackagesShowPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackagesShowPane.java index 1697593627..d133cd0583 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackagesShowPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackagesShowPane.java @@ -48,6 +48,7 @@ public class OnlineWidgetPackagesShowPane extends AbstractOnlineWidgetShowPane { private JPanel detailPane; private String currentPackageId; private OnlineWidgetSelectPane onlineWidgetSelectPane; + private OnlineDownloadPackagePane onlineDownloadPackagePane; private UILabel downloadLabel; private final Map cachePanelMap = new HashMap<>(); @@ -109,15 +110,15 @@ public class OnlineWidgetPackagesShowPane extends AbstractOnlineWidgetShowPane { private void downLoadPackage() { downloadLabel.setVisible(false); detailPane.removeAll(); - OnlineDownloadPackagePane widgetSelectPane = new OnlineDownloadPackagePane(this, onlineWidgetSelectPane.getSharableWidgetProviders(), 50); - detailPane.add(widgetSelectPane, BorderLayout.CENTER); + onlineDownloadPackagePane = new OnlineDownloadPackagePane(this, onlineWidgetSelectPane.getSharableWidgetProviders(), 50); + detailPane.add(onlineDownloadPackagePane, BorderLayout.CENTER); cardLayout.show(centerPane, WIDGET_DETAIL); - cachePanelMap.put(currentPackageId, widgetSelectPane); + cachePanelMap.put(currentPackageId, onlineDownloadPackagePane); for (OnlineShareWidget onlineShareWidget : getSharableWidgetProviders()) { if (StringUtils.equals(onlineShareWidget.getId(), currentPackageId)) { - widgetSelectPane.downloadWidget(onlineShareWidget); + onlineDownloadPackagePane.downloadWidget(onlineShareWidget); break; } } @@ -193,4 +194,10 @@ public class OnlineWidgetPackagesShowPane extends AbstractOnlineWidgetShowPane { protected FilterPane createFilterPane() { return FilterPane.createOnlinePackageFilterPane(); } + + public void refreshShowPaneUI() { + if (onlineDownloadPackagePane != null && onlineDownloadPackagePane.isShowing()) { + onlineDownloadPackagePane.refreshShowPaneUI(); + } + } }