Browse Source

CHART-12733 区域显示策略 回退

research/11.0
shine 5 years ago
parent
commit
b445b57853
  1. 66
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  2. 64
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  3. 74
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

66
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -8,11 +8,11 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -20,8 +20,8 @@ import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane; import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -55,7 +55,13 @@ public class VanChartPlotLegendPane extends BasicPane {
protected UIToggleButton customFloatPositionButton; protected UIToggleButton customFloatPositionButton;
protected VanChartFloatPositionPane customFloatPositionPane; protected VanChartFloatPositionPane customFloatPositionPane;
private LimitPane limitPane; //区域显示策略 恢复用注释。下面4行删除。
protected UIButtonGroup<Integer> limitSize;
protected UISpinner maxProportion;
private UILabel limitSizeTitle;
private JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane;
//高亮显示的按钮 //高亮显示的按钮
protected UIButtonGroup<Boolean> highlightButton; protected UIButtonGroup<Boolean> highlightButton;
@ -228,8 +234,31 @@ public class VanChartPlotLegendPane extends BasicPane {
} }
protected JPanel createDisplayStrategy(){ protected JPanel createDisplayStrategy(){
limitPane = new LimitPane(false); //区域显示策略 恢复用注释。开始删除。
return limitPane; maxProportion = new UISpinner(0, 100, 1, 30);
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
limitSizeTitle = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"));
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
limitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return panel;
//区域显示策略 恢复用注释。结束删除。
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane(false);
// return limitPane;
} }
private JPanel createHighlightPane(){ private JPanel createHighlightPane(){
@ -255,8 +284,19 @@ public class VanChartPlotLegendPane extends BasicPane {
//检查显示策略界面是否可用 //检查显示策略界面是否可用
protected void checkDisplayStrategyUse() { protected void checkDisplayStrategyUse() {
GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected()); //区域显示策略 恢复用注释。下面2行删除。
limitPane.checkMaxProPortionUse(); limitSize.setEnabled(!customFloatPositionButton.isSelected());
checkMaxProPortionUse();
//区域显示策略 恢复用注释。取消注释。
// GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
// limitPane.checkMaxProPortionUse();
}
//区域显示策略 恢复用注释。删除下面方法。
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
} }
protected void checkBoxUse() { protected void checkBoxUse() {
@ -287,7 +327,11 @@ public class VanChartPlotLegendPane extends BasicPane {
legend.setPosition(-1); legend.setPosition(-1);
} }
legend.setFloating(customFloatPositionButton.isSelected()); legend.setFloating(customFloatPositionButton.isSelected());
legend.setLimitAttribute(limitPane.updateBean()); //区域显示策略 恢复用注释。下面2行删除。
legend.setLimitSize(limitSize.getSelectedIndex() == 0);
legend.setMaxHeight(maxProportion.getValue());
//区域显示策略 恢复用注释。取消注释。
//legend.setLimitAttribute(limitPane.updateBean());
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y());
if(highlightButton != null && highlightButton.getSelectedItem() != null){ if(highlightButton != null && highlightButton.getSelectedItem() != null){
@ -307,7 +351,11 @@ public class VanChartPlotLegendPane extends BasicPane {
customFloatPositionButton.setSelected(legend.isFloating()); customFloatPositionButton.setSelected(legend.isFloating());
customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX()); customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY()); customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY());
limitPane.populateBean(legend.getLimitAttribute()); //区域显示策略 恢复用注释。下面2行删除。
limitSize.setSelectedIndex(legend.isLimitSize() ? 0 : 1);
maxProportion.setValue(legend.getMaxHeight());
//区域显示策略 恢复用注释。取消注释。
//limitPane.populateBean(legend.getLimitAttribute());
if(highlightButton != null){ if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight()); highlightButton.setSelectedItem(legend.isHighlight());
} }

