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(() -> {
updateURLXMLFile(key, latestUrl);
});
return url;
return latestUrl;
}
//本地缓存不为空时,直接返回对应 url,同时异步更新
executorService.submit(() -> {
@ -74,7 +74,7 @@ public class DesignerCloudURLManager implements XMLable {
}
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);
saveURLXMLFile();
}

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

@ -66,7 +66,7 @@ public class ComponentShareUtil {
* @return boolean
*/
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.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
@ -33,13 +32,15 @@ import java.util.List;
* Date: 14-7-8
* Time: 下午8:18
*/
public class FormWidgetDetailPane extends FormDockView{
public class FormWidgetDetailPane extends FormDockView {
private static final int ONLINE_TAB = 1;
private JPanel centerPane;
private UIHeadGroup headGroup;
private List<BasicPane> paneList;
private CardLayout cardLayout;
//用来标记当前组件库界面是否处于已触达状态
private boolean hasTouched = false;
private boolean isEmptyPane = false;
@ -50,7 +51,7 @@ public class FormWidgetDetailPane extends FormDockView{
return HOLDER.singleton;
}
private FormWidgetDetailPane(){
private FormWidgetDetailPane() {
setLayout(FRGUIPaneFactory.createBorderLayout());
}
@ -77,7 +78,7 @@ public class FormWidgetDetailPane extends FormDockView{
/**
* 初始化
*/
public void refreshDockingView(){
public void refreshDockingView() {
if (isEmptyPane) {
return;
}
@ -87,18 +88,18 @@ public class FormWidgetDetailPane extends FormDockView{
clearDockingView();
return;
}
hasTouched = ComponentShareUtil.hasTouched();
initPaneList();
this.setBorder(null);
cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout);
String[] paneNames = new String[paneList.size()];
for (int i = 0; i < paneList.size(); i++) {
String title = paneList.get(i).getTitle();
String title = paneList.get(i).getTitle();
paneNames[i] = title;
centerPane.add(paneList.get(i), title);
}
headGroup = new UIHeadGroup(paneNames) {
headGroup = new UIHeadGroup(paneNames) {
protected void tabChanged(int newSelectedIndex) {
//初始化还未展示的时候不需要收集其 marketClick
if (this.isShowing() && newSelectedIndex == 1) {
@ -106,20 +107,28 @@ public class FormWidgetDetailPane extends FormDockView{
}
cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle());
}
};
};
headGroup.setSelectedIndex(ComponentShareUtil.needSwitch2OnlineTab() ? ONLINE_TAB : 0);
this.add(headGroup, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
}
/**
* 判断是否可触达
*
* @return boolean
*/
public boolean hasTouched() {
return hasTouched;
}
public void resetEmptyPane(){
public void resetEmptyPane() {
this.isEmptyPane = false;
}
/**
* 清除数据
*/
@ -129,7 +138,7 @@ public class FormWidgetDetailPane extends FormDockView{
this.add(psp, BorderLayout.CENTER);
}
public void switch2Empty(){
public void switch2Empty() {
isEmptyPane = true;
this.removeAll();
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();
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.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormWidgetDetailPane;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.share.ComponentShareUtil;
import com.fr.design.mainframe.share.collect.ComponentCollector;
@ -147,7 +148,7 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
@Override
public void mouseEntered(MouseEvent e) {
hover = true;
if (ComponentShareUtil.needShowFirstDragAnimate() && checkWidget()) {
if (ComponentShareUtil.needShowFirstDragAnimate() && !FormWidgetDetailPane.getInstance().hasTouched() && checkWidget()) {
schedule(ANIMATE_START_TIME);
awtEventListener = event -> {
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 -> {
if (event instanceof MouseEvent) {
if (((MouseEvent) event).getClickCount() > 0) {
Point selectPanePoint = OnlineEmbedFilterSelectPane.this.getLocationOnScreen();
Dimension selectPaneDimension = OnlineEmbedFilterSelectPane.this.getSize();
Rectangle selectPaneRec = new Rectangle(selectPanePoint.x, selectPanePoint.y, selectPaneDimension.width, selectPaneDimension.height);
if (CarouselStateManger.getInstance().running() &&
!selectPaneRec.contains(((MouseEvent) event).getLocationOnScreen())) {
CarouselStateManger.getInstance().stop();
try {
Point selectPanePoint = OnlineEmbedFilterSelectPane.this.getLocationOnScreen();
Dimension selectPaneDimension = OnlineEmbedFilterSelectPane.this.getSize();
Rectangle selectPaneRec = new Rectangle(selectPanePoint.x, selectPanePoint.y, selectPaneDimension.width, selectPaneDimension.height);
if (CarouselStateManger.getInstance().running() &&
!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 {
CarouselStateManger.getInstance().countDownLatchAwait();
AtomicInteger integer = new AtomicInteger(showWidgets.length-1);
AtomicInteger integer = new AtomicInteger(showWidgets.length - 1);
showCurrentLoadBlock(integer, widgetPane);
this.repaint();
CarouselStateManger.getInstance().start();
previewDialog.setVisible(true);
}

Loading…
Cancel
Save