Browse Source

分两行显示checkbox和输入框,适应国际化情况。

master
mengao 8 years ago
parent
commit
7f7841b803
  1. 19
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

19
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

@ -42,14 +42,14 @@ public class MinMaxValuePane extends JPanel {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { p, f }; double[] columnSize = { p, f };
double[] rowSize = { p, p, p, p}; double[] rowSize = { p, p, p, p, p, p, p, p};
Component[][] components = getPanelComponents(); Component[][] components = getPanelComponents();
JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
for(int i = 0; i < components.length; i++) { for(int i = 0; i < components.length; i+=2) {
((UICheckBox)components[i][0]).addActionListener(new ActionListener() { ((UICheckBox)components[i][0]).addActionListener(new ActionListener() {
@Override @Override
@ -57,16 +57,19 @@ public class MinMaxValuePane extends JPanel {
checkBoxUse(); checkBoxUse();
} }
}); });
ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i+1][0]);
} }
} }
protected Component[][] getPanelComponents() { protected Component[][] getPanelComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{minCheckBox, minValueField}, new Component[]{minCheckBox},
new Component[]{maxCheckBox, maxValueField}, new Component[]{minValueField},
new Component[]{isCustomMainUnitBox, mainUnitField}, new Component[]{maxCheckBox},
new Component[]{isCustomSecUnitBox, secUnitField}, new Component[]{maxValueField},
new Component[]{isCustomMainUnitBox},
new Component[]{mainUnitField},
new Component[]{isCustomSecUnitBox},
new Component[]{secUnitField},
}; };
} }

Loading…
Cancel
Save