diff options
author | Bdale Garbee <bdale@gag.com> | 2015-07-16 13:31:42 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2015-07-16 13:31:42 -0600 |
commit | 6e9bb9178356620bd47d9f2e31abf42b7f1a8f11 (patch) | |
tree | 6f04b5500462d1f6e26ebcba58c5e9cd56afd442 /altosui/AltosConfigPyroUI.java | |
parent | e2cefd8593d269ce603aaf33f4a53a5c2dcb3350 (diff) | |
parent | 87c8bb3956897830da1f7aaca2990a9571767b73 (diff) |
Merge branch 'master' into branch-1.6
Diffstat (limited to 'altosui/AltosConfigPyroUI.java')
-rw-r--r-- | altosui/AltosConfigPyroUI.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/altosui/AltosConfigPyroUI.java b/altosui/AltosConfigPyroUI.java index 61208dfe..50a25f00 100644 --- a/altosui/AltosConfigPyroUI.java +++ b/altosui/AltosConfigPyroUI.java @@ -17,12 +17,13 @@ package altosui; +import java.text.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; -import org.altusmetrum.altoslib_6.*; -import org.altusmetrum.altosuilib_6.*; +import org.altusmetrum.altoslib_8.*; +import org.altusmetrum.altosuilib_8.*; public class AltosConfigPyroUI extends AltosUIDialog @@ -87,9 +88,9 @@ public class AltosConfigPyroUI if (units != null) { try { - double v = units.parse(value.getText(), !imperial_units); + double v = units.parse_locale(value.getText(), !imperial_units); set(enabled(), v); - } catch (NumberFormatException ne) { + } catch (ParseException pe) { set(enabled(), 0.0); } } @@ -129,9 +130,9 @@ public class AltosConfigPyroUI AltosUnits units = AltosPyro.pyro_to_units(flag); try { if (units != null) - return units.parse(value.getText()); - return Double.parseDouble(value.getText()); - } catch (NumberFormatException e) { + return units.parse_locale(value.getText()); + return AltosParse.parse_double_locale(value.getText()); + } catch (ParseException e) { throw new AltosConfigDataException("\"%s\": %s\n", value.getText(), e.getMessage()); } } @@ -298,8 +299,8 @@ public class AltosConfigPyroUI String v = pyro_firing_time_value.getSelectedItem().toString(); try { - return Double.parseDouble(v); - } catch (NumberFormatException e) { + return AltosParse.parse_double_locale(v); + } catch (ParseException e) { throw new AltosConfigDataException("Invalid pyro firing time \"%s\"", v); } } |