Browse Source

修改设计器最大最小值,与releas分支同步

master
mengao 8 years ago
parent
commit
333fd83577
  1. 28
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

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

@ -55,19 +55,23 @@ public class MinMaxValuePane extends JPanel {
return new double[]{p, p, p, p}; return new double[]{p, p, p, p};
} }
public void addComponentListener(Component[][] components) { protected void addComponentListener(Component[][] components) {
for (int i = 0; i < components.length; i++) { for (int i = 0; i < components.length; i++) {
((UICheckBox) components[i][0]).addActionListener(new ActionListener() { addListener((UICheckBox) components[i][0]);
@Override
public void actionPerformed(ActionEvent e) {
checkBoxUse();
}
});
ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]);
} }
} }
protected void addListener(UICheckBox checkBox) {
checkBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkBoxUse();
}
});
}
protected Component[][] getPanelComponents() { protected Component[][] getPanelComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{minCheckBox, minValueField}, new Component[]{minCheckBox, minValueField},
@ -77,7 +81,7 @@ public class MinMaxValuePane extends JPanel {
}; };
} }
protected void checkBoxUse() { private void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected()); minValueField.setEnabled(minCheckBox.isSelected());
maxValueField.setEnabled(maxCheckBox.isSelected()); maxValueField.setEnabled(maxCheckBox.isSelected());
@ -108,7 +112,7 @@ public class MinMaxValuePane extends JPanel {
if(axis.getMinValue() != null) { if(axis.getMinValue() != null) {
minValueField.setText(axis.getMinValue().toString()); minValueField.setText(axis.getMinValue().toString());
} }
} }
// 最大值 // 最大值
if (axis.isCustomMaxValue()) { if (axis.isCustomMaxValue()) {
@ -116,7 +120,7 @@ public class MinMaxValuePane extends JPanel {
if(axis.getMaxValue() != null) { if(axis.getMaxValue() != null) {
maxValueField.setText(axis.getMaxValue().toString()); maxValueField.setText(axis.getMaxValue().toString());
} }
} }
// 主次刻度单位 // 主次刻度单位
if (axis.isCustomMainUnit()) { if (axis.isCustomMainUnit()) {
@ -124,7 +128,7 @@ public class MinMaxValuePane extends JPanel {
if(axis.getMainUnit() != null) { if(axis.getMainUnit() != null) {
mainUnitField.setText(axis.getMainUnit().toString()); mainUnitField.setText(axis.getMainUnit().toString());
} }
} }
if(axis.isCustomSecUnit()) { if(axis.isCustomSecUnit()) {
isCustomSecUnitBox.setSelected(true); isCustomSecUnitBox.setSelected(true);

Loading…
Cancel
Save