From 7352c73ba4ea88b342a20e7d3379ed36018e28ea Mon Sep 17 00:00:00 2001 From: pengda Date: Tue, 29 Jun 2021 14:21:28 +0800 Subject: [PATCH 01/12] =?UTF-8?q?REPORT-54574=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E7=8E=AF=E5=A2=83=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=86=85=E5=AE=B9=E4=B8=AD=EF=BC=8C=E6=80=A7?= =?UTF-8?q?=E8=83=BD=E6=8F=92=E4=BB=B6=E4=B8=8B=E7=9A=84=E5=85=AD=E4=B8=AA?= =?UTF-8?q?=E5=8C=85=E8=A2=AB=E5=88=86=E5=88=AB=E8=AF=86=E5=88=AB=E4=B8=BA?= =?UTF-8?q?=E4=BA=86=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../versioncheck/VersionCheckUtils.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java index e63395ff6..045d54413 100644 --- a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java +++ b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java @@ -39,6 +39,7 @@ import java.lang.reflect.Method; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -59,6 +60,21 @@ public class VersionCheckUtils { private static final String ID = "id"; private static final String VERSION = "version"; private static final String NAME = "name"; + private static final Set pluginsNeedIgnore = new HashSet<>(); + static { + pluginsNeedIgnore.addAll(Arrays.asList( + "com.fr.plugin.performance.newexecutetool", + "com.fr.plugin.performance.newline", + "com.fr.plugin.performance.pdfstream", + "com.fr.plugin.performance.dzstartemptyfile", + "com.fr.plugin.performance.treenode.button.optimization", + "com.fr.plugin.performance.druid", + "com.fr.plugin.performance.reducecalculation", + "com.fr.plugin.performance.fasttree", + "com.fr.plugin.performance.paralleldsloader", + "com.fr.plugin.cloud.analytics.v10" + )); + } public static boolean versionCheck(String envName) { @@ -236,6 +252,9 @@ public class VersionCheckUtils { continue; } String remotePluginID = remotePlugin.getString(ID); + if (pluginsNeedIgnore.contains(remotePluginID)) { + continue; + } if (localPluginsMap.containsKey(remotePluginID)) { if (ComparatorUtils.equals(localPluginsMap.get(remotePluginID).getVersion(), remotePlugin.getString(VERSION))) { continue; From 7e105b9f160bcfb810525f1b8bcec6cf56441aba Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 29 Jun 2021 17:22:12 +0800 Subject: [PATCH 02/12] =?UTF-8?q?REPORT-54545=20=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E9=BB=98=E8=AE=A4=E5=AD=97=E4=BD=93=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/cell/editor/RichTextToolBar.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index fb904e219..5f0fd27d2 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -5,6 +5,7 @@ package com.fr.design.cell.editor; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; +import com.fr.base.FRContext; import com.fr.base.Utils; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; @@ -61,6 +62,11 @@ public class RichTextToolBar extends BasicPane{ private static final Dimension BUTTON_SIZE = new Dimension(24, 20); + /** + * 富文本字体下拉框默认首选字体 非设计器UI界面字体 + */ + private static final FRFont DEFAULT_FONT = FRContext.getDefaultValues().getFRFont().applySize(13); + private UIComboBox fontNameComboBox; private UIComboBox fontSizeComboBox; private UIToggleButton bold; @@ -153,11 +159,11 @@ public class RichTextToolBar extends BasicPane{ } private void bindListener(){ - FRFont defaultFont = (this.textPane != null) ? FRFont.getInstance(this.textPane.getFont()) : RichTextPane.DEFAUL_FONT; + // 这里下拉框默认选中字体 不由UI界面字体决定 两套不同体系 fontNameComboBox.addItemListener(fontNameItemListener); - fontNameComboBox.setSelectedItem(defaultFont.getFamily()); + fontNameComboBox.setSelectedItem(DEFAULT_FONT.getFamily()); fontSizeComboBox.addItemListener(fontSizeItemListener); - fontSizeComboBox.setSelectedItem(scaleDown(defaultFont.getSize())); + fontSizeComboBox.setSelectedItem(scaleDown(DEFAULT_FONT.getSize())); bold.addActionListener(blodChangeAction); italic.addActionListener(itaChangeAction); From ce6392b593038838a52036aaeed634f348a78408 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 29 Jun 2021 21:17:00 +0800 Subject: [PATCH 03/12] =?UTF-8?q?REPORT-53902=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=97=A0=E6=9D=83=E9=99=90=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/env/RemoteEnvPane.java | 3 ++- .../main/resources/com/fr/design/i18n/dimension_en.properties | 1 + .../resources/com/fr/design/i18n/dimension_ja_JP.properties | 3 ++- .../resources/com/fr/design/i18n/dimension_ko_KR.properties | 3 ++- .../main/resources/com/fr/design/i18n/dimension_zh.properties | 3 ++- .../resources/com/fr/design/i18n/dimension_zh_TW.properties | 3 ++- 6 files changed, 11 insertions(+), 5 deletions(-) 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 5be56bfbf..ab7f27df0 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -15,6 +15,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; @@ -653,7 +654,7 @@ public class RemoteEnvPane extends BasicBeanPane { dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(RemoteEnvPane.this), Toolkit.i18nText("Fine-Design_Basic_Dialog_Message_Title"), true); - dialog.setSize(new Dimension(308, 132)); + dialog.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.env.RemoteEnvPane.dialog")); okButton.setEnabled(false); JPanel jp = new JPanel(); JPanel upPane = new JPanel(); diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index 23abf1ba4..6a227a996 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -3,3 +3,4 @@ com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=630*185 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=630*31 com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=630*280 com.fr.design.report.ReportColumnsPane=800*600 +com.fr.env.RemoteEnvPane.dialog=458*132 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 97c7a38b6..db3632a29 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -1,4 +1,5 @@ com.fr.design.mainframe.check.CheckButton=280*118 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=610*185 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=610*31 -com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280 \ No newline at end of file +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280 +com.fr.env.RemoteEnvPane.dialog=458*132 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index c00c5eb62..b9d7ef15a 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -1,4 +1,5 @@ com.fr.design.mainframe.check.CheckButton=230*118 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=490*185 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*35 -com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280 \ No newline at end of file +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280 +com.fr.env.RemoteEnvPane.dialog=458*132 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index 85eb5c552..818a9d5d6 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -2,4 +2,5 @@ com.fr.design.mainframe.check.CheckButton=250*118 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31 -com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 \ No newline at end of file +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 +com.fr.env.RemoteEnvPane.dialog=308*132 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index d6bdbbc64..87d117140 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -1,4 +1,5 @@ com.fr.design.mainframe.check.CheckButton=250*118 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31 -com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 \ No newline at end of file +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 +com.fr.env.RemoteEnvPane.dialog=308*132 \ No newline at end of file From 1ac21709746b541e68c17e27e21e75663826d71f Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 30 Jun 2021 16:18:55 +0800 Subject: [PATCH 04/12] =?UTF-8?q?REPORT-54643=20=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84persist=E5=88=86=E6=94=AF=E5=AE=89=E8=A3=85=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=86=85=E5=AD=98=E7=9B=91=E6=8E=A7=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=A4=B1=E8=B4=A5=E4=B8=94=E4=BC=9A=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 5 ++ .../design/mainframe/SafeWindowListener.java | 84 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 25948b62c..dc90fb0d0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -535,6 +535,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } + @Override + public synchronized void addWindowListener(WindowListener l) { + super.addWindowListener(new SafeWindowListener(l)); + } + private void addMacOsListener() { OSSupportCenter.buildAction(new MacOsAddListenerAction(), SupportOSImpl.DOCK_QUIT); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java b/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java new file mode 100644 index 000000000..4f3c812ad --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java @@ -0,0 +1,84 @@ +package com.fr.design.mainframe; + +import com.fr.log.FineLoggerFactory; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; + +/** + * 保证监听运行出错也不影响其他功能正常使用 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/30 + */ +public class SafeWindowListener implements WindowListener { + + private final WindowListener windowListener; + + public SafeWindowListener(WindowListener windowListener) { + this.windowListener = windowListener; + } + + @Override + public void windowOpened(WindowEvent e) { + try { + windowListener.windowOpened(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowClosing(WindowEvent e) { + try { + windowListener.windowClosing(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowClosed(WindowEvent e) { + try { + windowListener.windowClosed(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowIconified(WindowEvent e) { + try { + windowListener.windowIconified(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowDeiconified(WindowEvent e) { + try { + windowListener.windowDeiconified(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowActivated(WindowEvent e) { + try { + windowListener.windowActivated(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowDeactivated(WindowEvent e) { + try { + windowListener.windowDeactivated(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } +} From 22e191155a92cb7a9ded7db2330b908287de6def Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 30 Jun 2021 16:18:55 +0800 Subject: [PATCH 05/12] =?UTF-8?q?REPORT-54643=20=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84persist=E5=88=86=E6=94=AF=E5=AE=89=E8=A3=85=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=86=85=E5=AD=98=E7=9B=91=E6=8E=A7=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=A4=B1=E8=B4=A5=E4=B8=94=E4=BC=9A=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 5 ++ .../design/mainframe/SafeWindowListener.java | 84 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 25948b62c..dc90fb0d0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -535,6 +535,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } + @Override + public synchronized void addWindowListener(WindowListener l) { + super.addWindowListener(new SafeWindowListener(l)); + } + private void addMacOsListener() { OSSupportCenter.buildAction(new MacOsAddListenerAction(), SupportOSImpl.DOCK_QUIT); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java b/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java new file mode 100644 index 000000000..4f3c812ad --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java @@ -0,0 +1,84 @@ +package com.fr.design.mainframe; + +import com.fr.log.FineLoggerFactory; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; + +/** + * 保证监听运行出错也不影响其他功能正常使用 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/30 + */ +public class SafeWindowListener implements WindowListener { + + private final WindowListener windowListener; + + public SafeWindowListener(WindowListener windowListener) { + this.windowListener = windowListener; + } + + @Override + public void windowOpened(WindowEvent e) { + try { + windowListener.windowOpened(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowClosing(WindowEvent e) { + try { + windowListener.windowClosing(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowClosed(WindowEvent e) { + try { + windowListener.windowClosed(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowIconified(WindowEvent e) { + try { + windowListener.windowIconified(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowDeiconified(WindowEvent e) { + try { + windowListener.windowDeiconified(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowActivated(WindowEvent e) { + try { + windowListener.windowActivated(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowDeactivated(WindowEvent e) { + try { + windowListener.windowDeactivated(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } +} From 64c360e1cb47891afe62236840f214c7ef7dee68 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 30 Jun 2021 19:39:01 +0800 Subject: [PATCH 06/12] =?UTF-8?q?REPORT-54573=20=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=9C=AC=E5=9C=B0=E9=A2=84=E8=A7=88=E6=8A=A5=E9=94=99?= =?UTF-8?q?400=E8=AF=B7=E6=B1=82=E5=A4=B4=E8=BF=87=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/start/server/FineEmbedServerActivator.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index 5fa8173d4..854d260bf 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -6,6 +6,7 @@ import com.fr.module.Activator; import com.fr.module.ModuleRole; import com.fr.stable.EncodeConstants; import com.fr.stable.ProductConstants; +import com.fr.stable.StringUtils; import com.fr.startup.FineWebApplicationInitializer; import com.fr.third.springframework.web.SpringServletContainerInitializer; import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext; @@ -26,6 +27,8 @@ import java.util.Set; */ public class FineEmbedServerActivator extends Activator { + private static final String TOMCAT_MAX_HEADER_SIZE = "tomcat-maxHttpHeaderSize"; + private Tomcat tomcat; @Override @@ -68,6 +71,7 @@ public class FineEmbedServerActivator extends Activator { // 8.5.x 请求参数带特殊字符被tomcat拒绝 []|{}^\`"<> tomcat.getConnector().setProperty("relaxedQueryChars", "[]|{}^\`"<>"); setMaxPostSize(); + setMaxHttpHeaderSize(); String docBase = new File(WorkContext.getCurrent().getPath()).getParent(); //内置的上下文使用工程目录比如webroot @@ -102,6 +106,17 @@ public class FineEmbedServerActivator extends Activator { } } + private void setMaxHttpHeaderSize() { + String value = System.getProperty(TOMCAT_MAX_HEADER_SIZE); + if (StringUtils.isNotEmpty(value)) { + try { + tomcat.getConnector().setProperty("maxHttpHeaderSize", value); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + private void stopServerActivator() { From 0ec9b2839174743d3a1f1e8cd526af4371707652 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 1 Jul 2021 11:00:22 +0800 Subject: [PATCH 07/12] =?UTF-8?q?REPORT-54123=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=8A=A5=E8=A1=A8=E5=9D=97=E7=BB=84=E4=BB=B6=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E5=92=8C=E9=80=80=E5=87=BA=E7=BC=96=E8=BE=91=E6=97=B6?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 表单报表块进入编辑状态后选中某单元格, 单元格边框高亮, 之后报表块退出编辑,对报表块截图以显示在布局面板上,但 此时因为单元格未退出选中状态,导致截图中出现边框高亮的单元格。 当布局面板中出现多个这样的报表块时,产生了很混乱的效果,因此需要进行 优化。 报表块退出编辑状态后,取消单元格选中 --- .../com/fr/design/mainframe/form/FormECDesignerProvider.java | 2 ++ designer-form/src/main/java/com/fr/design/mainframe/JForm.java | 3 +++ .../com/fr/design/mainframe/form/FormElementCaseDesigner.java | 3 +++ 3 files changed, 8 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/form/FormECDesignerProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/form/FormECDesignerProvider.java index 27b4a249a..88a462307 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/form/FormECDesignerProvider.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/form/FormECDesignerProvider.java @@ -90,4 +90,6 @@ public interface FormECDesignerProvider { BufferedImage getElementCaseImage(Dimension elementCaseContainerSize); void refreshPropertyPane(); + + void removeSelection(); } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index eee57c99f..856494401 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -917,6 +917,9 @@ public class JForm extends JTemplate implements BaseJForm Date: Thu, 1 Jul 2021 11:34:50 +0800 Subject: [PATCH 08/12] =?UTF-8?q?CHART-19719=20=E5=9B=BE=E4=BE=8B=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E4=BF=AE=E6=94=B9=20&&=20CHART-19692=20=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E5=9B=BA=E5=AE=9A=E5=A4=A7=E5=B0=8F=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/PlotFactory.java | 6 ++-- .../style/HeatMapRangeLegendPane.java | 2 +- .../style/VanChartPlotLegendPane.java | 36 +++++++++---------- .../style/VanChartRangeLegendPane.java | 2 +- .../VanLegendPaneWidthOutFixedCheck.java | 21 +++++++++++ .../style/VanLegendPaneWidthOutHighlight.java | 21 ----------- .../van/chart/pie/RadiusCardLayoutPane.java | 16 ++++----- 7 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutFixedCheck.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutHighlight.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index 3167b5f59..4ceeab548 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -34,7 +34,7 @@ import com.fr.van.chart.designer.style.MapRangeLegendPane; import com.fr.van.chart.designer.style.VanChartPlotLegendPane; import com.fr.van.chart.designer.style.VanChartRangeLegendPane; import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.designer.style.VanLegendPaneWidthOutHighlight; +import com.fr.van.chart.designer.style.VanLegendPaneWidthOutFixedCheck; import com.fr.van.chart.designer.style.label.VanChartGaugePlotLabelPane; import com.fr.van.chart.designer.style.label.VanChartPiePlotLabelPane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; @@ -128,8 +128,8 @@ public class PlotFactory { private static Map, Class> legendMap = new HashMap, Class>(); static { - legendMap.put(VanChartGaugePlot.class, VanLegendPaneWidthOutHighlight.class); - legendMap.put(VanChartMultiPiePlot.class, VanLegendPaneWidthOutHighlight.class); + legendMap.put(VanChartGaugePlot.class, VanLegendPaneWidthOutFixedCheck.class); + legendMap.put(VanChartMultiPiePlot.class, VanLegendPaneWidthOutFixedCheck.class); legendMap.put(VanChartScatterPlot.class, VanChartRangeLegendPane.class); legendMap.put(VanChartBubblePlot.class, VanChartRangeLegendPane.class); legendMap.put(VanChartMapPlot.class, MapRangeLegendPane.class); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java index d77a106a2..556f9e0fd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java @@ -17,6 +17,6 @@ public class HeatMapRangeLegendPane extends MapRangeLegendPane { } protected JPanel createCommonLegendPane(){ - return this.createLegendPaneWithoutHighlight(); + return this.createLegendPaneWithoutFixedCheck(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java index 5a16aa4c8..4ba1abb7d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java @@ -72,9 +72,9 @@ public class VanChartPlotLegendPane extends BasicPane { //private LimitPane limitPane; //高亮显示的按钮 - private UILabel highlightLabel; - private UIButtonGroup highlightButton; - private JPanel highlightPane; + private UILabel fixedCheckLabel; + private UICheckBox fixedCheck; + private JPanel fixedCheckPane; private VanChartStylePane parent; @@ -91,8 +91,8 @@ public class VanChartPlotLegendPane extends BasicPane { this.plot = plot; } - public JPanel getHighlightPane() { - return highlightPane; + public JPanel getFixedCheckPane() { + return fixedCheckPane; } public VanChartStylePane getLegendPaneParent() { @@ -135,7 +135,7 @@ public class VanChartPlotLegendPane extends BasicPane { }); } - protected JPanel createLegendPaneWithoutHighlight() { + protected JPanel createLegendPaneWithoutFixedCheck() { borderPane = new VanChartBorderWithRadiusPane(); backgroundPane = creatBackgroundPane(); @@ -162,11 +162,11 @@ public class VanChartPlotLegendPane extends BasicPane { protected JPanel createLegendPane() { borderPane = new VanChartBorderWithRadiusPane(); backgroundPane = creatBackgroundPane(); - highlightPane = createHighlightPane(); + fixedCheckPane = createFixedCheckPane(); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(createDisplayStrategy(), BorderLayout.CENTER); - panel.add(highlightPane, BorderLayout.SOUTH); + panel.add(fixedCheckPane, BorderLayout.SOUTH); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -319,9 +319,9 @@ public class VanChartPlotLegendPane extends BasicPane { // return limitPane; } - private JPanel createHighlightPane() { - highlightButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); - highlightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Highlight")); + private JPanel createFixedCheckPane() { + fixedCheck = new UICheckBox(Toolkit.i18nText("Fine-Engine_Chart_Open_Fixed_Display")); + fixedCheckLabel = new UILabel(Toolkit.i18nText("Fine-Engine_Chart_Fixed_Display")); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; @@ -329,7 +329,7 @@ public class VanChartPlotLegendPane extends BasicPane { double[] rowSize = {p, p}; Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{highlightLabel, highlightButton} + new Component[]{fixedCheckLabel, fixedCheck} }; return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); } @@ -408,8 +408,8 @@ public class VanChartPlotLegendPane extends BasicPane { //legend.setLimitAttribute(limitPane.updateBean()); legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); - if (highlightButton != null && highlightButton.getSelectedItem() != null) { - legend.setHighlight(highlightButton.getSelectedItem()); + if (fixedCheck != null) { + legend.setHighlight(fixedCheck.isSelected()); } } @@ -431,11 +431,11 @@ public class VanChartPlotLegendPane extends BasicPane { maxProportion.populateBean(legend.getMaxHeight()); //区域显示策略 恢复用注释。取消注释。 //limitPane.populateBean(legend.getLimitAttribute()); - if (highlightButton != null) { - highlightButton.setSelectedItem(legend.isHighlight()); + if (fixedCheck != null) { + fixedCheck.setSelected(legend.isHighlight()); boolean largeDataModel = PlotFactory.largeDataModel(plot); - highlightButton.setEnabled(!largeDataModel); - highlightLabel.setEnabled(!largeDataModel); + fixedCheck.setEnabled(!largeDataModel); + fixedCheckLabel.setEnabled(!largeDataModel); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java index 5fa030a28..cae5bd30c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java @@ -114,7 +114,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { } private void checkHighlightVisible() { - JPanel highlightPane = this.getHighlightPane(); + JPanel highlightPane = this.getFixedCheckPane(); if (highlightPane != null) { highlightPane.setVisible(legendType != LegendType.GRADUAL); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutFixedCheck.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutFixedCheck.java new file mode 100644 index 000000000..80dd6d9c2 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutFixedCheck.java @@ -0,0 +1,21 @@ +package com.fr.van.chart.designer.style; + +import javax.swing.JPanel; + +/** + * Created by eason on 2016/12/14. + */ +public class VanLegendPaneWidthOutFixedCheck extends VanChartPlotLegendPane{ + + public VanLegendPaneWidthOutFixedCheck(){ + + } + + public VanLegendPaneWidthOutFixedCheck(VanChartStylePane parent){ + super(parent); + } + + protected JPanel createLegendPane(){ + return this.createLegendPaneWithoutFixedCheck(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutHighlight.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutHighlight.java deleted file mode 100644 index 8387a2053..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutHighlight.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fr.van.chart.designer.style; - -import javax.swing.JPanel; - -/** - * Created by eason on 2016/12/14. - */ -public class VanLegendPaneWidthOutHighlight extends VanChartPlotLegendPane{ - - public VanLegendPaneWidthOutHighlight(){ - - } - - public VanLegendPaneWidthOutHighlight(VanChartStylePane parent){ - super(parent); - } - - protected JPanel createLegendPane(){ - return this.createLegendPaneWithoutHighlight(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java index 7befd40e7..db13b2806 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java @@ -42,7 +42,7 @@ public class RadiusCardLayoutPane extends BasicBeanPane { Map paneList = new HashMap(); radiusType = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); - radius = new UISpinnerWithPx(100); + radius = new UISpinnerWithPx(1, Double.MAX_VALUE, 1, 100); radiusContent = new JPanel(new BorderLayout()); radiusContent.add(radius, BorderLayout.CENTER); @@ -55,12 +55,12 @@ public class RadiusCardLayoutPane extends BasicBeanPane { radiusType.setSelectedIndex(0); - cardPane = new VanChartCardLayoutPane(paneList, "auto"){ + cardPane = new VanChartCardLayoutPane(paneList, "auto") { @Override public Dimension getPreferredSize() { if (radiusType.getSelectedIndex() == 1) { return radiusContent.getPreferredSize(); - }else { + } else { return new Dimension(0, 0); } } @@ -69,15 +69,15 @@ public class RadiusCardLayoutPane extends BasicBeanPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p,p}; + double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{radiusType,null}, + new Component[]{radiusType, null}, new Component[]{cardPane, null}, }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - this.setLayout(new BorderLayout(0,0)); + this.setLayout(new BorderLayout(0, 0)); this.add(panel, BorderLayout.CENTER); @@ -90,7 +90,7 @@ public class RadiusCardLayoutPane extends BasicBeanPane { @Override public void populateBean(Plot plot) { - if (plot instanceof VanChartRadiusPlot){ + if (plot instanceof VanChartRadiusPlot) { VanChartRadiusPlot radiusPlot = (VanChartRadiusPlot) plot; VanChartRadius vanChartRadius = radiusPlot.getRadius(); radiusType.setSelectedIndex(vanChartRadius.getRadiusType() == RadiusType.AUTO ? 0 : 1); @@ -102,7 +102,7 @@ public class RadiusCardLayoutPane extends BasicBeanPane { public void updateBean(Plot plot) { //更新半径 - if (plot instanceof VanChartRadiusPlot){ + if (plot instanceof VanChartRadiusPlot) { VanChartRadiusPlot radiusPlot = (VanChartRadiusPlot) plot; VanChartRadius vanChartRadius = radiusPlot.getRadius(); vanChartRadius.setRadiusType(radiusType.getSelectedIndex() == 0 ? RadiusType.AUTO : RadiusType.FIXED); From f4138e5c220569d0bdd2e91e9fa2cb2fa6a44799 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 1 Jul 2021 16:35:08 +0800 Subject: [PATCH 09/12] =?UTF-8?q?REPORT-54643=20=20=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 5 -- .../design/mainframe/SafeWindowListener.java | 84 ------------------- 2 files changed, 89 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index dc90fb0d0..25948b62c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -535,11 +535,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } - @Override - public synchronized void addWindowListener(WindowListener l) { - super.addWindowListener(new SafeWindowListener(l)); - } - private void addMacOsListener() { OSSupportCenter.buildAction(new MacOsAddListenerAction(), SupportOSImpl.DOCK_QUIT); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java b/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java deleted file mode 100644 index 4f3c812ad..000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.fr.design.mainframe; - -import com.fr.log.FineLoggerFactory; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; - -/** - * 保证监听运行出错也不影响其他功能正常使用 - * - * @author hades - * @version 10.0 - * Created by hades on 2021/6/30 - */ -public class SafeWindowListener implements WindowListener { - - private final WindowListener windowListener; - - public SafeWindowListener(WindowListener windowListener) { - this.windowListener = windowListener; - } - - @Override - public void windowOpened(WindowEvent e) { - try { - windowListener.windowOpened(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowClosing(WindowEvent e) { - try { - windowListener.windowClosing(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowClosed(WindowEvent e) { - try { - windowListener.windowClosed(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowIconified(WindowEvent e) { - try { - windowListener.windowIconified(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowDeiconified(WindowEvent e) { - try { - windowListener.windowDeiconified(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowActivated(WindowEvent e) { - try { - windowListener.windowActivated(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowDeactivated(WindowEvent e) { - try { - windowListener.windowDeactivated(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } -} From 43c398043c82dd310615561bd24e97fa792555a0 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 1 Jul 2021 16:35:08 +0800 Subject: [PATCH 10/12] =?UTF-8?q?REPORT-54643=20=20=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 5 -- .../design/mainframe/SafeWindowListener.java | 84 ------------------- 2 files changed, 89 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index dc90fb0d0..25948b62c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -535,11 +535,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } - @Override - public synchronized void addWindowListener(WindowListener l) { - super.addWindowListener(new SafeWindowListener(l)); - } - private void addMacOsListener() { OSSupportCenter.buildAction(new MacOsAddListenerAction(), SupportOSImpl.DOCK_QUIT); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java b/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java deleted file mode 100644 index 4f3c812ad..000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.fr.design.mainframe; - -import com.fr.log.FineLoggerFactory; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; - -/** - * 保证监听运行出错也不影响其他功能正常使用 - * - * @author hades - * @version 10.0 - * Created by hades on 2021/6/30 - */ -public class SafeWindowListener implements WindowListener { - - private final WindowListener windowListener; - - public SafeWindowListener(WindowListener windowListener) { - this.windowListener = windowListener; - } - - @Override - public void windowOpened(WindowEvent e) { - try { - windowListener.windowOpened(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowClosing(WindowEvent e) { - try { - windowListener.windowClosing(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowClosed(WindowEvent e) { - try { - windowListener.windowClosed(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowIconified(WindowEvent e) { - try { - windowListener.windowIconified(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowDeiconified(WindowEvent e) { - try { - windowListener.windowDeiconified(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowActivated(WindowEvent e) { - try { - windowListener.windowActivated(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } - - @Override - public void windowDeactivated(WindowEvent e) { - try { - windowListener.windowDeactivated(e); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); - } - } -} From 89f2bbc0e3c6b6ebe1d939b8cfdeef69b9df223c Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 1 Jul 2021 17:43:53 +0800 Subject: [PATCH 11/12] =?UTF-8?q?REPORT-54643=20=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84persist=E5=88=86=E6=94=AF=E5=AE=89=E8=A3=85=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=86=85=E5=AD=98=E7=9B=91=E6=8E=A7=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=A4=B1=E8=B4=A5=E4=B8=94=E4=BC=9A=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 15 ++++ .../design/mainframe/SafeWindowListener.java | 84 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 25948b62c..01a7defb2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -535,6 +535,21 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } + @Override + public synchronized void addWindowListener(WindowListener l) { + SafeWindowListener safeWindowListener = new SafeWindowListener(l); + map.put(l, safeWindowListener); + super.addWindowListener(safeWindowListener); + } + + @Override + public synchronized void removeWindowListener(WindowListener l) { + SafeWindowListener safeWindowListener = map.remove(l); + if (safeWindowListener != null) { + super.removeWindowListener(safeWindowListener); + } + } + private void addMacOsListener() { OSSupportCenter.buildAction(new MacOsAddListenerAction(), SupportOSImpl.DOCK_QUIT); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java b/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java new file mode 100644 index 000000000..d88eccfa7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/SafeWindowListener.java @@ -0,0 +1,84 @@ +package com.fr.design.mainframe; + +import com.fr.log.FineLoggerFactory; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; + +/** + * 保证监听运行出错也不影响其他功能正常使用 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/30 + */ +public class SafeWindowListener implements WindowListener { + + private final WindowListener windowListener; + + public SafeWindowListener(WindowListener windowListener) { + this.windowListener = windowListener; + } + + @Override + public void windowOpened(WindowEvent e) { + try { + windowListener.windowOpened(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowClosing(WindowEvent e) { + try { + windowListener.windowClosing(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowClosed(WindowEvent e) { + try { + windowListener.windowClosed(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowIconified(WindowEvent e) { + try { + windowListener.windowIconified(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowDeiconified(WindowEvent e) { + try { + windowListener.windowDeiconified(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowActivated(WindowEvent e) { + try { + windowListener.windowActivated(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } + + @Override + public void windowDeactivated(WindowEvent e) { + try { + windowListener.windowDeactivated(e); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + } + } +} \ No newline at end of file From 9c08ba509eb4d985f1fdd3c51a671cf98ef70936 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 1 Jul 2021 18:46:16 +0800 Subject: [PATCH 12/12] =?UTF-8?q?REPORT-54643=20=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84persist=E5=88=86=E6=94=AF=E5=AE=89=E8=A3=85=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=86=85=E5=AD=98=E7=9B=91=E6=8E=A7=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=A4=B1=E8=B4=A5=E4=B8=94=E4=BC=9A=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91=20=20?= =?UTF-8?q?=E6=BC=8F=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 01a7defb2..890b6fa04 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -72,6 +72,8 @@ import com.fr.start.OemHandler; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import java.util.HashMap; +import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; import org.jetbrains.annotations.Nullable; @@ -179,6 +181,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private int contentHeight = (int) (java.awt.Toolkit.getDefaultToolkit().getScreenSize().getHeight()); + private Map map = new HashMap<>(); + private WindowAdapter windowAdapter = new WindowAdapter() { @Override