Browse Source

Pull request #6849: REPORT-63190 && REPORT-63257【接触点优化】轮播过程中切换组件包,再回来发现显示有问题

Merge in DESIGN/design from ~KERRY/design_10.0:release/11.0 to release/11.0

* commit '6aa636185daf0bf2a471b433891590b4195ff47b':
  REPORT-62672【接触点优化】部分埋点无法模拟对应埋点数据
  REPORT-63190【接触点优化】轮播过程中切换组件包,再回来发现显示有问题
bugfix/11.0
kerry 3 years ago
parent
commit
22bf2d8ce5
  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. 2
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java
  7. 3
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java
  8. 10
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/resource/OnlineResourceManager.java
  9. 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() {
if (!ComponentShareUtil.needShowEmbedFilterPane()) {
return;
}
boolean changed = false;
int firstShowReact = ComponentReuseNotificationInfo.getInstance().isWidgetLibHasRefreshed() ? 2 : -1;
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);
}
public boolean checkValid(Object key) {
return this.parentPane == key;
}
private Image getDefaultDisplayImage(){
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);
return southPane;
}
protected boolean supportFirstDragAnimate(){
return false;
}
protected Dimension getCoverDimension() {
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
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<T> extends JPanel implements MouseListe
}
}
protected boolean supportFirstDragAnimate(){
return true;
}
protected boolean checkWidget() {
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.setFocusable(false);
}
protected boolean supportFirstDragAnimate(){
return false;
}
}

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()) {
return OnlineWidgetSelectPane.PaneStatue.DISCONNECTED;
}
OnlineResourceManager.getInstance().cancelLoad();
OnlineResourceManager.getInstance().cancelLoad(this);
contentPane.removeAll();
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 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);

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 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<ResourceLoader> loaderBlockingQueue = new ArrayBlockingQueue<ResourceLoader>(100);
public void cancelLoad() {
public void cancelLoad(Object key) {
if (swingWorker != null) {
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) {

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();
/**
* 检查resource是否属于某分类
* @param key 分类标识
* @return boolean
*/
boolean checkValid(Object key);
}

Loading…
Cancel
Save