From 7daf44dceff1b060729dc858deab78832df3b925 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Mon, 23 Aug 2021 17:20:12 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-54538=20=E7=BB=84=E4=BB=B6=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E6=97=A0=E7=BD=91=E7=BB=9C=E6=8F=90=E7=A4=BA=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=94=AF=E6=8C=81=E9=80=89=E4=B8=AD=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/ui/online/OnlineWidgetRepoPane.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java index af329cde8b..c07485745d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java @@ -14,6 +14,7 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.JTextField; import javax.swing.SwingConstants; import javax.swing.SwingWorker; import java.awt.BorderLayout; @@ -164,9 +165,14 @@ public class OnlineWidgetRepoPane extends BasicPane { tipLabel1.setForeground(Color.decode("#8F8F92")); UILabel tipLabel2 = tipLabel(Toolkit.i18nText("Fine-Design_Share_Internet_Connect_Failed_Tip2")); tipLabel2.setForeground(Color.decode("#8F8F92")); - UILabel tipLabel3 = tipLabel(MARKET_URL); - tipLabel3.setForeground(Color.decode("#8F8F92")); + JTextField tipLabel3 = new JTextField(MARKET_URL); + tipLabel3.setHorizontalAlignment(JTextField.CENTER); + tipLabel3.setPreferredSize(new Dimension(240, 20)); + tipLabel3.setEditable(false); + tipLabel3.setForeground(Color.decode("#8F8F92")); + tipLabel3.setBackground(null); + tipLabel3.setBorder(null); UILabel emptyLabel = tipLabel(StringUtils.EMPTY); panel.add(uiLabel); From 04bac5d214bddc2ff1d1febdfdc1c0a79e8dcad8 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Mon, 23 Aug 2021 17:21:19 +0800 Subject: [PATCH 2/5] =?UTF-8?q?REPORT-57590=20=E8=A1=A8=E5=8D=95=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=9D=A2=E6=9D=BF=E4=B8=8D=E5=BA=94=E8=AF=A5=E8=83=BD?= =?UTF-8?q?=E8=A2=AB=E5=A4=8D=E5=88=B6=E5=88=B0=E5=AE=B9=E5=99=A8=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XWParameterLayout.java | 10 +++++++ .../design/mainframe/FormSelectionUtils.java | 27 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java index 1d37024d98..f60aa9846e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java @@ -103,6 +103,16 @@ public class XWParameterLayout extends XWAbsoluteLayout { return false; } + @Override + public boolean canEnterIntoAbsolutePane() { + return false; + } + + @Override + public boolean canEnterIntoAdaptPane() { + return false; + } + /** * 该组件是否可以拖拽(表单中参数面板和自适应布局不可以拖拽) * @return 是则返回true diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java index 2900650aa0..84b8f6bf38 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java @@ -10,6 +10,7 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWScaleLayout; import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; @@ -60,6 +61,11 @@ public class FormSelectionUtils { */ public static void paste2Container(FormDesigner designer, XLayoutContainer parent, FormSelection clipboard, int x, int y) { + clipboard = filterFormSelection(clipboard, parent); + if (clipboard.isEmpty()) { + Toolkit.getDefaultToolkit().beep(); + return; + } LayoutAdapter adapter = parent.getLayoutAdapter(); if (parent instanceof XWAbsoluteLayout) { //绝对布局 @@ -77,6 +83,27 @@ public class FormSelectionUtils { Toolkit.getDefaultToolkit().beep(); } + private static FormSelection filterFormSelection(FormSelection clipboard, XLayoutContainer parent) { + FormSelection newSelection = new FormSelection(); + for (XCreator xCreator : clipboard.getSelectedCreators()) { + if (parent.acceptType(XWParameterLayout.class)) { + if (xCreator.canEnterIntoParaPane()) { + newSelection.addSelectedCreator(xCreator); + } + } else if (parent.acceptType(XWAbsoluteLayout.class)) { + if (xCreator.canEnterIntoAbsolutePane()) { + newSelection.addSelectedCreator(xCreator); + } + } else if (parent.acceptType(XWFitLayout.class)) { + if (xCreator.canEnterIntoAdaptPane()) { + newSelection.addSelectedCreator(xCreator); + } + } + + } + return newSelection; + } + private static boolean isExtraContainer(XLayoutContainer parent) { if (parent != null) { Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); From 2607d356b9993dae5e32aab09b9876cfb498dff3 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 24 Aug 2021 10:42:34 +0800 Subject: [PATCH 3/5] =?UTF-8?q?REPORT-56047=20=E8=AE=BE=E8=AE=A1=E5=99=A81?= =?UTF-8?q?1.0=E9=80=82=E9=85=8D=E5=86=85=E5=AE=B9=E5=A4=84=E7=90=86=20?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=88=B010.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 6 ++-- .../env/LocalDesignerWorkspaceInfo.java | 29 ++++++++++++++++++- .../main/java/com/fr/env/RemoteEnvPane.java | 4 +-- ...er.java => WorkspaceExceptionHandler.java} | 25 ++++++++++------ .../com/fr/env/jarVersion.properties | 1 + .../module/DesignerWorkspaceProvider.java | 1 - 6 files changed, 50 insertions(+), 16 deletions(-) rename designer-base/src/main/java/com/fr/env/handler/{RemoteDesignExceptionHandler.java => WorkspaceExceptionHandler.java} (72%) create mode 100644 designer-base/src/main/resources/com/fr/env/jarVersion.properties diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 98c079ee2b..6881c8445c 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -20,7 +20,7 @@ import com.fr.design.notification.NotificationCenter; import com.fr.design.utils.DesignUtils; import com.fr.design.versioncheck.VersionCheckUtils; import com.fr.env.EnvListPane; -import com.fr.env.handler.RemoteDesignExceptionHandler; +import com.fr.env.handler.WorkspaceExceptionHandler; import com.fr.exit.DesignerExiter; import com.fr.general.GeneralUtils; import com.fr.invoke.Reflect; @@ -139,7 +139,7 @@ public class EnvChangeEntrance { pluginErrorRemind(); } catch (Exception exception) { // 失败的处理 - RemoteDesignExceptionHandler.getInstance().handleInSwitch(exception, selectedEnv); + WorkspaceExceptionHandler.getInstance().handleInSwitch(exception, selectedEnv); return false; } TemplateTreePane.getInstance().refreshDockingView(); @@ -436,7 +436,7 @@ public class EnvChangeEntrance { } }); if (e != null) { - RemoteDesignExceptionHandler.getInstance().handleInStart(e, workspaceInfo); + WorkspaceExceptionHandler.getInstance().handleInStart(e, workspaceInfo); } envListDialog.setVisible(true); } diff --git a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java index ef1f420d62..6bb8ec37a5 100644 --- a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java @@ -1,18 +1,37 @@ package com.fr.design.env; import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralUtils; +import com.fr.locale.InterProviderFactory; +import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.project.ProjectConstants; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.engine.exception.MainVersionNotMatchException; import java.io.File; +import java.util.Properties; /** * Created by juhaoyu on 2018/6/15. */ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo { - + + private static final String REPORT_ENGINE_KEY = "report-engine-key"; + private static final String REPORT_ENGINE_JAR; + private static final String PROP_PATH = "/com/fr/env/jarVersion.properties"; + + static { + Properties properties = new Properties(); + try { + properties.load(LocalDesignerWorkspaceInfo.class.getResourceAsStream(PROP_PATH)); + } catch (Exception ignored) { + } + REPORT_ENGINE_JAR = properties.getProperty(REPORT_ENGINE_KEY, "default.jar"); + } + private String name; private String path; @@ -86,6 +105,14 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo { return false; } + File engineLib = new File(StableUtils.pathJoin(this.path, ProjectConstants.LIB_NAME, REPORT_ENGINE_JAR)); + // 非安装版本允许自由切换 + boolean notExistLib = !ComparatorUtils.equals(GeneralUtils.readFullBuildNO(), InterProviderFactory.getProvider().getLocText("Fine-Core_Basic_About_No_Build")) + && !engineLib.exists(); + if (notExistLib) { + throw new MainVersionNotMatchException(); + } + return true; } } diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 17dc72dba5..56f90e804e 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -21,7 +21,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.scrollruler.ModLineBorder; -import com.fr.env.handler.RemoteDesignExceptionHandler; +import com.fr.env.handler.WorkspaceExceptionHandler; import com.fr.stable.StringUtils; import com.fr.third.guava.base.Strings; import com.fr.workspace.WorkContext; @@ -596,7 +596,7 @@ public class RemoteEnvPane extends BasicBeanPane { } } catch (Exception e) { dialog.dispose(); - RemoteDesignExceptionHandler.getInstance().handleInTest(e, remoteEnv); + WorkspaceExceptionHandler.getInstance().handleInTest(e, remoteEnv); } dialogDownPane.remove(cancelButton); dialogDownPane.revalidate(); diff --git a/designer-base/src/main/java/com/fr/env/handler/RemoteDesignExceptionHandler.java b/designer-base/src/main/java/com/fr/env/handler/WorkspaceExceptionHandler.java similarity index 72% rename from designer-base/src/main/java/com/fr/env/handler/RemoteDesignExceptionHandler.java rename to designer-base/src/main/java/com/fr/env/handler/WorkspaceExceptionHandler.java index 7e6154eeee..367cd6bbb6 100644 --- a/designer-base/src/main/java/com/fr/env/handler/RemoteDesignExceptionHandler.java +++ b/designer-base/src/main/java/com/fr/env/handler/WorkspaceExceptionHandler.java @@ -1,5 +1,6 @@ package com.fr.env.handler; +import com.fr.base.exception.ExceptionDescriptor; import com.fr.design.EnvChangeEntrance; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceInfo; @@ -11,6 +12,7 @@ import com.fr.env.handler.impl.CommonHandler; import com.fr.env.handler.impl.ExecutionHandler; import com.fr.env.handler.impl.UnexpectedHandler; import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; import java.util.ArrayList; import java.util.List; import javax.swing.UIManager; @@ -23,11 +25,11 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE; * @version 10.0 * Created by hades on 2021/8/5 */ -public class RemoteDesignExceptionHandler { +public class WorkspaceExceptionHandler { - private static final RemoteDesignExceptionHandler INSTANCE = new RemoteDesignExceptionHandler(); + private static final WorkspaceExceptionHandler INSTANCE = new WorkspaceExceptionHandler(); - public static RemoteDesignExceptionHandler getInstance() { + public static WorkspaceExceptionHandler getInstance() { return INSTANCE; } @@ -35,7 +37,7 @@ public class RemoteDesignExceptionHandler { private final List> switchList = new ArrayList<>(); - private RemoteDesignExceptionHandler() { + private WorkspaceExceptionHandler() { // 要保证顺序 testList.add(new CancelHandler()); testList.add(new ExecutionHandler()); @@ -65,11 +67,15 @@ public class RemoteDesignExceptionHandler { public void handleInSwitch(Throwable e, DesignerWorkspaceInfo workspaceInfo) { if (workspaceInfo == null || workspaceInfo.getType() == DesignerWorkspaceType.Local) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - FineJOptionPane.showMessageDialog(EnvChangeEntrance.getInstance().getDialog(), - Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"), - Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), - ERROR_MESSAGE, - UIManager.getIcon("OptionPane.errorIcon")); + if (e instanceof ExceptionDescriptor) { + new CommonHandler(true).handle(new RefWrapper(e, StringUtils.EMPTY)); + } else { + FineJOptionPane.showMessageDialog(EnvChangeEntrance.getInstance().getDialog(), + Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"), + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + ERROR_MESSAGE, + UIManager.getIcon("OptionPane.errorIcon")); + } return; } handle(e, switchList, workspaceInfo); @@ -78,6 +84,7 @@ public class RemoteDesignExceptionHandler { public void handleInStart(Throwable e, DesignerWorkspaceInfo workspaceInfo) { if (workspaceInfo == null || workspaceInfo.getType() == DesignerWorkspaceType.Local) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + new CommonHandler(false).handle(new RefWrapper(e, StringUtils.EMPTY)); return; } handle(e, testList, workspaceInfo); diff --git a/designer-base/src/main/resources/com/fr/env/jarVersion.properties b/designer-base/src/main/resources/com/fr/env/jarVersion.properties new file mode 100644 index 0000000000..8619fca7c3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/env/jarVersion.properties @@ -0,0 +1 @@ +report-engine-key=fine-report-engine-10.0.jar \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java index d5b6cdb632..0035e1e608 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java @@ -9,7 +9,6 @@ import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.versioncheck.VersionCheckUtils; -import com.fr.env.handler.RemoteDesignExceptionHandler; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; From 1973d1796492b151db7209193114aa44be892e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 24 Aug 2021 11:47:47 +0800 Subject: [PATCH 4/5] =?UTF-8?q?REPORT-57202=20FR11=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92-=E9=A1=B5=E9=9D=A2=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=BA=B8=E5=BC=A0=E5=A4=A7=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/report/PageSetupPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java index 668700a95e..3074bb009a 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java @@ -779,7 +779,7 @@ public class PageSetupPane extends BasicPane { //使用科学计数法显示长度的时候,限制纵向显示长度为9位 if (h_str.contains(E)) { String str1 = h_str.substring(h_str.indexOf(E)); - String str2 = h_str.substring(0, 9 - str1.length()); + String str2 = h_str.substring(0, Math.min(h_str.length(), 9) - str1.length()); h_str = str2 + str1; } else if (h_str.indexOf(CoreConstants.DOT) > 0) { h_str = h_str.substring(0, h_str.indexOf(CoreConstants.DOT) + 2); From 42c40af36d92b538948fbd6059f38b5b1e042ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 24 Aug 2021 15:13:44 +0800 Subject: [PATCH 5/5] =?UTF-8?q?CHART-20312=20=E5=9B=BE=E8=A1=A8=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E6=8C=89=E9=92=AE=E5=A4=B1=E7=84=A6=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChartTypePane.java | 25 +++++++++++++++---- .../chart/gui/type/ChartImagePane.java | 1 + 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index ac0bfcb577..e93f0023bc 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -25,17 +25,19 @@ import com.fr.stable.AssistUtils; import com.fr.stable.StringUtils; import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; /** * 图表 属性表, 类型选择 界面. @@ -99,6 +101,19 @@ public class ChartTypePane extends AbstractChartAttrPane { buttonPane.setEditingChartPane(chartTypeComBox); + buttonPane.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent e) { + buttonPane.requestFocus(); + } + }); + + chartTypeComBox.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent e) { + content.requestFocus(); + } + }); return content; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java index 584d7fd1d6..e8ef8714da 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java @@ -72,6 +72,7 @@ public class ChartImagePane extends ChartSelectDemoPane { }else{ this.isDoubleClicked = false; } + this.requestFocus(); super.mouseClicked(e); }