X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosConfigPyroUI.java;h=69b31ff52529e1831b59ba54ab57281060b7eb34;hp=61208dfe91676a81acfdc1b0f317d9e48d53a6a6;hb=3e5e9333420ede74d998556c1bbd5888e8ff75ae;hpb=3fbf0a29a1b8a67b90ef965ee3e2e972c0ec33a1 diff --git a/altosui/AltosConfigPyroUI.java b/altosui/AltosConfigPyroUI.java index 61208dfe..69b31ff5 100644 --- a/altosui/AltosConfigPyroUI.java +++ b/altosui/AltosConfigPyroUI.java @@ -17,6 +17,7 @@ package altosui; +import java.text.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; @@ -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); } }