Browse Source

CHART-11810 类型切换时对数据配置的处理

persist/11.0
白岳 5 years ago
parent
commit
c9f5f9762a
  1. 6
      designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java
  2. 8
      designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java
  3. 8
      designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java
  4. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

6
designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java

@ -7,9 +7,9 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.AssistUtils;
import java.awt.BorderLayout;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.awt.BorderLayout;
/**
* Created by shine on 2019/4/15.
@ -45,9 +45,7 @@ public abstract class AbstractChartDataPane<T extends ChartDataDefinitionProvide
ChartDataDefinitionProvider dataSetCollection = vanChart.getChartDataDefinition();
if (isMatchedDataType(dataSetCollection)) {
populate((T) dataSetCollection);
}
populate((T) dataSetCollection);
this.initAllListeners();
this.validate();

8
designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java

@ -4,11 +4,8 @@ import com.fr.chartx.data.CellDataDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chartx.fields.AbstractCellDataFieldsPane;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.AssistUtils;
import java.awt.BorderLayout;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
/**
* Created by shine on 2019/5/21.
@ -51,10 +48,7 @@ public class CellDataPane extends FurtherBasicBeanPane<CellDataDefinition> {
return;
}
Type dataType = ((ParameterizedType) cellDataFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
if (AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) {
cellDataFieldsPane.populateBean(ob.getColumnFieldCollection());
}
cellDataFieldsPane.populateBean(ob.getColumnFieldCollection());
}
@Override

8
designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java

@ -11,10 +11,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.stable.AssistUtils;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Dimension;
@ -109,11 +106,8 @@ public class DataSetPane extends FurtherBasicBeanPane<DataSetDefinition> {
checkBoxUse();
tableDataPane.populateBean(ob.getNameTableData());
Type dataType = ((ParameterizedType) dataSetFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
if (AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) {
dataSetFieldsPane.populateBean(ob.getColumnFieldCollection());
}
dataSetFieldsPane.populateBean(ob.getColumnFieldCollection());
}
@Override

4
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -107,6 +107,10 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Cha
newPlot.setCategoryNum(oldPlot.getCategoryNum());
}
if(chart instanceof VanChart
&& oldPlot.getDefinitionType()!=newPlot.getDefinitionType()) {
((VanChart) chart).setChartDataDefinition(null);
}
}
protected void resetChartAttr4SamePlot(Chart chart){

Loading…
Cancel
Save