Browse Source

bug修复

feature/x
kerry 3 years ago
parent
commit
e7355039d8
  1. 4
      designer-base/src/main/java/com/fr/design/DesignerCloudURLManager.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/share/ComponentShareUtil.java
  3. 33
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  4. 3
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/PreviewWidgetBlock.java
  5. 20
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java

4
designer-base/src/main/java/com/fr/design/DesignerCloudURLManager.java

@ -63,7 +63,7 @@ public class DesignerCloudURLManager implements XMLable {
executorService.submit(() -> { executorService.submit(() -> {
updateURLXMLFile(key, latestUrl); updateURLXMLFile(key, latestUrl);
}); });
return url; return latestUrl;
} }
//本地缓存不为空时,直接返回对应 url,同时异步更新 //本地缓存不为空时,直接返回对应 url,同时异步更新
executorService.submit(() -> { executorService.submit(() -> {
@ -74,7 +74,7 @@ public class DesignerCloudURLManager implements XMLable {
} }
private synchronized void updateURLXMLFile(String key, String url) { private synchronized void updateURLXMLFile(String key, String url) {
if (!urlMap.containsKey(key) || !url.equals(urlMap.get(key))) { if (StringUtils.isNotEmpty(url) && (!urlMap.containsKey(key) || !url.equals(urlMap.get(key)))) {
urlMap.put(key, url); urlMap.put(key, url);
saveURLXMLFile(); saveURLXMLFile();
} }

2
designer-base/src/main/java/com/fr/design/mainframe/share/ComponentShareUtil.java

@ -66,7 +66,7 @@ public class ComponentShareUtil {
* @return boolean * @return boolean
*/ */
public static boolean needShowFirstDragAnimate() { public static boolean needShowFirstDragAnimate() {
return ComponentReuseNotificationInfo.getInstance().isFirstDrag() && !hasTouched(); return ComponentReuseNotificationInfo.getInstance().isFirstDrag();
} }
/** /**

33
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -13,7 +13,6 @@ import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane;
import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane;
import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark; import com.fr.general.locale.LocaleMark;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -33,13 +32,15 @@ import java.util.List;
* Date: 14-7-8 * Date: 14-7-8
* Time: 下午8:18 * Time: 下午8:18
*/ */
public class FormWidgetDetailPane extends FormDockView{ public class FormWidgetDetailPane extends FormDockView {
private static final int ONLINE_TAB = 1; private static final int ONLINE_TAB = 1;
private JPanel centerPane; private JPanel centerPane;
private UIHeadGroup headGroup; private UIHeadGroup headGroup;
private List<BasicPane> paneList; private List<BasicPane> paneList;
private CardLayout cardLayout; private CardLayout cardLayout;
//用来标记当前组件库界面是否处于已触达状态
private boolean hasTouched = false;
private boolean isEmptyPane = false; private boolean isEmptyPane = false;
@ -50,7 +51,7 @@ public class FormWidgetDetailPane extends FormDockView{
return HOLDER.singleton; return HOLDER.singleton;
} }
private FormWidgetDetailPane(){ private FormWidgetDetailPane() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
} }
@ -77,7 +78,7 @@ public class FormWidgetDetailPane extends FormDockView{
/** /**
* 初始化 * 初始化
*/ */
public void refreshDockingView(){ public void refreshDockingView() {
if (isEmptyPane) { if (isEmptyPane) {
return; return;
} }
@ -87,18 +88,18 @@ public class FormWidgetDetailPane extends FormDockView{
clearDockingView(); clearDockingView();
return; return;
} }
hasTouched = ComponentShareUtil.hasTouched();
initPaneList(); initPaneList();
this.setBorder(null); this.setBorder(null);
cardLayout = new CardLayout(); cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout); centerPane = new JPanel(cardLayout);
String[] paneNames = new String[paneList.size()]; String[] paneNames = new String[paneList.size()];
for (int i = 0; i < paneList.size(); i++) { for (int i = 0; i < paneList.size(); i++) {
String title = paneList.get(i).getTitle(); String title = paneList.get(i).getTitle();
paneNames[i] = title; paneNames[i] = title;
centerPane.add(paneList.get(i), title); centerPane.add(paneList.get(i), title);
} }
headGroup = new UIHeadGroup(paneNames) { headGroup = new UIHeadGroup(paneNames) {
protected void tabChanged(int newSelectedIndex) { protected void tabChanged(int newSelectedIndex) {
//初始化还未展示的时候不需要收集其 marketClick //初始化还未展示的时候不需要收集其 marketClick
if (this.isShowing() && newSelectedIndex == 1) { if (this.isShowing() && newSelectedIndex == 1) {
@ -106,20 +107,28 @@ public class FormWidgetDetailPane extends FormDockView{
} }
cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle()); cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle());
} }
}; };
headGroup.setSelectedIndex(ComponentShareUtil.needSwitch2OnlineTab() ? ONLINE_TAB : 0); headGroup.setSelectedIndex(ComponentShareUtil.needSwitch2OnlineTab() ? ONLINE_TAB : 0);
this.add(headGroup, BorderLayout.NORTH); this.add(headGroup, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
/**
* 判断是否可触达
*
* @return boolean
*/
public boolean hasTouched() {
return hasTouched;
}
public void resetEmptyPane(){ public void resetEmptyPane() {
this.isEmptyPane = false; this.isEmptyPane = false;
} }
/** /**
* 清除数据 * 清除数据
*/ */
@ -129,7 +138,7 @@ public class FormWidgetDetailPane extends FormDockView{
this.add(psp, BorderLayout.CENTER); this.add(psp, BorderLayout.CENTER);
} }
public void switch2Empty(){ public void switch2Empty() {
isEmptyPane = true; isEmptyPane = true;
this.removeAll(); this.removeAll();
JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5); JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5);
@ -162,7 +171,7 @@ public class FormWidgetDetailPane extends FormDockView{
} }
public void enterWidgetLib() { public void enterWidgetLib() {
ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); ComponentReuseNotifyUtil.enterWidgetLibExtraAction();
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB);
} }

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

@ -5,6 +5,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormWidgetDetailPane;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.share.ComponentShareUtil; import com.fr.design.mainframe.share.ComponentShareUtil;
import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.collect.ComponentCollector;
@ -147,7 +148,7 @@ 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() && checkWidget()) { if (ComponentShareUtil.needShowFirstDragAnimate() && !FormWidgetDetailPane.getInstance().hasTouched() && checkWidget()) {
schedule(ANIMATE_START_TIME); schedule(ANIMATE_START_TIME);
awtEventListener = event -> { awtEventListener = event -> {
if (!this.isShowing()) { if (!this.isShowing()) {

20
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java

@ -46,13 +46,18 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane
awtEventListener = event -> { awtEventListener = event -> {
if (event instanceof MouseEvent) { if (event instanceof MouseEvent) {
if (((MouseEvent) event).getClickCount() > 0) { if (((MouseEvent) event).getClickCount() > 0) {
Point selectPanePoint = OnlineEmbedFilterSelectPane.this.getLocationOnScreen(); try {
Dimension selectPaneDimension = OnlineEmbedFilterSelectPane.this.getSize(); Point selectPanePoint = OnlineEmbedFilterSelectPane.this.getLocationOnScreen();
Rectangle selectPaneRec = new Rectangle(selectPanePoint.x, selectPanePoint.y, selectPaneDimension.width, selectPaneDimension.height); Dimension selectPaneDimension = OnlineEmbedFilterSelectPane.this.getSize();
if (CarouselStateManger.getInstance().running() && Rectangle selectPaneRec = new Rectangle(selectPanePoint.x, selectPanePoint.y, selectPaneDimension.width, selectPaneDimension.height);
!selectPaneRec.contains(((MouseEvent) event).getLocationOnScreen())) { if (CarouselStateManger.getInstance().running() &&
CarouselStateManger.getInstance().stop(); !selectPaneRec.contains(((MouseEvent) event).getLocationOnScreen())) {
CarouselStateManger.getInstance().stop();
}
} catch (Exception e) {
//忽略
} }
} }
} }
@ -82,9 +87,10 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane
public void animate() throws InterruptedException { public void animate() throws InterruptedException {
CarouselStateManger.getInstance().countDownLatchAwait(); CarouselStateManger.getInstance().countDownLatchAwait();
AtomicInteger integer = new AtomicInteger(showWidgets.length-1); AtomicInteger integer = new AtomicInteger(showWidgets.length - 1);
showCurrentLoadBlock(integer, widgetPane); showCurrentLoadBlock(integer, widgetPane);
this.repaint(); this.repaint();
CarouselStateManger.getInstance().start();
previewDialog.setVisible(true); previewDialog.setVisible(true);
} }

Loading…
Cancel
Save