From 333fd8357733c51924ead06553c57077b03b9be0 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 13 Apr 2017 11:23:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E6=9C=80=E5=B0=8F=E5=80=BC=EF=BC=8C=E4=B8=8E?= =?UTF-8?q?releas=E5=88=86=E6=94=AF=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/axis/MinMaxValuePane.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 479089259..8a157f084 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/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}; } - public void addComponentListener(Component[][] components) { + protected void addComponentListener(Component[][] components) { for (int i = 0; i < components.length; i++) { - ((UICheckBox) components[i][0]).addActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - checkBoxUse(); - } - }); + addListener((UICheckBox) components[i][0]); 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() { return new Component[][]{ new Component[]{minCheckBox, minValueField}, @@ -77,7 +81,7 @@ public class MinMaxValuePane extends JPanel { }; } - protected void checkBoxUse() { + private void checkBoxUse() { minValueField.setEnabled(minCheckBox.isSelected()); maxValueField.setEnabled(maxCheckBox.isSelected()); @@ -108,7 +112,7 @@ public class MinMaxValuePane extends JPanel { if(axis.getMinValue() != null) { minValueField.setText(axis.getMinValue().toString()); } - } + } // 最大值 if (axis.isCustomMaxValue()) { @@ -116,7 +120,7 @@ public class MinMaxValuePane extends JPanel { if(axis.getMaxValue() != null) { maxValueField.setText(axis.getMaxValue().toString()); } - } + } // 主次刻度单位 if (axis.isCustomMainUnit()) { @@ -124,7 +128,7 @@ public class MinMaxValuePane extends JPanel { if(axis.getMainUnit() != null) { mainUnitField.setText(axis.getMainUnit().toString()); } - } + } if(axis.isCustomSecUnit()) { isCustomSecUnitBox.setSelected(true);