From d2c39de9d3229333e467f81c844a3b4886a89eef Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 16 Nov 2021 13:44:24 +0800 Subject: [PATCH] =?UTF-8?q?CHART-21951=20=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E6=8F=92=E4=BB=B6=E6=97=A0=E6=B3=95=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=A4=8D=E7=94=A8=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/share/effect/EffectItemGroup.java | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java index c04932d0d..622f5cc99 100644 --- a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java +++ b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java @@ -109,15 +109,7 @@ public class EffectItemGroup { Object value = cellElement.getValue(); if (value instanceof ChartCollection) { ChartCollection chartCollection = (ChartCollection) value; - for (int index = 0; index < chartCollection.getChartCount(); index++) { - Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); - Plot plot = chart.getPlot(); - if (plot == null) { - continue; - } - SourceNode chartSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), cellSourceNode); - initChartPlot(plot, chartSourceNode, false); - } + initChartEditorByChartCollection(chartCollection, cellSourceNode); } } @@ -127,16 +119,23 @@ public class EffectItemGroup { private void initChartEditor() { ChartEditor editor = (ChartEditor) this.widget; ChartCollection chartCollection = (ChartCollection) editor.getChartCollection(); + initChartEditorByChartCollection(chartCollection, null); + + } + + private void initChartEditorByChartCollection(ChartCollection chartCollection, SourceNode sourceNode) { for (int index = 0; index < chartCollection.getChartCount(); index++) { - Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); - Plot plot = chart.getPlot(); - if (plot == null) { - continue; + ChartProvider chartProvider = chartCollection.getChart(index, ChartProvider.class); + if (chartProvider instanceof Chart) { + Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); + Plot plot = chart.getPlot(); + if (plot == null) { + continue; + } + SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), sourceNode); + initChartPlot(plot, plotSourceNode, false); } - SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), null); - initChartPlot(plot, plotSourceNode, false); } - } private void initChartPlot(Plot plot, SourceNode sourceNode, boolean isSubChart) {