64
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -11,11 +11,11 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartTitle; import com.fr.plugin.chart.attr.VanChartTitle;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
@ -26,8 +26,8 @@ import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane; import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
@ -60,7 +60,12 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private UIToggleButton customFloatPositionButton; private UIToggleButton customFloatPositionButton;
private VanChartFloatPositionPane customFloatPositionPane; private VanChartFloatPositionPane customFloatPositionPane;
private LimitPane limitPane; //区域显示策略 恢复用注释。下面3行删除。
private UIButtonGroup<Integer> limitSize;
private UISpinner maxProportion;
private JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane;
protected VanChartStylePane parent; protected VanChartStylePane parent;
@ -169,8 +174,31 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
} }
private JPanel createDisplayStrategy(){ private JPanel createDisplayStrategy(){
limitPane = new LimitPane(); //区域显示策略 恢复用注释。开始删除。
return limitPane; maxProportion = new UISpinner(0, 100, 1, 30);
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
limitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
//区域显示策略 恢复用注释。结束删除。
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane();
// return limitPane;
} }
private void initPositionListener(){ private void initPositionListener(){
@ -232,10 +260,20 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
//检查显示策略界面是否可用 //检查显示策略界面是否可用
private void checkDisplayStrategyUse() { private void checkDisplayStrategyUse() {
GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected()); //区域显示策略 恢复用注释。下面2行删除。
limitPane.checkMaxProPortionUse(); limitSize.setEnabled(!customFloatPositionButton.isSelected());
checkMaxProPortionUse();
//区域显示策略 恢复用注释。取消注释。
// GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
// limitPane.checkMaxProPortionUse();
} }
//区域显示策略 恢复用注释。删除下面方法。
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
}
/** /**
* 弹出框的界面标题 * 弹出框的界面标题
@ -278,7 +316,11 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
customFloatPositionButton.setSelected(title.isFloating()); customFloatPositionButton.setSelected(title.isFloating());
customFloatPositionPane.setFloatPosition_x(title.getFloatPercentX()); customFloatPositionPane.setFloatPosition_x(title.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(title.getFloatPercentY()); customFloatPositionPane.setFloatPosition_y(title.getFloatPercentY());
limitPane.populateBean(title.getLimitAttribute()); //区域显示策略 恢复用注释。下面2行删除。
limitSize.setSelectedIndex(title.isLimitSize() ? 0 : 1);
maxProportion.setValue(title.getMaxHeight());
//区域显示策略 恢复用注释。取消注释。
//limitPane.populateBean(title.getLimitAttribute());
checkAllUse(); checkAllUse();
} }
@ -311,7 +353,11 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
} }
title.setUseHtml(useHtml.isSelected()); title.setUseHtml(useHtml.isSelected());
title.setFloating(customFloatPositionButton.isSelected()); title.setFloating(customFloatPositionButton.isSelected());
title.setLimitAttribute(limitPane.updateBean()); //区域显示策略 恢复用注释。下面2行删除。
title.setLimitSize(limitSize.getSelectedIndex() == 0);
title.setMaxHeight(maxProportion.getValue());
//区域显示策略 恢复用注释。取消注释。
//title.setLimitAttribute(limitPane.updateBean());
title.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); title.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
title.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); title.setFloatPercentY(customFloatPositionPane.getFloatPosition_y());
textAttrPane.update(textAttr); textAttrPane.update(textAttr);

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

@ -33,7 +33,6 @@ import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
@ -80,7 +79,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected UIButtonGroup<Integer> position; protected UIButtonGroup<Integer> position;
protected UIButtonGroup<Boolean> reversed; protected UIButtonGroup<Boolean> reversed;
private LimitPane limitPane; //区域显示策略 恢复用注释。下面3行删除。
protected UIButtonGroup<Integer> axisLimitSize;
protected UISpinner maxProportion;
protected JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane;
protected UIButtonGroup valueFormatStyle; protected UIButtonGroup valueFormatStyle;
protected FormatPane valueFormat; protected FormatPane valueFormat;
@ -327,8 +331,29 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
protected JPanel createDisplayStrategy(){ protected JPanel createDisplayStrategy(){
limitPane = new LimitPane(); //区域显示策略 恢复用注释。删除到return,即除了注释的代码都删除。
return limitPane; maxProportion = new UISpinner(0, 100, 1, 30);
axisLimitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), axisLimitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
axisLimitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane();
// return limitPane;
} }
protected JPanel createValueStylePane(){ protected JPanel createValueStylePane(){
@ -385,8 +410,20 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected void checkAllUse() { protected void checkAllUse() {
checkCardPane(); checkCardPane();
checkLabelPane(); checkLabelPane();
if (limitPane != null){ //区域显示策略 恢复用注释。删除下面一行。
limitPane.checkMaxProPortionUse(); checkMaxProPortionUse();
//区域显示策略 恢复用注释。取消注释。
// if (limitPane != null){
// limitPane.checkMaxProPortionUse();
// }
}
//区域显示策略 恢复用注释。删除此方法。
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
if (maxProportionPane != null && axisLimitSize != null) {
maxProportionPane.setVisible(axisLimitSize.getSelectedIndex() == 0 && axisLimitSize.isEnabled());
} }
} }
@ -553,9 +590,18 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略 //显示策略
private void populateDisplayStrategy(VanChartAxis axis) { private void populateDisplayStrategy(VanChartAxis axis) {
if (limitPane != null) { //区域显示策略 恢复用注释。下面6行删除。
limitPane.populateBean(axis.getLimitAttribute()); if (axisLimitSize != null) {
axisLimitSize.setSelectedIndex(axis.isLimitSize() ? 0 : 1);
} }
if (maxProportion != null) {
maxProportion.setValue(axis.getMaxHeight());
}
//区域显示策略 恢复用注释。取消注释。
// if (limitPane != null) {
// limitPane.populateBean(axis.getLimitAttribute());
// }
} }
//格式 //格式
@ -669,9 +715,17 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略 //显示策略
private void updateDisplayStrategy(VanChartAxis axis){ private void updateDisplayStrategy(VanChartAxis axis){
if (limitPane != null) { //区域显示策略 恢复用注释。下面6行删除。
axis.setLimitAttribute(limitPane.updateBean()); if (axisLimitSize != null) {
axis.setLimitSize(axisLimitSize.getSelectedIndex() == 0);
}
if (maxProportion != null) {
axis.setMaxHeight(maxProportion.getValue());
} }
//区域显示策略 恢复用注释。取消注释。
// if (limitPane != null) {
// axis.setLimitAttribute(limitPane.updateBean());
// }
} }
protected void updateFormat(VanChartAxis axis) { protected void updateFormat(VanChartAxis axis) {

Loading…
Cancel
Save