Changeset 15363 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2019-09-19T16:30:27+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
r15350 r15363 123 123 * @param gpxDownload Set to true if GPX data should be downloaded 124 124 * @param title the title string for the confirmation dialog 125 */ 126 protected static void confirmAndDownloadAreas(Area a, double maxArea, boolean osmDownload, boolean gpxDownload, String title) { 125 * @param newLayer Set to true if all areas should be put into a single new layer 126 */ 127 protected static void confirmAndDownloadAreas(Area a, double maxArea, boolean osmDownload, boolean gpxDownload, String title, 128 boolean newLayer) { 127 129 List<Rectangle2D> toDownload = new ArrayList<>(); 128 130 addToDownload(a, a.getBounds(), toDownload, maxArea); … … 140 142 final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download data")); 141 143 final Future<?> future = new DownloadTaskList(Config.getPref().getBoolean("download.along.zoom-after-download")) 142 .download( false, toDownload, osmDownload, gpxDownload, monitor);144 .download(newLayer, toDownload, osmDownload, gpxDownload, monitor); 143 145 waitFuture(future, monitor); 144 146 } … … 179 181 * @param panel the panel that was displayed to the user and now contains his selections 180 182 * @param confirmTitle the title to display in the confirmation panel 183 * @param newLayer Set to true if all areas should be put into a single new layer 181 184 * @return the task or null if canceled by user 182 185 */ 183 protected PleaseWaitRunnable createCalcTask(Path2D alongPath, DownloadAlongPanel panel, String confirmTitle ) {186 protected PleaseWaitRunnable createCalcTask(Path2D alongPath, DownloadAlongPanel panel, String confirmTitle, boolean newLayer) { 184 187 /* 185 188 * Find the average latitude for the data we're contemplating, so we can know how many … … 221 224 222 225 private final Path2D downloadPath = new Path2D.Double(); 226 private final boolean newLayer; 223 227 private boolean cancel; 224 228 private int ticks; 225 229 private final Rectangle2D r = new Rectangle2D.Double(); 226 230 227 CalculateDownloadArea( ) {231 CalculateDownloadArea(boolean newLayer) { 228 232 super(tr("Calculating Download Area"), displayProgress ? null : NullProgressMonitor.INSTANCE, false); 233 this.newLayer = newLayer; 229 234 } 230 235 … … 245 250 } 246 251 confirmAndDownloadAreas(new Area(downloadPath), maxArea, panel.isDownloadOsmData(), panel.isDownloadGpxData(), 247 confirmTitle );252 confirmTitle, newLayer); 248 253 } 249 254 … … 291 296 } 292 297 293 return new CalculateDownloadArea( );298 return new CalculateDownloadArea(newLayer); 294 299 } 295 300 -
trunk/src/org/openstreetmap/josm/actions/DownloadAlongWayAction.java
r15028 r15363 54 54 PREF_DOWNLOAD_ALONG_WAY_DISTANCE, PREF_DOWNLOAD_ALONG_WAY_AREA, null); 55 55 56 if (0 != panel.showInDownloadDialog(tr("Download from OSM along selected ways"), HelpUtil.ht("/Tools/DownloadAlong"))) { 56 int ret = panel.showInDownloadDialog(tr("Download from OSM along selected ways"), HelpUtil.ht("/Tools/DownloadAlong")); 57 if (0 != ret && 1 != ret) { 57 58 return null; 58 59 } … … 71 72 } 72 73 } 73 return createCalcTask(alongPath, panel, tr("Download from OSM along selected ways")); 74 74 return createCalcTask(alongPath, panel, tr("Download from OSM along selected ways"), 1 == ret); 75 75 } 76 76
Note:
See TracChangeset
for help on using the changeset viewer.