Browse Source

REPORT-68886 design fix:fvs.cpt.chart 不支持主题 isThemed一直等于false

bugfix/11.0
shine 3 years ago
parent
commit
356d7f203b
  1. 35
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataHelper.java
  2. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  3. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  4. 26
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  5. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java
  6. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

35
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataHelper.java

@ -0,0 +1,35 @@
package com.fr.design.mainframe.chart.gui.data;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
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.config.DefaultStyleHelper4Van;
/**
* @author shine
* @version 10.0
* Created by shine on 2022/4/6
*/
public class ChartDataHelper {
/**
* 在update数据集分类的时候需要联动update一下样式-坐标轴里面的分层样式设置,来自CHART-22873
*/
public static void updateAxisCategoryStyles(ChartCollection chartCollection) {
TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition();
int size = definition == null ? 1 : definition.getMoreCateSize() + 1;
Plot plot = chartCollection.getSelectedChart().getPlot();
if (plot instanceof VanChartAxisPlot) {
for (VanChartAxis axis : ((VanChartAxisPlot) plot).getXAxisList()) {
axis.clearCategoryStyles();
for (int i = 0; i < size; i++) {
axis.addCategoryStyle(DefaultStyleHelper4Van.dealAxisCheckTheme(new VanChartAxisLabelStyle()));
}
}
}
}
}

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

@ -13,6 +13,7 @@ import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataHelper;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -193,7 +194,7 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
reportDefinition.clearMoreCate();
updateMoreCate(reportDefinition, plot);
collection.updateAxisCategoryStyles();
ChartDataHelper.updateAxisCategoryStyles(collection);
}
}

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

@ -13,6 +13,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
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.mainframe.chart.gui.data.ChartDataHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
@ -246,7 +247,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
normal.clearMoreCate();
updateMoreCate(normal, plot);
}
collection.updateAxisCategoryStyles();
ChartDataHelper.updateAxisCategoryStyles(collection);
}
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {

26
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java

@ -5,6 +5,7 @@ import com.fr.base.ChartPreStyleConfig;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.ChartThemeStyleProvider;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.DataSheet;
@ -14,6 +15,7 @@ import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.AttrLabel;
@ -24,6 +26,9 @@ import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.plugin.chart.vanchart.VanChart;
import java.util.ArrayList;
import java.util.List;
/**
* @author shine
* @version 10.0
@ -82,7 +87,28 @@ public class DefaultStyleHelper4Van {
}
private static void dealAxisCheckTheme(VanChartAxis axis) {
if (!ChartEditContext.supportTheme()) {
List<ChartThemeStyleProvider> chartThemeStyleProviders = new ArrayList<>();
VanChartRectanglePlot.getAxisChartPreStyleProvider(axis, chartThemeStyleProviders);
for (ChartThemeStyleProvider themeStyleProvider : chartThemeStyleProviders) {
themeStyleProvider.setThemeCustom();
}
}
}
public static VanChartAxisLabelStyle dealAxisCheckTheme(VanChartAxisLabelStyle labelStyle) {
if (!ChartEditContext.supportTheme()) {
labelStyle.getTextAttr().setThemeCustom();
}
return labelStyle;
}
public static VanChartAxis dealAxisDefault(VanChartAxis axis) {
dealAxisCheckTheme(axis);
if (!duchampMode()) {
return axis;
}

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java

@ -13,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.component.AxisLabelDisplayComboBox;
@ -125,6 +126,7 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane<VanChartAxisLabe
@Override
public VanChartAxisLabelStyle updateBean() {
VanChartAxisLabelStyle style = new VanChartAxisLabelStyle();
DefaultStyleHelper4Van.dealAxisCheckTheme(style);
style.setLabelDisplay(labelDisplayComboBox.updateBean());
TextAttr textAttr = style.getTextAttr();
labelTextAttrPane.update(textAttr);

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -32,6 +32,7 @@ import com.fr.plugin.chart.type.AxisTickLineType;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
@ -607,6 +608,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
private VanChartAxisLabelStyle getAxisLabelStyle(VanChartAxis axis) {
VanChartAxisLabelStyle style = new VanChartAxisLabelStyle();
DefaultStyleHelper4Van.dealAxisCheckTheme(style);
style.setLabelDisplay(axis.getLabelDisplay());
style.setTextAttr(axis.getTextAttr());
style.setAutoLabelGap(axis.isAutoLabelGap());
@ -663,6 +665,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
style = axis.getCategoryStyle(index);
} else {
style = new VanChartAxisLabelStyle();
DefaultStyleHelper4Van.dealAxisCheckTheme(style);
axis.addCategoryStyle(style);
}
return style;

Loading…
Cancel
Save