From 2c911b92aa7bbed7a9f685f2b2ad150538d8ea76 Mon Sep 17 00:00:00 2001 From: pengda Date: Thu, 28 Jul 2022 11:52:39 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-76635=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=9B=BE=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E9=94=99=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ColSelectedWithSummaryMethodEditor.java | 27 +++++++++++++++++++ ...anChartCustomPlotConditionAttrTabPane.java | 5 ++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java index 6d7ba7699b..be12d6214a 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java @@ -1,6 +1,10 @@ package com.fr.design.chart.series.SeriesCondition; import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.ChartCommonCondition; +import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartglyph.ConditionAttr; +import com.fr.chart.chartglyph.ConditionCollection; import com.fr.data.DSColumnWithSummaryMethod; import com.fr.data.util.function.AbstractDataFunction; import com.fr.design.chart.ChartDataHelper; @@ -9,8 +13,11 @@ import com.fr.design.editor.editor.Editor; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.type.CustomPlotType; import java.awt.Dimension; +import java.util.List; import javax.swing.DefaultComboBoxModel; public class ColSelectedWithSummaryMethodEditor extends Editor { @@ -88,4 +95,24 @@ public class ColSelectedWithSummaryMethodEditor extends Editor list = ((VanChartCustomPlot) plot).getCustomPlotList(); + VanChartPlot vanChartPlot = list.get(index); + ConditionCollection conditionCollection = vanChartPlot.getConditionCollection(); + ConditionAttr[] conditionAttrs = conditionCollection.getAllConditionAttrList(); + for (ConditionAttr conditionAttr : conditionAttrs) { + if (conditionAttr.getCondition() instanceof ChartCommonCondition) { + ChartCommonCondition chartCommonCondition = (ChartCommonCondition) conditionAttr.getCondition(); + if (chartCommonCondition.getCompare().getValue() instanceof DSColumnWithSummaryMethod) { + DSColumnWithSummaryMethod dsColumnWithSummaryMethod = (DSColumnWithSummaryMethod) chartCommonCondition.getCompare().getValue(); + columnNameComboBoxModel.setSelectedItem(dsColumnWithSummaryMethod.getFieldName()); + summaryMethodComboBoxModel.setSelectedItem(ChartCommonCondition.FORMAT_MAP.get(String.valueOf(dsColumnWithSummaryMethod.getDataFunction().getFormula()))); + return; + } + } + } + } + } + } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java index c9b45162f7..0f23c5050e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java @@ -93,9 +93,8 @@ public class VanChartCustomPlotConditionAttrTabPane extends VanChartCustomPlotTa CustomPlotType plotType = CustomPlotFactory.getCustomType(chartPlot); VanChartRichEditorPane.refreshCustomChartTableFieldNames(chart, plotType); ColSelectedWithSummaryMethodEditor.refreshCustomChartTableFieldNames(chart, plotType); - JPanel selectedPane = paneList.get(index); - if (chart != null && chartPlot != null && selectedPane instanceof VanChartConditionAttrPane) { - ((VanChartConditionAttrPane) selectedPane).populateBean(chartPlot); + if (chart != null) { + ColSelectedWithSummaryMethodEditor.update(index, chart.getPlot()); } } }