From 60cda6075f3d96ace5d5c6e04679d7db81a6cb56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 16 Jun 2021 10:05:14 +0800 Subject: [PATCH] =?UTF-8?q?CHART-19556=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E8=BD=BB=E9=87=8F=E7=BA=A7=E5=8A=A0=E8=BD=BD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=AE=8C=E4=B9=8B=E5=90=8E=E9=94=80=E6=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 10 ++++++---- .../component/richText/VanChartRichEditorPane.java | 11 ++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 86086abdd6..d7c590e642 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -39,6 +39,10 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingUtilities; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -47,10 +51,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; /** * 数据点提示内容界面,含有通用设置、富文本编辑器、自定义JS界面 @@ -411,10 +411,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane fieldNames; + private static final boolean USE_LIGHT_WEIGHT = SystemUtils.IS_OS_WINDOWS_10; + public static List getFieldNames() { return fieldNames; } @@ -154,7 +156,7 @@ public class VanChartRichEditorPane { } public static ModernUIPane initPane(VanChartRichEditorModel model) { - BrowserType type = SystemUtils.IS_OS_WINDOWS_10 ? BrowserType.LIGHTWEIGHT : BrowserType.HEAVYWEIGHT; + BrowserType type = USE_LIGHT_WEIGHT ? BrowserType.LIGHTWEIGHT : BrowserType.HEAVYWEIGHT; return new ModernUIPane.Builder(type) .prepare(new ScriptContextAdapter() { public void onScriptContextCreated(ScriptContextEvent event) { @@ -232,4 +234,11 @@ public class VanChartRichEditorPane { return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());"; } + + public static void checkDispose() { + if (USE_LIGHT_WEIGHT) { + browser.dispose(); + richEditorPane = null; + } + } }