Class DownloadTaskList
java.lang.Object
org.openstreetmap.josm.actions.downloadtasks.DownloadTaskList
This class encapsulates the downloading of several bounding boxes that would otherwise be too
large to download in one go. Error messages will be collected for all downloads and displayed as
a list in the end.
- Since:
- 6053
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ProgressMonitorprivate final List<DownloadTask>private final boolean -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newDownloadTaskList.DownloadTaskList(boolean zoomAfterDownload) Constructs a newDownloadTaskList. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddDownloadTask(ProgressMonitor progressMonitor, DownloadTask dt, Rectangle2D td, int i, int n) Future<?>download(boolean newLayer, Collection<Area> areas, boolean osmData, boolean gpxData, ProgressMonitor progressMonitor) Downloads a list of areas from the OSM ServerFuture<?>download(boolean newLayer, List<Rectangle2D> rects, boolean osmData, boolean gpxData, ProgressMonitor progressMonitor) Downloads a list of areas from the OSM Serverprotected Set<OsmPrimitive>Replies the set of ids of all complete, non-new primitives (i.e.Replies the set of primitive ids which have been downloaded by this task listprotected voidhandlePotentiallyDeletedPrimitives(Set<OsmPrimitive> potentiallyDeleted) Processes a set of primitives (given by a set of their ids) which might be deleted on the server.protected voidupdatePotentiallyDeletedPrimitives(Set<OsmPrimitive> potentiallyDeleted) Updates the local state of a set of primitives (given by a set of primitive ids) with the state currently held on the server.
-
Field Details
-
tasks
-
taskFutures
-
zoomAfterDownload
-
progressMonitor
-
-
Constructor Details
-
DownloadTaskList
public DownloadTaskList()Constructs a newDownloadTaskList. Zooms to each download area. -
DownloadTaskList
Constructs a newDownloadTaskList.- Parameters:
zoomAfterDownload- whether to zoom to each download area- Since:
- 15205
-
-
Method Details
-
addDownloadTask
private void addDownloadTask(ProgressMonitor progressMonitor, DownloadTask dt, Rectangle2D td, int i, int n) -
download
public Future<?> download(boolean newLayer, List<Rectangle2D> rects, boolean osmData, boolean gpxData, ProgressMonitor progressMonitor) Downloads a list of areas from the OSM Server- Parameters:
newLayer- Set to true if all areas should be put into a single new layerrects- The List of Rectangle2D to downloadosmData- Set to true if OSM data should be downloadedgpxData- Set to true if GPX data should be downloadedprogressMonitor- The progress monitor- Returns:
- The Future representing the asynchronous download task
-
download
public Future<?> download(boolean newLayer, Collection<Area> areas, boolean osmData, boolean gpxData, ProgressMonitor progressMonitor) Downloads a list of areas from the OSM Server- Parameters:
newLayer- Set to true if all areas should be put into a single new layerareas- The Collection of Areas to downloadosmData- Set to true if OSM data should be downloadedgpxData- Set to true if GPX data should be downloadedprogressMonitor- The progress monitor- Returns:
- The Future representing the asynchronous download task
-
getCompletePrimitives
Replies the set of ids of all complete, non-new primitives (i.e. those with !primitive.incomplete)- Parameters:
ds- data set- Returns:
- the set of ids of all complete, non-new primitives
-
updatePotentiallyDeletedPrimitives
Updates the local state of a set of primitives (given by a set of primitive ids) with the state currently held on the server.- Parameters:
potentiallyDeleted- a set of ids to check update from the server
-
handlePotentiallyDeletedPrimitives
Processes a set of primitives (given by a set of their ids) which might be deleted on the server. First prompts the user whether he wants to check the current state on the server. If yes, retrieves the current state on the server and checks whether the primitives are indeed deleted on the server.- Parameters:
potentiallyDeleted- a set of primitives (given by their ids)
-
getDownloadedPrimitives
Replies the set of primitive ids which have been downloaded by this task list- Returns:
- the set of primitive ids which have been downloaded by this task list
-