Changeset 18300 in osm for applications/editors/josm/plugins/waydownloader/src
- Timestamp:
- 2009-10-27T11:11:18+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java
r18067 r18300 8 8 import java.util.Collection; 9 9 import java.util.LinkedList; 10 import java.util.concurrent.Future; 10 11 11 12 import javax.swing.JOptionPane; … … 100 101 double lonbuffer=0.0005; 101 102 DownloadOsmTask downloadTask = new DownloadOsmTask(); 102 downloadTask.download( null, 103 selectedNode.getCoor().lat()-latbuffer, 104 selectedNode.getCoor().lon()-lonbuffer, 105 selectedNode.getCoor().lat()+latbuffer, 106 selectedNode.getCoor().lon()+lonbuffer, 107 new PleaseWaitProgressMonitor()); 108 103 final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(); 104 final Future<?> future = downloadTask.download( 105 false /* no new layer */, 106 new Bounds( 107 selectedNode.getCoor().lat()- latbuffer, 108 selectedNode.getCoor().lon()- lonbuffer, 109 selectedNode.getCoor().lat()+ latbuffer, 110 selectedNode.getCoor().lon()+ lonbuffer 111 ), 112 monitor 113 ); 114 // schedule closing of the progress monitor after the download 115 // job has finished 116 Main.worker.submit( 117 new Runnable() { 118 public void run() { 119 try { 120 future.get(); 121 } catch(Exception e) { 122 e.printStackTrace(); 123 return; 124 } 125 monitor.close(); 126 } 127 } 128 ); 109 129 //The download is scheduled to be executed. 110 130 //Now schedule the run() method (below) to be executed once that's completed. … … 238 258 Bounds bounds = datasource.bounds; 239 259 240 if (node.getCoor().lat()>bounds. min.lat() &&241 node.getCoor().lat()<bounds. max.lat() &&242 node.getCoor().lon()>bounds. min.lon() &&243 node.getCoor().lon()<bounds. max.lon()) {260 if (node.getCoor().lat()>bounds.getMin().lat() && 261 node.getCoor().lat()<bounds.getMax().lat() && 262 node.getCoor().lon()>bounds.getMin().lon() && 263 node.getCoor().lon()<bounds.getMax().lon()) { 244 264 return true; 245 265 }
Note:
See TracChangeset
for help on using the changeset viewer.