Browse Source

CHART-10225 显示策略 属性兼容

research/11.0
zheng 5 years ago
parent
commit
d4cf35db8f
  1. 48
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  2. 19
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java
  3. 45
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  4. 48
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  5. 85
      designer-chart/src/main/java/com/fr/van/chart/designer/style/component/LimitPane.java

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

@ -8,12 +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;
@ -21,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,11 +54,8 @@ public class VanChartPlotLegendPane extends BasicPane {
protected UIButtonGroup<Integer> location; protected UIButtonGroup<Integer> location;
protected UIToggleButton customFloatPositionButton; protected UIToggleButton customFloatPositionButton;
protected VanChartFloatPositionPane customFloatPositionPane; protected VanChartFloatPositionPane customFloatPositionPane;
protected UIButtonGroup<Integer> limitSize;
protected UISpinner maxProportion;
private UILabel limitSizeTitle;
private JPanel maxProportionPane;
private LimitPane limitPane;
//高亮显示的按钮 //高亮显示的按钮
protected UIButtonGroup<Boolean> highlightButton; protected UIButtonGroup<Boolean> highlightButton;
@ -232,25 +228,8 @@ public class VanChartPlotLegendPane extends BasicPane {
} }
protected JPanel createDisplayStrategy(){ protected JPanel createDisplayStrategy(){
maxProportion = new UISpinner(0,100,1,30); limitPane = new LimitPane(false);
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")}); return limitPane;
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;
} }
private JPanel createHighlightPane(){ private JPanel createHighlightPane(){
@ -276,15 +255,8 @@ public class VanChartPlotLegendPane extends BasicPane {
//检查显示策略界面是否可用 //检查显示策略界面是否可用
protected void checkDisplayStrategyUse() { protected void checkDisplayStrategyUse() {
limitSize.setEnabled(!customFloatPositionButton.isSelected()); GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
checkMaxProPortionUse(); 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() {
@ -315,8 +287,7 @@ public class VanChartPlotLegendPane extends BasicPane {
legend.setPosition(-1); legend.setPosition(-1);
} }
legend.setFloating(customFloatPositionButton.isSelected()); legend.setFloating(customFloatPositionButton.isSelected());
legend.setLimitSize(limitSize.getSelectedIndex() == 0); legend.setLimitAttribute(limitPane.updateBean());
legend.setMaxHeight(maxProportion.getValue());
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){
@ -336,8 +307,7 @@ 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());
limitSize.setSelectedIndex(legend.isLimitSize() ? 0 : 1); limitPane.populateBean(legend.getLimitAttribute());
maxProportion.setValue(legend.getMaxHeight());
if(highlightButton != null){ if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight()); highlightButton.setSelectedItem(legend.isHighlight());
} }

19
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java

@ -192,26 +192,13 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane {
public void populateBean(VanChartLegend legend) { public void populateBean(VanChartLegend legend) {
VanChartRangeLegend scatterLegend = (VanChartRangeLegend)legend; VanChartRangeLegend scatterLegend = (VanChartRangeLegend)legend;
if (scatterLegend != null) { if (scatterLegend != null) {
isLegendVisible.setSelected(scatterLegend.isLegendVisible());
textAttrPane.populate(scatterLegend.getFRFont()); super.populateBean(scatterLegend);
borderPane.populate(scatterLegend);
backgroundPane.populate(scatterLegend);
if(!scatterLegend.isFloating()){
location.setSelectedItem(scatterLegend.getPosition());
}
customFloatPositionButton.setSelected(scatterLegend.isFloating());
customFloatPositionPane.setFloatPosition_x(scatterLegend.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(scatterLegend.getFloatPercentY());
limitSize.setSelectedIndex(scatterLegend.isLimitSize() ? 0 : 1);
maxProportion.setValue(scatterLegend.getMaxHeight());
//范围图例部分 //范围图例部分
legendTypeButton.setSelectedItem(scatterLegend.getLegendType()); legendTypeButton.setSelectedItem(scatterLegend.getLegendType());
gradualLegendPane.populate(scatterLegend.getGradualLegend()); gradualLegendPane.populate(scatterLegend.getGradualLegend());
sectionLegendPane.populate(scatterLegend.getSectionLegend()); sectionLegendPane.populate(scatterLegend.getSectionLegend());
if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight());
}
} }
checkAllUse(); checkAllUse();
this.checkHighlightVisible(); this.checkHighlightVisible();

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

@ -11,12 +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;
@ -27,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,9 +59,8 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private UIToggleButton useHtml; private UIToggleButton useHtml;
private UIToggleButton customFloatPositionButton; private UIToggleButton customFloatPositionButton;
private VanChartFloatPositionPane customFloatPositionPane; private VanChartFloatPositionPane customFloatPositionPane;
private UIButtonGroup<Integer> limitSize;
private UISpinner maxProportion; private LimitPane limitPane;
private JPanel maxProportionPane;
protected VanChartStylePane parent; protected VanChartStylePane parent;
@ -171,24 +169,8 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
} }
private JPanel createDisplayStrategy(){ private JPanel createDisplayStrategy(){
maxProportion = new UISpinner(0,100,1,30); limitPane = new LimitPane();
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")}); return limitPane;
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);
} }
private void initPositionListener(){ private void initPositionListener(){
@ -250,15 +232,10 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
//检查显示策略界面是否可用 //检查显示策略界面是否可用
private void checkDisplayStrategyUse() { private void checkDisplayStrategyUse() {
limitSize.setEnabled(!customFloatPositionButton.isSelected()); GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
checkMaxProPortionUse(); limitPane.checkMaxProPortionUse();
} }
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
}
/** /**
* 弹出框的界面标题 * 弹出框的界面标题
@ -301,8 +278,7 @@ 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());
limitSize.setSelectedIndex(title.isLimitSize() ? 0 : 1); limitPane.populateBean(title.getLimitAttribute());
maxProportion.setValue(title.getMaxHeight());
checkAllUse(); checkAllUse();
} }
@ -335,8 +311,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
} }
title.setUseHtml(useHtml.isSelected()); title.setUseHtml(useHtml.isSelected());
title.setFloating(customFloatPositionButton.isSelected()); title.setFloating(customFloatPositionButton.isSelected());
title.setLimitSize(limitSize.getSelectedIndex() == 0); title.setLimitAttribute(limitPane.updateBean());
title.setMaxHeight(maxProportion.getValue());
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);

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

@ -12,7 +12,6 @@ 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.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
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.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.style.FormatPane; import com.fr.design.gui.style.FormatPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -31,6 +30,7 @@ import com.fr.stable.StableUtils;
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;
@ -71,9 +71,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected UIButtonGroup<Integer> position; protected UIButtonGroup<Integer> position;
protected UIButtonGroup<Boolean> reversed; protected UIButtonGroup<Boolean> reversed;
protected UIButtonGroup<Integer> axisLimitSize; private LimitPane limitPane;
protected UISpinner maxProportion;
protected JPanel maxProportionPane;
protected UIButtonGroup valueFormatStyle; protected UIButtonGroup valueFormatStyle;
protected FormatPane valueFormat; protected FormatPane valueFormat;
@ -286,24 +284,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
protected JPanel createDisplayStrategy(double[] row, double[] col){ protected JPanel createDisplayStrategy(double[] row, double[] col){
maxProportion = new UISpinner(0,100,1,30); limitPane = new LimitPane();
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")}); return limitPane;
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);
} }
protected JPanel createValueStylePane(){ protected JPanel createValueStylePane(){
@ -360,7 +342,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected void checkAllUse() { protected void checkAllUse() {
checkCardPane(); checkCardPane();
checkLabelPane(); checkLabelPane();
checkMaxProPortionUse();
} }
protected void checkCardPane() { protected void checkCardPane() {
@ -392,12 +373,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
} }
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
if(maxProportionPane != null && axisLimitSize != null){
maxProportionPane.setVisible(axisLimitSize.getSelectedIndex() == 0 && axisLimitSize.isEnabled());
}
}
/** /**
* 是否是指定类型 * 是否是指定类型
@ -516,13 +491,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略 //显示策略
private void populateDisplayStrategy(VanChartAxis axis) { private void populateDisplayStrategy(VanChartAxis axis) {
if(axisLimitSize != null){ if (limitPane != null) {
axisLimitSize.setSelectedIndex(axis.isLimitSize() ? 0 : 1); limitPane.populateBean(axis.getLimitAttribute());
} }
if(maxProportion != null){
maxProportion.setValue(axis.getMaxHeight());
}
} }
//格式 //格式
@ -637,11 +608,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略 //显示策略
private void updateDisplayStrategy(VanChartAxis axis){ private void updateDisplayStrategy(VanChartAxis axis){
if(axisLimitSize != null){ if (limitPane != null) {
axis.setLimitSize(axisLimitSize.getSelectedIndex() == 0); axis.setLimitAttribute(limitPane.updateBean());
}
if(maxProportion != null){
axis.setMaxHeight(maxProportion.getValue());
} }
} }

85
designer-chart/src/main/java/com/fr/van/chart/designer/style/component/LimitPane.java

@ -0,0 +1,85 @@
package com.fr.van.chart.designer.style.component;
import com.fr.chartx.attr.LimitAttribute;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by shine on 2019/08/28.
*/
public class LimitPane extends BasicBeanPane<LimitAttribute> {
private UIButtonGroup<Boolean> autoCustomTypeGroup;
private UISpinner maxProportion;
private JPanel maxProportionPane;
public LimitPane() {
this(true);
}
public LimitPane(boolean hasTitle) {
initComponent(hasTitle);
}
private void initComponent(boolean hasTitle) {
maxProportion = new UISpinner(0, 100, 1, 30);
autoCustomTypeGroup = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto")
, Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")}, new Boolean[]{true, false});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), autoCustomTypeGroup);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(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);
autoCustomTypeGroup.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
this.setLayout(new BorderLayout());
if (hasTitle) {
JPanel contentPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
this.add(contentPane);
} else {
this.add(panel);
}
}
//检查最大显示占比是否可用
public void checkMaxProPortionUse() {
maxProportion.setVisible(!autoCustomTypeGroup.getSelectedItem() && autoCustomTypeGroup.isEnabled());
maxProportionPane.setVisible(!autoCustomTypeGroup.getSelectedItem() && autoCustomTypeGroup.isEnabled());
}
@Override
public void populateBean(LimitAttribute ob) {
autoCustomTypeGroup.setSelectedItem(ob.isAuto());
maxProportion.setValue(ob.getMaxSize());
}
@Override
public LimitAttribute updateBean() {
LimitAttribute attribute = new LimitAttribute();
attribute.setAuto(autoCustomTypeGroup.getSelectedItem());
attribute.setMaxSize(maxProportion.getValue());
return attribute;
}
@Override
protected String title4PopupWindow() {
return null;
}
}
Loading…
Cancel
Save