* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altosuilib_2;
+package org.altusmetrum.altosuilib_7;
import java.awt.*;
import java.awt.event.*;
import java.lang.Math;
import java.net.URL;
import java.net.URLConnection;
-import org.altusmetrum.altoslib_4.*;
+import org.altusmetrum.altoslib_7.*;
class AltosUIMapPos extends Box {
AltosUIFrame owner;
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)
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);
}
}
try {
add(new AltosUISite(line));
} catch (ParseException pe) {
+ System.out.printf("parse exception %s\n", pe.toString());
}
}
/* AltosUIMapTileListener methods */
- public void notify_tile(AltosUIMapTile tile, int status) {
+ public synchronized void notify_tile(AltosUIMapTile tile, int status) {
if (status == AltosUIMapStore.loading)
return;
max_z = min_z;
r = (Integer) radius.getSelectedItem();
loading = true;
- } catch (NumberFormatException ne) {
+ } catch (ParseException pe) {
load_button.setSelected(false);
}
start_load();
}
public AltosUIMapPreload(AltosUIFrame in_owner) {
- System.out.printf("start creating preload ui\n");
-
owner = in_owner;
Container pane = getContentPane();
pack();
setLocationRelativeTo(owner);
setVisible(true);
-
- System.out.printf("done creating preload ui\n");
}
}