Browse Source

REPORT-66306 组件包下载面板无遮罩阴影

【问题原因】
swing中两个组件上下层叠时,重绘底层组件,会将其内容会知道上方,遮挡上层组件,
因此也需要手动重新绘制上层组件。

【改动思路】
主动调用下阴影层的重绘方法
bugfix/11.0
Starryi 3 years ago
parent
commit
a8572a9e0c
  1. 5
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java
  2. 8
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java
  3. 11
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java
  4. 15
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackagesShowPane.java

5
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java

@ -337,8 +337,7 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
null,
this
);
return;
}
} else {
//如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层
if (!isRightClickPopupMenuVisible() && (isMouseEnter || downloading)) {
Graphics2D g2d = (Graphics2D) g;
@ -372,6 +371,8 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
if (isUnusable) {
paintUnusableMask((Graphics2D) g);
}
}
if (this.parentPane != null) {
this.parentPane.refreshShowPaneUI();
}

8
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();
}
}
}

11
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<TabChangeListener> 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();
}
}

15
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<String, OnlineWidgetSelectPane> 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();
}
}
}

Loading…
Cancel
Save