Browse Source

CHART-11232 refactor 图表数据面板按对应类型populate

research/11.0
Wim.Zhai 5 years ago
parent
commit
db7cc6befb
  1. 23
      designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java
  2. 38
      designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java

23
designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java

@ -1,11 +1,14 @@
package com.fr.van.chart.bubble; package com.fr.van.chart.bubble;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane; import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.ScatterCellDataFieldsPane; import com.fr.design.chartx.fields.diff.ScatterCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.ScatterDataSetFieldsPane; import com.fr.design.chartx.fields.diff.ScatterDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane; import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
@ -18,6 +21,7 @@ import com.fr.design.mainframe.chart.gui.data.report.BubblePlotReportDataContent
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.bubble.data.VanChartBubblePlotTableDataContentPane; import com.fr.van.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.other.VanChartOtherPane;
@ -123,8 +127,27 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
@Override @Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) { public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) { return new AbstractVanSingleDataPane(listener) {
VanChartBubblePlot plot;
@Override
public void populate(ChartCollection collection) {
if (collection == null) {
return;
}
VanChart chart = collection.getSelectedChartProvider(VanChart.class);
if (chart == null) {
return;
}
plot = chart.getPlot();
super.populate(collection);
}
@Override @Override
protected SingleDataPane createSingleDataPane() { protected SingleDataPane createSingleDataPane() {
if (plot != null && plot.isForceBubble()) {
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
}
return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane()); return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane());
} }
}; };

38
designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java

@ -1,7 +1,14 @@
package com.fr.van.chart.gauge; package com.fr.van.chart.gauge;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.GaugeCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.GaugeDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -15,6 +22,7 @@ import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContent
import com.fr.design.mainframe.chart.gui.data.table.MeterPlotTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.MeterPlotTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.custom.component.CategoryCustomPlotTableDataContentPane; import com.fr.van.chart.custom.component.CategoryCustomPlotTableDataContentPane;
import com.fr.van.chart.custom.component.MeterCustomPlotReportDataContentPane; import com.fr.van.chart.custom.component.MeterCustomPlotReportDataContentPane;
import com.fr.van.chart.custom.component.MeterCustomPlotTableDataContentPane; import com.fr.van.chart.custom.component.MeterCustomPlotTableDataContentPane;
@ -107,4 +115,34 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){ public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartGaugeSeriesPane(parent, plot); return new VanChartGaugeSeriesPane(parent, plot);
} }
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
VanChartGaugePlot gaugePlot;
@Override
public void populate(ChartCollection collection) {
if (collection == null) {
return;
}
VanChart chart = collection.getSelectedChartProvider(VanChart.class);
if (chart == null) {
return;
}
gaugePlot = chart.getPlot();
super.populate(collection);
}
@Override
protected SingleDataPane createSingleDataPane() {
if (gaugePlot != null && !gaugePlot.isMultiPointer()) {
return new SingleDataPane(new GaugeDataSetFieldsPane(), new GaugeCellDataFieldsPane());
}
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
}
};
}
} }
Loading…
Cancel
Save