Browse Source

Pull request #8531: REPORT-69575 设计器在线组件刷不出来

Merge in DESIGN/design from ~STARRYI/design:release/11.0 to release/11.0

* commit 'f807064850eb4bc1d7960d7e0edd2513a4674b93':
  REPORT-69575 设计器在线组件刷不出来
bugfix/11.0
starryi 3 years ago
parent
commit
8806367853
  1. 7
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java
  2. 9
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java

7
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java

@ -23,7 +23,6 @@ import javax.swing.JPopupMenu;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Image; import java.awt.Image;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.io.IOException;
import java.net.URL; import java.net.URL;
/** /**
@ -75,7 +74,8 @@ public abstract class AbstractOnlineWidgetBlock extends PreviewWidgetBlock<Onlin
public Image getPreviewImage() { public Image getPreviewImage() {
try { try {
return ImageIO.read(new URL(UriUtils.encodePath(widget.getPicPath(), EncodeConstants.ENCODING_UTF_8))); return ImageIO.read(new URL(UriUtils.encodePath(widget.getPicPath(), EncodeConstants.ENCODING_UTF_8)));
} catch (IOException e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(widget.getName());
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
return getDefaultDisplayImage(); return getDefaultDisplayImage();
} }
@ -88,7 +88,8 @@ public abstract class AbstractOnlineWidgetBlock extends PreviewWidgetBlock<Onlin
String previewURI = UriUtils.encodePath(widget.getPicPath(), EncodeConstants.ENCODING_UTF_8) + "?x-oss-process=image/resize,m_fixed," + "w_" + coverDimension.width + String previewURI = UriUtils.encodePath(widget.getPicPath(), EncodeConstants.ENCODING_UTF_8) + "?x-oss-process=image/resize,m_fixed," + "w_" + coverDimension.width +
",h_" + coverDimension.height; ",h_" + coverDimension.height;
image = ImageIO.read(new URL(previewURI)); image = ImageIO.read(new URL(previewURI));
} catch (IOException e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(widget.getName());
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
image = getDefaultDisplayImage(); image = getDefaultDisplayImage();
} }

9
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java

@ -43,6 +43,7 @@ public class OnlineWidgetTabPane extends JPanel {
private CardLayout cardLayout; private CardLayout cardLayout;
private JPanel centerPane; private JPanel centerPane;
private boolean packagePaneCreated = false; private boolean packagePaneCreated = false;
private boolean componentPaneCreated = false;
private final List<TabChangeListener> tabChangeListeners; private final List<TabChangeListener> tabChangeListeners;
private OnlineEmbedFilterShowPane embedFilterShowPane; private OnlineEmbedFilterShowPane embedFilterShowPane;
private OnlineWidgetPackagesShowPane widgetPackagesShowPane; private OnlineWidgetPackagesShowPane widgetPackagesShowPane;
@ -57,8 +58,6 @@ public class OnlineWidgetTabPane extends JPanel {
this.cardLayout = new CardLayout(); this.cardLayout = new CardLayout();
this.centerPane = new JPanel(cardLayout); this.centerPane = new JPanel(cardLayout);
this.centerPane.add(new OnlineWidgetShowPane(sharableWidgets), COMPONENT);
this.centerPane.add( embedFilterShowPane = new OnlineEmbedFilterShowPane(new OnlineWidgetShowPane(sharableWidgets, OnlineWidgetSortType.SALES)), COMPONENT_EMBED);
//延迟组件包面板的初始化,防止组件面板里组件的缩略图和组件包面板里组件的缩略图一起加载 //延迟组件包面板的初始化,防止组件面板里组件的缩略图和组件包面板里组件的缩略图一起加载
this.headGroup = new UITabGroup(new String[]{COMPONENT_PACKAGE, COMPONENT}) { this.headGroup = new UITabGroup(new String[]{COMPONENT_PACKAGE, COMPONENT}) {
public void tabChanged(int newSelectedIndex) { public void tabChanged(int newSelectedIndex) {
@ -66,6 +65,12 @@ public class OnlineWidgetTabPane extends JPanel {
changeListener.tabChange(newSelectedIndex); changeListener.tabChange(newSelectedIndex);
} }
if (newSelectedIndex == COMPONENT_TAB_INDEX) { if (newSelectedIndex == COMPONENT_TAB_INDEX) {
//延迟组件包面板的初始化,防止组件面板里组件和缩略图和组件包面板里组件的缩略图一起加载
if (!componentPaneCreated) {
centerPane.add(new OnlineWidgetShowPane(sharableWidgets), COMPONENT);
centerPane.add( embedFilterShowPane = new OnlineEmbedFilterShowPane(new OnlineWidgetShowPane(sharableWidgets, OnlineWidgetSortType.SALES)), COMPONENT_EMBED);
componentPaneCreated = true;
}
cardLayout.show(centerPane, ComponentShareUtil.needShowEmbedFilterPane() ? COMPONENT_EMBED : COMPONENT); cardLayout.show(centerPane, ComponentShareUtil.needShowEmbedFilterPane() ? COMPONENT_EMBED : COMPONENT);
} else { } else {
ComponentShareUtil.completeEmbedFilter(); ComponentShareUtil.completeEmbedFilter();

Loading…
Cancel
Save