From bec1ebd012b8049444ed664c1124d6c8d718f59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 31 Aug 2021 14:37:15 +0800 Subject: [PATCH] =?UTF-8?q?CHART-20517=20=20=E5=9B=BE=E8=A1=A8=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=BC=96=E8=BE=91=E4=B9=8B=E5=90=8E=E5=86=8D=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/ChartTypePane.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 e93f0023b..09daae3b3 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 @@ -222,6 +222,7 @@ public class ChartTypePane extends AbstractChartAttrPane { String lastPlotID = chart.getID(); + boolean chartTypeChange = false; try { AbstractChartTypePane selectedPane = (AbstractChartTypePane) getSelectedPane(); ChartProvider newDefaultChart = (ChartProvider) ChartTypeManager.getInstanceWithCheck().getCharts(selectedPane.getPlotID())[0].clone(); @@ -231,13 +232,16 @@ public class ChartTypePane extends AbstractChartAttrPane { editingCollection.removeNameObject(editingCollection.getSelectedIndex()); editingCollection.addChart(newDefaultChart); chart = newDefaultChart; + chartTypeChange = true; } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } //这一步会替换plot + String id = chart.getID(); ((AbstractChartTypePane) getSelectedPane()).updateBean(chart); - if (inForm) { + chartTypeChange = chartTypeChange || !ComparatorUtils.equals(id, chart.getID()); + if (inForm && chartTypeChange) { chart.resetAttrInForm(); } reLayoutEditPane(chart, lastPlotID); @@ -465,5 +469,6 @@ public class ChartTypePane extends AbstractChartAttrPane { public void registerChartEditPane(ChartEditPane currentEditPane) { this.editPane = currentEditPane; this.inForm = editPane.isInForm(); + buttonPane.refreshChartInForm(inForm); } } \ No newline at end of file