From 7352c73ba4ea88b342a20e7d3379ed36018e28ea Mon Sep 17 00:00:00 2001 From: pengda Date: Tue, 29 Jun 2021 14:21:28 +0800 Subject: [PATCH 1/9] =?UTF-8?q?REPORT-54574=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E7=8E=AF=E5=A2=83=E4=B8=8D=E4=B8=80=E8=87=B4=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=86=85=E5=AE=B9=E4=B8=AD=EF=BC=8C=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E4=B8=8B=E7=9A=84=E5=85=AD=E4=B8=AA=E5=8C=85?= =?UTF-8?q?=E8=A2=AB=E5=88=86=E5=88=AB=E8=AF=86=E5=88=AB=E4=B8=BA=E4=BA=86?= =?UTF-8?q?=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 e63395ff65..045d54413f 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 2/9] =?UTF-8?q?REPORT-54545=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=AD=97=E4=BD=93=E6=9C=AC=E5=9C=B0=E5=8C=96?= =?UTF-8?q?=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 fb904e2190..5f0fd27d2f 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 3/9] =?UTF-8?q?REPORT-53902=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E6=97=A0=E6=9D=83=E9=99=90=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=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 5be56bfbf7..ab7f27df08 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 23abf1ba42..6a227a996a 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 97c7a38b66..db3632a293 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 c00c5eb621..b9d7ef15ab 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 85eb5c5525..818a9d5d62 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 d6bdbbc64a..87d117140e 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 4/9] =?UTF-8?q?REPORT-54643=20=E6=9C=80=E6=96=B0=E7=9A=84p?= =?UTF-8?q?ersist=E5=88=86=E6=94=AF=E5=AE=89=E8=A3=85=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E5=AD=98=E7=9B=91=E6=8E=A7=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=B8=94=E4=BC=9A=E5=AF=BC=E8=87=B4=E9=9D=A2?= =?UTF-8?q?=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 25948b62cf..dc90fb0d06 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 0000000000..4f3c812ad2 --- /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 5/9] =?UTF-8?q?REPORT-54643=20=E6=9C=80=E6=96=B0=E7=9A=84p?= =?UTF-8?q?ersist=E5=88=86=E6=94=AF=E5=AE=89=E8=A3=85=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E5=AD=98=E7=9B=91=E6=8E=A7=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=B8=94=E4=BC=9A=E5=AF=BC=E8=87=B4=E9=9D=A2?= =?UTF-8?q?=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 25948b62cf..dc90fb0d06 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 0000000000..4f3c812ad2 --- /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 f4138e5c220569d0bdd2e91e9fa2cb2fa6a44799 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 1 Jul 2021 16:35:08 +0800 Subject: [PATCH 6/9] =?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 dc90fb0d06..25948b62cf 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 4f3c812ad2..0000000000 --- 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 7/9] =?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 dc90fb0d06..25948b62cf 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 4f3c812ad2..0000000000 --- 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 8/9] =?UTF-8?q?REPORT-54643=20=E6=9C=80=E6=96=B0=E7=9A=84p?= =?UTF-8?q?ersist=E5=88=86=E6=94=AF=E5=AE=89=E8=A3=85=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E5=AD=98=E7=9B=91=E6=8E=A7=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=B8=94=E4=BC=9A=E5=AF=BC=E8=87=B4=E9=9D=A2?= =?UTF-8?q?=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 25948b62cf..01a7defb2e 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 0000000000..d88eccfa72 --- /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 9/9] =?UTF-8?q?REPORT-54643=20=E6=9C=80=E6=96=B0=E7=9A=84p?= =?UTF-8?q?ersist=E5=88=86=E6=94=AF=E5=AE=89=E8=A3=85=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E5=AD=98=E7=9B=91=E6=8E=A7=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=B8=94=E4=BC=9A=E5=AF=BC=E8=87=B4=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91=20=20=E6=BC=8F?= =?UTF-8?q?=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 01a7defb2e..890b6fa04b 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