Browse Source

Merge remote-tracking branch 'origin/release/11.0' into release/11.0

bugfix/11.0
Hoky 3 years ago
parent
commit
3a751c0122
  1. 3
      designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java
  2. 4
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java
  3. 3
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetPackageBlock.java
  4. 7
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/PreviewWidgetBlock.java
  5. 5
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/SimpleWidgetBlock.java
  6. 4
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java
  7. 2
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java
  8. 3
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java
  9. 10
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/OnlineResourceManager.java
  10. 7
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/ResourceLoader.java

3
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() { public void clickComponentSetting() {
if (!ComponentShareUtil.needShowEmbedFilterPane()) {
return;
}
boolean changed = false; boolean changed = false;
int firstShowReact = ComponentReuseNotificationInfo.getInstance().isWidgetLibHasRefreshed() ? 2 : -1; int firstShowReact = ComponentReuseNotificationInfo.getInstance().isWidgetLibHasRefreshed() ? 2 : -1;
if (this.firstShowReact != firstShowReact) { if (this.firstShowReact != firstShowReact) {

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

@ -95,6 +95,10 @@ public abstract class AbstractOnlineWidgetBlock extends PreviewWidgetBlock<Onlin
resetCover(image); resetCover(image);
} }
public boolean checkValid(Object key) {
return this.parentPane == key;
}
private Image getDefaultDisplayImage(){ private Image getDefaultDisplayImage(){
return ShareComponentConstants.DEFAULT_COVER; return ShareComponentConstants.DEFAULT_COVER;
} }

3
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetPackageBlock.java

@ -41,6 +41,9 @@ public class OnlineWidgetPackageBlock extends AbstractOnlineWidgetBlock {
southPane.add(detailLabel, BorderLayout.EAST); southPane.add(detailLabel, BorderLayout.EAST);
return southPane; return southPane;
} }
protected boolean supportFirstDragAnimate(){
return false;
}
protected Dimension getCoverDimension() { protected Dimension getCoverDimension() {
return new Dimension(ShareComponentConstants.SHARE_PACKAGE_BLOCK_WIDTH, IMAGE_HEIGHT); return new Dimension(ShareComponentConstants.SHARE_PACKAGE_BLOCK_WIDTH, IMAGE_HEIGHT);

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

@ -148,7 +148,8 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
hover = true; hover = true;
if (ComponentShareUtil.needShowFirstDragAnimate() && !FormWidgetDetailPane.getInstance().hasTouched() && checkWidget()) { if (ComponentShareUtil.needShowFirstDragAnimate() && supportFirstDragAnimate() &&
!FormWidgetDetailPane.getInstance().hasTouched() && checkWidget()) {
schedule(ANIMATE_START_TIME); schedule(ANIMATE_START_TIME);
awtEventListener = event -> { awtEventListener = event -> {
if (!this.isShowing()) { if (!this.isShowing()) {
@ -169,6 +170,10 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
} }
} }
protected boolean supportFirstDragAnimate(){
return true;
}
protected boolean checkWidget() { protected boolean checkWidget() {
return true; return true;
} }

5
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.removeListener();
this.setFocusable(false); this.setFocusable(false);
} }
protected boolean supportFirstDragAnimate(){
return false;
}
} }

4
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); 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)); JPanel actionsPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0));
actionsPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, -5));
actionsPane.setOpaque(false); actionsPane.setOpaque(false);
actionsPane.setBackground(null); actionsPane.setBackground(null);
UIButton cancelUpgradeButton = new UIButton(Toolkit.i18nText("Fine-Design_Share_Upgrade_Cancel")); UIButton cancelUpgradeButton = new UIButton(Toolkit.i18nText("Fine-Design_Share_Upgrade_Cancel"));
cancelUpgradeButton.setRoundBorder(true);
cancelUpgradeButton.addActionListener(new ActionListener() { cancelUpgradeButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { 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")); UIButton startUpgradeButton = new UIButton(Toolkit.i18nText("Fine-Design_Share_Upgrade_All"));
startUpgradeButton.setSelected(true); startUpgradeButton.setSelected(true);
startUpgradeButton.setRoundBorder(true);
startUpgradeButton.setBorderPainted(false);
startUpgradeButton.setForeground(Color.WHITE); startUpgradeButton.setForeground(Color.WHITE);
startUpgradeButton.addActionListener(new ActionListener() { startUpgradeButton.addActionListener(new ActionListener() {
@Override @Override

2
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()) { if (!OnlineShopUtils.testConnection()) {
return OnlineWidgetSelectPane.PaneStatue.DISCONNECTED; return OnlineWidgetSelectPane.PaneStatue.DISCONNECTED;
} }
OnlineResourceManager.getInstance().cancelLoad(); OnlineResourceManager.getInstance().cancelLoad(this);
contentPane.removeAll(); contentPane.removeAll();
scrollPane = createScrollPane(); scrollPane = createScrollPane();

3
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 String CAROUSEL_PREVIEW = "carousel_preview";
private static final int CAROUSE_IMAGE_LOAD_TIMEOUT = 2000; private static final int CAROUSE_IMAGE_LOAD_TIMEOUT = 2000;
private OnlineShareWidget[] showWidgets; private OnlineShareWidget[] showWidgets;
private static final int NOT_CAROUSE_WIDGET_NUM = 30;
private PreviewDialog previewDialog; private PreviewDialog previewDialog;
private JPanel widgetPane; private JPanel widgetPane;
@ -144,7 +145,7 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane
stopCarouse(integer); stopCarouse(integer);
return; return;
} }
if (integer.get() == 0) { if (integer.get() == NOT_CAROUSE_WIDGET_NUM) {
CarouselStateManger.getInstance().stop(); CarouselStateManger.getInstance().stop();
stopCarouse(integer); stopCarouse(integer);
previewDialog.setVisible(false); previewDialog.setVisible(false);

10
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 javax.swing.SwingWorker;
import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
import java.util.function.Predicate;
/** /**
* Created by kerry on 2020-12-10 * Created by kerry on 2020-12-10
@ -25,11 +26,16 @@ public class OnlineResourceManager {
private final BlockingQueue<ResourceLoader> loaderBlockingQueue = new ArrayBlockingQueue<ResourceLoader>(100); private final BlockingQueue<ResourceLoader> loaderBlockingQueue = new ArrayBlockingQueue<ResourceLoader>(100);
public void cancelLoad() { public void cancelLoad(Object key) {
if (swingWorker != null) { if (swingWorker != null) {
swingWorker.cancel(true); swingWorker.cancel(true);
} }
this.loaderBlockingQueue.clear(); loaderBlockingQueue.removeIf(new Predicate<ResourceLoader>() {
@Override
public boolean test(ResourceLoader resourceLoader) {
return resourceLoader.checkValid(key);
}
});
} }
public void addLoader(ResourceLoader loader) { public void addLoader(ResourceLoader loader) {

7
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/ResourceLoader.java

@ -10,4 +10,11 @@ public interface ResourceLoader {
*/ */
void load(); void load();
/**
* 检查resource是否属于某分类
* @param key 分类标识
* @return boolean
*/
boolean checkValid(Object key);
} }

Loading…
Cancel
Save