Browse Source

CHART-11093 refactor 数据面板切换

research/11.0
Wim.Zhai 5 years ago
parent
commit
e93938a18c
  1. 5
      designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java
  2. 19
      designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java
  3. 11
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java
  4. 20
      designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java
  5. 2
      designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java
  6. 11
      designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java
  7. 12
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java
  8. 11
      designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractIndependentVanChartUI.java
  9. 11
      designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java
  10. 12
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java

5
designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java

@ -3,6 +3,8 @@ package com.fr.design.chartx;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.CustomChartDataDefinition;
import com.fr.design.chartx.fields.diff.GaugeCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.GaugeDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.ScatterCellDataFieldsPane;
@ -86,8 +88,7 @@ public class CustomChartDataPane extends ChartDataPane {
case RING:
case SLOT:
case CUVETTE:
//todo 仪表板没写好
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
return new SingleDataPane(new GaugeDataSetFieldsPane(), new GaugeCellDataFieldsPane());
case SCATTER:
case BUBBLE:
return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane());

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

@ -3,6 +3,9 @@ package com.fr.van.chart.bubble;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.ScatterCellDataFieldsPane;
@ -143,6 +146,22 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
super.populate(collection);
}
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
if (dataDefinition != null) {
if (plot != null && plot.isForceBubble()) {
if (!(dataDefinition.getColumnFieldCollection() instanceof MultiCategoryColumnFieldCollection)) {
dataDefinition.setColumnFieldCollection(new MultiCategoryColumnFieldCollection());
}
} else {
if (!(dataDefinition.getColumnFieldCollection() instanceof BubbleColumnFieldCollection)) {
dataDefinition.setColumnFieldCollection(new BubbleColumnFieldCollection());
}
}
}
super.populate(dataDefinition);
}
@Override
protected SingleDataPane createSingleDataPane() {
if (plot != null && plot.isForceBubble()) {

11
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java

@ -2,6 +2,8 @@ package com.fr.van.chart.funnel.designer;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.field.diff.ColumnFieldCollectionWithSeriesValue;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.FunnelCellDataFieldsPane;
@ -97,6 +99,15 @@ public class FunnelIndependentVanChartInterface extends AbstractIndependentVanCh
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof ColumnFieldCollectionWithSeriesValue)){
dataDefinition.setColumnFieldCollection(new ColumnFieldCollectionWithSeriesValue());
}
super.populate(dataDefinition);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new FunnelDataSetFieldsPane(), new FunnelCellDataFieldsPane());

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

@ -2,6 +2,9 @@ package com.fr.van.chart.gauge;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.field.diff.GaugeColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.GaugeCellDataFieldsPane;
@ -136,6 +139,23 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha
super.populate(collection);
}
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
if (dataDefinition != null) {
if (gaugePlot != null && !gaugePlot.isMultiPointer()) {
if (!(dataDefinition.getColumnFieldCollection() instanceof GaugeColumnFieldCollection)){
dataDefinition.setColumnFieldCollection(new GaugeColumnFieldCollection());
}
} else{
if (!(dataDefinition.getColumnFieldCollection() instanceof MultiCategoryColumnFieldCollection)){
dataDefinition.setColumnFieldCollection(new MultiCategoryColumnFieldCollection());
}
}
}
super.populate(dataDefinition);
}
@Override
protected SingleDataPane createSingleDataPane() {
if (gaugePlot != null && !gaugePlot.isMultiPointer()) {

2
designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java

@ -50,7 +50,7 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
if (!(dataDefinition.getColumnFieldCollection() instanceof MultiPieColumnFieldCollection)) {
if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof MultiPieColumnFieldCollection)) {
dataDefinition.setColumnFieldCollection(new MultiPieColumnFieldCollection());
}
super.populate(dataDefinition);

11
designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java

@ -3,6 +3,8 @@ package com.fr.van.chart.scatter;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.ScatterCellDataFieldsPane;
@ -111,6 +113,15 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof BubbleColumnFieldCollection)) {
dataDefinition.setColumnFieldCollection(new BubbleColumnFieldCollection());
}
super.populate(dataDefinition);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane());

12
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java

@ -2,6 +2,8 @@ package com.fr.van.chart.structure.desinger;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.field.diff.StructureColumnFieldCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.StructureCellDataFieldsPane;
@ -106,6 +108,16 @@ public class VanStructureChartTypeUI extends AbstractIndependentVanChartUI {
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof StructureColumnFieldCollection)) {
dataDefinition.setColumnFieldCollection(new StructureColumnFieldCollection());
}
super.populate(dataDefinition);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane());

11
designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractIndependentVanChartUI.java

@ -1,6 +1,8 @@
package com.fr.van.chart.vanchart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.chart.fun.impl.AbstractIndependentChartUIWithAPILevel;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.SingleCategoryCellDataFieldsPane;
@ -54,6 +56,15 @@ public abstract class AbstractIndependentVanChartUI extends AbstractIndependentC
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof MultiCategoryColumnFieldCollection)) {
dataDefinition.setColumnFieldCollection(new MultiCategoryColumnFieldCollection());
}
super.populate(dataDefinition);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());

11
designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java

@ -2,6 +2,8 @@ package com.fr.van.chart.vanchart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
@ -68,6 +70,15 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependen
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof MultiCategoryColumnFieldCollection)) {
dataDefinition.setColumnFieldCollection(new MultiCategoryColumnFieldCollection());
}
super.populate(dataDefinition);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());

12
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java

@ -2,6 +2,8 @@ package com.fr.van.chart.wordcloud.designer;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.field.diff.WordCloudColumnFieldCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.WordCloudCellDataFieldsPane;
@ -115,6 +117,16 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected void populate(AbstractDataDefinition dataDefinition) {
if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof WordCloudColumnFieldCollection)){
dataDefinition.setColumnFieldCollection(new WordCloudColumnFieldCollection());
}
super.populate(dataDefinition);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new WordCloudDataSetFieldsPane(), new WordCloudCellDataFieldsPane());

Loading…
Cancel
Save