Browse Source

Merge pull request #9593 in DESIGN/design from release/11.0 to bugfix/11.0

* commit 'e825753ec119663b6781ffd244129f3f45b3e7ef':
  REPORT-76635 数据集参数默认值为空的情况下,组合图条件属性内容错乱
bugfix/11.0
superman 2 years ago
parent
commit
2de26e7003
  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