Browse Source

Pull request #5798: CHART-20674 分类轴切换不影响网格线

Merge in DESIGN/design from ~BJORN/design:release/11.0 to release/11.0

* commit 'b3413bb3f055ef9928bc995c31ca0e38f26aaf39':
  CHART-20674 分类轴切换不影响网格线
persist/11.0
Bjorn 3 years ago
parent
commit
972dfa51ae
  1. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java

@ -1,9 +1,10 @@
package com.fr.van.chart.designer.style.axis; package com.fr.van.chart.designer.style.axis;
import com.fr.chart.base.ColorWithThemeStyle;
import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Axis;
import com.fr.design.i18n.Toolkit;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
@ -16,9 +17,9 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.awt.BorderLayout;
/** /**
* 带有坐标轴类型选择控件可选类型分类时间数值 * 带有坐标轴类型选择控件可选类型分类时间数值
@ -98,11 +99,13 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
public VanChartAxis update(VanChartAxis axis) { public VanChartAxis update(VanChartAxis axis) {
int index = axisTypePane.getSelectedIndex(); int index = axisTypePane.getSelectedIndex();
ColorWithThemeStyle mainGridColorWithPreStyle = axis.getMainGridColorWithPreStyle();
if(ComparatorUtils.equals(index, AxisType.AXIS_CATEGORY.ordinal())){ if(ComparatorUtils.equals(index, AxisType.AXIS_CATEGORY.ordinal())){
if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)){ if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)){
textAxisPane.updateBean(axis); textAxisPane.updateBean(axis);
} else { } else {
axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor());
axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle);
textAxisPane.updateBean(axis); textAxisPane.updateBean(axis);
} }
} else if(ComparatorUtils.equals(index, AxisType.AXIS_TIME.ordinal())){ } else if(ComparatorUtils.equals(index, AxisType.AXIS_TIME.ordinal())){
@ -110,6 +113,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
timeAxisPane.updateBean(axis); timeAxisPane.updateBean(axis);
} else { } else {
axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor());
axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle);
timeAxisPane.updateBean(axis); timeAxisPane.updateBean(axis);
} }
} else if(ComparatorUtils.equals(index, AxisType.AXIS_VALUE.ordinal())){ } else if(ComparatorUtils.equals(index, AxisType.AXIS_VALUE.ordinal())){
@ -117,6 +121,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
valueAxisPane.updateBean(axis); valueAxisPane.updateBean(axis);
} else { } else {
axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor());
axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle);
valueAxisPane.updateBean(axis); valueAxisPane.updateBean(axis);
} }
} }

Loading…
Cancel
Save