Browse Source

CHART-22873 将更新分类样式的代码放到ChartCollection中

feature/x
方磊 3 years ago
parent
commit
d3edad6a17
  1. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  2. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  3. 26
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPaneHelper.java

3
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -15,7 +15,6 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.VanChartAxisPaneHelper;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
@ -194,7 +193,7 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
reportDefinition.clearMoreCate();
updateMoreCate(reportDefinition, plot);
}
VanChartAxisPaneHelper.updateAxisCategoryStyles(collection);
collection.updateAxisCategoryStyles();
}
protected void updateMoreCate(NormalReportDataDefinition reportDefinition, Plot plot) {

3
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

@ -14,7 +14,6 @@ import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.van.chart.designer.style.axis.VanChartAxisPaneHelper;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
@ -247,7 +246,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
normal.clearMoreCate();
updateMoreCate(normal, plot);
}
VanChartAxisPaneHelper.updateAxisCategoryStyles(collection);
collection.updateAxisCategoryStyles();
}
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {

26
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPaneHelper.java

@ -1,15 +1,9 @@
package com.fr.van.chart.designer.style.axis;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
@ -33,24 +27,4 @@ public class VanChartAxisPaneHelper {
}
};
}
/**
* 在update数据集分类的时候需要联动update一下样式-坐标轴里面的分层样式设置,来自CHART-22873
*
* @param collection
*/
public static void updateAxisCategoryStyles(ChartCollection collection) {
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
int size = definition == null ? 1 : definition.getMoreCateSize() + 1;
Plot plot = collection.getSelectedChart().getPlot();
if (plot instanceof VanChartAxisPlot) {
for(VanChartAxis axis : ((VanChartAxisPlot) plot).getXAxisList()){
axis.clearCategoryStyles();
for (int i = 0; i < size; i++) {
axis.addCategoryStyle(new VanChartAxisLabelStyle());
}
}
}
}
}

Loading…
Cancel
Save