Changeset 2327 in josm for trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
- Timestamp:
- 27.10.2009 01:21:32 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r2322 r2327 8 8 import java.util.concurrent.Future; 9 9 import java.util.logging.Logger; 10 11 import javax.swing.JCheckBox;12 10 13 11 import org.openstreetmap.josm.Main; … … 38 36 private DownloadTask downloadTask; 39 37 40 private JCheckBox checkBox = new JCheckBox(tr("OpenStreetMap data"), true);41 42 38 private void rememberDownloadedData(DataSet ds) { 43 39 this.downloadedData = ds; … … 48 44 } 49 45 50 public Future<?> download(DownloadAction action, double minlat, double minlon, 51 double maxlat, double maxlon, ProgressMonitor progressMonitor) { 52 // Swap min and max if user has specified them the wrong way round 53 // (easy to do if you are crossing 0, for example) 54 // FIXME should perhaps be done in download dialog? 55 if (minlat > maxlat) { 56 double t = minlat; minlat = maxlat; maxlat = t; 57 } 58 if (minlon > maxlon) { 59 double t = minlon; minlon = maxlon; maxlon = t; 60 } 61 46 public Future<?> download(DownloadAction action, Bounds downloadArea, ProgressMonitor progressMonitor) { 47 62 48 boolean newLayer = action != null 63 && (action.dialog == null || action.dialog. newLayer.isSelected());49 && (action.dialog == null || action.dialog.isNewLayerRequired()); 64 50 65 51 downloadTask = new DownloadTask(newLayer, 66 new BoundingBoxDownloader( minlat, minlon, maxlat, maxlon), progressMonitor);67 currentBounds = new Bounds( new LatLon(minlat, minlon), new LatLon(maxlat, maxlon));52 new BoundingBoxDownloader(downloadArea), progressMonitor); 53 currentBounds = new Bounds(downloadArea); 68 54 // We need submit instead of execute so we can wait for it to finish and get the error 69 55 // message if necessary. If no one calls getErrorMessage() it just behaves like execute. … … 82 68 currentBounds = new Bounds(new LatLon(0,0), new LatLon(0,0)); 83 69 return Main.worker.submit(downloadTask); 84 }85 86 public JCheckBox getCheckBox() {87 return checkBox;88 }89 90 public String getPreferencesSuffix() {91 return "osm";92 70 } 93 71
Note: See TracChangeset
for help on using the changeset viewer.
