Browse Source

Pull request #9576: REPORT-76635 数据集参数默认值为空的情况下,组合图条件属性内容错乱

Merge in DESIGN/design from ~PENGDA/design:final/11.0 to final/11.0

* commit '2c911b92aa7bbed7a9f685f2b2ad150538d8ea76':
  REPORT-76635 数据集参数默认值为空的情况下,组合图条件属性内容错乱
new-design
pengda 2 years ago
parent
commit
7e24acaddf
  1. 27
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java
  2. 5
      designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java

27
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<DSColumnWithSummaryMethod> {
@ -88,4 +95,24 @@ public class ColSelectedWithSummaryMethodEditor extends Editor<DSColumnWithSumma
return object instanceof DSColumnWithSummaryMethod;
}
public static void update(int index, Plot plot) {
if (plot instanceof VanChartCustomPlot) {
List<VanChartPlot> 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;
}
}
}
}
}
}

5
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());
}
}
}

Loading…
Cancel
Save