projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bump java library versions
[fw/altos]
/
altosuilib
/
AltosUIMapPreloadNew.java
diff --git
a/altosuilib/AltosUIMapPreloadNew.java
b/altosuilib/AltosUIMapPreloadNew.java
index d6c257e0750e9ddfd38f52aada93e09cc52b5739..b16659da5b79f6fb1854dde89cef1d50cec503ab 100644
(file)
--- a/
altosuilib/AltosUIMapPreloadNew.java
+++ b/
altosuilib/AltosUIMapPreloadNew.java
@@
-15,7
+15,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altosuilib_1
0
;
+package org.altusmetrum.altosuilib_1
1
;
import java.awt.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.event.*;
@@
-26,7
+26,7
@@
import java.text.*;
import java.lang.Math;
import java.net.URL;
import java.net.URLConnection;
import java.lang.Math;
import java.net.URL;
import java.net.URLConnection;
-import org.altusmetrum.altoslib_1
0
.*;
+import org.altusmetrum.altoslib_1
1
.*;
class AltosUIMapPos extends Box {
AltosUIFrame owner;
class AltosUIMapPos extends Box {
AltosUIFrame owner;
@@
-131,7
+131,6
@@
public class AltosUIMapPreloadNew extends AltosUIFrame implements ActionListener
JComboBox<AltosLaunchSite> site_list;
JToggleButton load_button;
JComboBox<AltosLaunchSite> site_list;
JToggleButton load_button;
- boolean loading;
JButton close_button;
JCheckBox[] maptypes = new JCheckBox[AltosMap.maptype_terrain - AltosMap.maptype_hybrid + 1];
JButton close_button;
JCheckBox[] maptypes = new JCheckBox[AltosMap.maptype_terrain - AltosMap.maptype_hybrid + 1];
@@
-139,6
+138,7
@@
public class AltosUIMapPreloadNew extends AltosUIFrame implements ActionListener
JComboBox<Integer> min_zoom;
JComboBox<Integer> max_zoom;
JComboBox<Double> radius;
JComboBox<Integer> min_zoom;
JComboBox<Integer> max_zoom;
JComboBox<Double> radius;
+ int scale = 1;
Integer[] zooms = { -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6 };
Integer[] zooms = { -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6 };
@@
-147,6
+147,7
@@
public class AltosUIMapPreloadNew extends AltosUIFrame implements ActionListener
Double[] radius_km = { 2.0, 5.0, 10.0, 20.0, 30.0 };
Double radius_def_km = 10.0;
Double[] radius_km = { 2.0, 5.0, 10.0, 20.0, 30.0 };
Double radius_def_km = 10.0;
+ AltosMapLoader loader;
static final String[] lat_hemi_names = { "N", "S" };
static final String[] lon_hemi_names = { "E", "W" };
static final String[] lat_hemi_names = { "N", "S" };
static final String[] lon_hemi_names = { "E", "W" };
@@
-187,12
+188,12
@@
public class AltosUIMapPreloadNew extends AltosUIFrame implements ActionListener
}
public void loader_done(int max) {
}
public void loader_done(int max) {
+ loader = null;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
pbar.setValue(0);
pbar.setString("");
load_button.setSelected(false);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
pbar.setValue(0);
pbar.setString("");
load_button.setSelected(false);
- loading = false;
}
});
}
}
});
}
@@
-227,11
+228,14
@@
public class AltosUIMapPreloadNew extends AltosUIFrame implements ActionListener
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
- if (cmd.equals("close"))
+ if (cmd.equals("close")) {
+ if (loader != null)
+ loader.abort();
setVisible(false);
setVisible(false);
+ }
if (cmd.equals("load")) {
if (cmd.equals("load")) {
- if (
!loading
) {
+ if (
loader == null
) {
try {
latitude = lat.get_value();
longitude = lon.get_value();
try {
latitude = lat.get_value();
longitude = lon.get_value();
@@
-245,11
+249,13
@@
public class AltosUIMapPreloadNew extends AltosUIFrame implements ActionListener
r = AltosConvert.miles_to_meters(r);
else
r = r * 1000;
r = AltosConvert.miles_to_meters(r);
else
r = r * 1000;
- loading = true;
- new AltosMapLoader(map.map, this,
- latitude, longitude,
- min_z, max_z, r, all_types());
+ map.map.centre(new AltosLatLon(latitude, longitude));
+
+ loader = new AltosMapLoader(this,
+ latitude, longitude,
+ min_z, max_z, r,
+ all_types(), scale);
} catch (ParseException pe) {
load_button.setSelected(false);
} catch (ParseException pe) {
load_button.setSelected(false);