From 305fcce81713196e587462c1e16968e9dc5f85a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 19 Feb 2020 20:07:37 +0800 Subject: [PATCH] CHART-12746 --- .../mainframe/chart/info/ChartInfoCollector.java | 11 +++++++++-- .../main/java/com/fr/design/chart/ChartTypePane.java | 10 +++------- .../mainframe/chart/gui/ChartTypeButtonPane.java | 5 +---- .../chart/designer/type/AbstractVanChartTypePane.java | 7 +++---- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java index 0fc0501ac6..4dbfdaaedd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java @@ -3,12 +3,14 @@ package com.fr.design.mainframe.chart.info; import com.fr.base.FRContext; import com.fr.base.io.BaseBook; import com.fr.base.io.XMLReadHelper; +import com.fr.chartx.attr.ChartProvider; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.template.info.SendHelper; import com.fr.design.mainframe.template.info.TemplateInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.vanchart.VanChart; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -75,6 +77,13 @@ public class ChartInfoCollector implements XMLReadable, XMLWriter { return instance; } + public void collection(ChartProvider chartProvider, String createTime) { + if (chartProvider instanceof VanChart) { + VanChart vanChart = (VanChart) chartProvider; + collection(vanChart.getUuid(), vanChart.getID(), createTime); + } + } + /** * 新建图表,保存状态 */ @@ -166,8 +175,6 @@ public class ChartInfoCollector implements XMLReadable, XMLWriter { } } - - // 每次更新之后,都同步到暂存文件中 saveInfo(); } diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index a0a9d82b4d..2bb9a99f22 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -7,12 +7,11 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chartx.attr.ChartProvider; import com.fr.design.ChartTypeInterfaceManager; -import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; -import com.fr.plugin.chart.vanchart.VanChart; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; @@ -124,7 +123,7 @@ public class ChartTypePane extends ChartCommonWizardPane { update(cc, null); } - public void update(ChartCollection cc, String creatTime) { + public void update(ChartCollection cc, String createTime) { if (cc == null) { return; } @@ -137,10 +136,7 @@ public class ChartTypePane extends ChartCommonWizardPane { chart4Update = (ChartProvider) chart.clone(); cc.addChart(chart4Update); //记录埋点 - if (chart4Update instanceof VanChart) { - VanChart vanChart = (VanChart) chart4Update; - ChartInfoCollector.getInstance().collection(vanChart.getUuid(), vanChart.getID(), creatTime); - } + ChartInfoCollector.getInstance().collection(chart4Update, createTime); } catch (CloneNotSupportedException ex) { FineLoggerFactory.getLogger().error(ex.getMessage(), ex); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index d7cd8a107c..766b133979 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -152,10 +152,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen try { ChartProvider newChart = (ChartProvider) chart.clone(); editingCollection.addNamedChart(name, newChart); - if (newChart instanceof VanChart) { - VanChart vanchart = (VanChart) newChart; - ChartInfoCollector.getInstance().collection(vanchart.getUuid(), vanchart.getID(), null); - } + ChartInfoCollector.getInstance().collection(newChart, null); } catch (CloneNotSupportedException e1) { FineLoggerFactory.getLogger().error("Error in Clone"); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 7901ac29b2..2ae28cc2cf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -106,10 +106,9 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane