X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosuilib%2FAltosUIMapPreload.java;fp=altosuilib%2FAltosUIMapPreload.java;h=1973ae6ecd04c5c7ed22006c4099cf4bc9456ea3;hp=e82b6c60880c1d0b1dcde0d4f4a7cc749fb2d977;hb=3e5e9333420ede74d998556c1bbd5888e8ff75ae;hpb=3fbf0a29a1b8a67b90ef965ee3e2e972c0ec33a1 diff --git a/altosuilib/AltosUIMapPreload.java b/altosuilib/AltosUIMapPreload.java index e82b6c60..1973ae6e 100644 --- a/altosuilib/AltosUIMapPreload.java +++ b/altosuilib/AltosUIMapPreload.java @@ -53,33 +53,33 @@ class AltosUIMapPos extends Box { hemi.setSelectedIndex(h); } - public double get_value() throws NumberFormatException { + public double get_value() throws ParseException { int h = hemi.getSelectedIndex(); String d_t = deg.getText(); String m_t = min.getText(); double d, m, v; try { - d = Double.parseDouble(d_t); - } catch (NumberFormatException ne) { + d = AltosParse.parse_double_locale(d_t); + } catch (ParseException pe) { JOptionPane.showMessageDialog(owner, String.format("Invalid degrees \"%s\"", d_t), "Invalid number", JOptionPane.ERROR_MESSAGE); - throw ne; + throw pe; } try { if (m_t.equals("")) m = 0; else - m = Double.parseDouble(m_t); - } catch (NumberFormatException ne) { + m = AltosParse.parse_double_locale(m_t); + } catch (ParseException pe) { JOptionPane.showMessageDialog(owner, String.format("Invalid minutes \"%s\"", m_t), "Invalid number", JOptionPane.ERROR_MESSAGE); - throw ne; + throw pe; } v = d + m/60.0; if (h == 1) @@ -142,9 +142,9 @@ class AltosUISite { name = elements[0]; try { - latitude = Double.parseDouble(elements[1]); - longitude = Double.parseDouble(elements[2]); - } catch (NumberFormatException ne) { + latitude = AltosParse.parse_double_net(elements[1]); + longitude = AltosParse.parse_double_net(elements[2]); + } catch (ParseException pe) { throw new ParseException(String.format("Invalid site line %s", line), 0); } } @@ -171,6 +171,7 @@ class AltosUISites extends Thread { try { add(new AltosUISite(line)); } catch (ParseException pe) { + System.out.printf("parse exception %s\n", pe.toString()); } } @@ -394,7 +395,7 @@ public class AltosUIMapPreload extends AltosUIFrame implements ActionListener, I max_z = min_z; r = (Integer) radius.getSelectedItem(); loading = true; - } catch (NumberFormatException ne) { + } catch (ParseException pe) { load_button.setSelected(false); } start_load();