diff --git a/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java index db9fbe43b1..d65f6af9a0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java @@ -343,9 +343,6 @@ public class ComponentCollector implements XMLable { } public void clickComponentSetting() { - if (!ComponentShareUtil.needShowEmbedFilterPane()) { - return; - } boolean changed = false; int firstShowReact = ComponentReuseNotificationInfo.getInstance().isWidgetLibHasRefreshed() ? 2 : -1; if (this.firstShowReact != firstShowReact) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java index 582f353eed..864e5cddaf 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java @@ -95,6 +95,10 @@ public abstract class AbstractOnlineWidgetBlock extends PreviewWidgetBlock extends JPanel implements MouseListe @Override public void mouseEntered(MouseEvent e) { hover = true; - if (ComponentShareUtil.needShowFirstDragAnimate() && !FormWidgetDetailPane.getInstance().hasTouched() && checkWidget()) { + if (ComponentShareUtil.needShowFirstDragAnimate() && supportFirstDragAnimate() && + !FormWidgetDetailPane.getInstance().hasTouched() && checkWidget()) { schedule(ANIMATE_START_TIME); awtEventListener = event -> { if (!this.isShowing()) { @@ -169,6 +170,10 @@ public abstract class PreviewWidgetBlock extends JPanel implements MouseListe } } + protected boolean supportFirstDragAnimate(){ + return true; + } + protected boolean checkWidget() { return true; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/SimpleWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/SimpleWidgetBlock.java index cf5e948de9..a76220fd58 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/SimpleWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/SimpleWidgetBlock.java @@ -14,4 +14,9 @@ public class SimpleWidgetBlock extends OnlineWidgetBlock { this.removeListener(); this.setFocusable(false); } + + protected boolean supportFirstDragAnimate(){ + return false; + } + } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java index fd050513ba..0d0cff5706 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java @@ -119,10 +119,12 @@ public class LocalWidgetRepoPane extends BasicPane { content.add(LabelUtils.createAutoWrapLabel(Toolkit.i18nText("Fine-Design_Share_Upgrade_Tip"), new Color(0x333334)), BorderLayout.CENTER); JPanel actionsPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0)); + actionsPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, -5)); actionsPane.setOpaque(false); actionsPane.setBackground(null); UIButton cancelUpgradeButton = new UIButton(Toolkit.i18nText("Fine-Design_Share_Upgrade_Cancel")); + cancelUpgradeButton.setRoundBorder(true); cancelUpgradeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -132,6 +134,8 @@ public class LocalWidgetRepoPane extends BasicPane { UIButton startUpgradeButton = new UIButton(Toolkit.i18nText("Fine-Design_Share_Upgrade_All")); startUpgradeButton.setSelected(true); + startUpgradeButton.setRoundBorder(true); + startUpgradeButton.setBorderPainted(false); startUpgradeButton.setForeground(Color.WHITE); startUpgradeButton.addActionListener(new ActionListener() { @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java index 53239700d0..187bcca322 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java @@ -170,7 +170,7 @@ public abstract class AbstractOnlineWidgetSelectPane extends AbstractWidgetSele if (!OnlineShopUtils.testConnection()) { return OnlineWidgetSelectPane.PaneStatue.DISCONNECTED; } - OnlineResourceManager.getInstance().cancelLoad(); + OnlineResourceManager.getInstance().cancelLoad(this); contentPane.removeAll(); scrollPane = createScrollPane(); 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 3f4cea2a08..be433aa566 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 @@ -40,6 +40,7 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane private static final String CAROUSEL_PREVIEW = "carousel_preview"; private static final int CAROUSE_IMAGE_LOAD_TIMEOUT = 2000; private OnlineShareWidget[] showWidgets; + private static final int NOT_CAROUSE_WIDGET_NUM = 30; private PreviewDialog previewDialog; private JPanel widgetPane; @@ -144,7 +145,7 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane stopCarouse(integer); return; } - if (integer.get() == 0) { + if (integer.get() == NOT_CAROUSE_WIDGET_NUM) { CarouselStateManger.getInstance().stop(); stopCarouse(integer); previewDialog.setVisible(false); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/OnlineResourceManager.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/OnlineResourceManager.java index 4e10ff25bb..b29ea11dbc 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/OnlineResourceManager.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/OnlineResourceManager.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.share.ui.online.resource; import javax.swing.SwingWorker; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; +import java.util.function.Predicate; /** * Created by kerry on 2020-12-10 @@ -25,11 +26,16 @@ public class OnlineResourceManager { private final BlockingQueue loaderBlockingQueue = new ArrayBlockingQueue(100); - public void cancelLoad() { + public void cancelLoad(Object key) { if (swingWorker != null) { swingWorker.cancel(true); } - this.loaderBlockingQueue.clear(); + loaderBlockingQueue.removeIf(new Predicate() { + @Override + public boolean test(ResourceLoader resourceLoader) { + return resourceLoader.checkValid(key); + } + }); } public void addLoader(ResourceLoader loader) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/ResourceLoader.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/ResourceLoader.java index fee705f8ab..7aacd2941e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/ResourceLoader.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/ResourceLoader.java @@ -10,4 +10,11 @@ public interface ResourceLoader { */ void load(); + /** + * 检查resource是否属于某分类 + * @param key 分类标识 + * @return boolean + */ + boolean checkValid(Object key); + }