public class DownloadTaskList extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
DownloadTaskList.PostDownloadProcessor |
Modifier and Type | Field and Description |
---|---|
private ProgressMonitor |
progressMonitor |
private java.util.List<java.util.concurrent.Future<?>> |
taskFutures |
private java.util.List<DownloadTask> |
tasks |
private boolean |
zoomAfterDownload |
Constructor and Description |
---|
DownloadTaskList()
Constructs a new
DownloadTaskList . |
DownloadTaskList(boolean zoomAfterDownload)
Constructs a new
DownloadTaskList . |
Modifier and Type | Method and Description |
---|---|
private void |
addDownloadTask(ProgressMonitor progressMonitor,
DownloadTask dt,
java.awt.geom.Rectangle2D td,
int i,
int n) |
java.util.concurrent.Future<?> |
download(boolean newLayer,
java.util.Collection<java.awt.geom.Area> areas,
boolean osmData,
boolean gpxData,
ProgressMonitor progressMonitor)
Downloads a list of areas from the OSM Server
|
java.util.concurrent.Future<?> |
download(boolean newLayer,
java.util.List<java.awt.geom.Rectangle2D> rects,
boolean osmData,
boolean gpxData,
ProgressMonitor progressMonitor)
Downloads a list of areas from the OSM Server
|
protected java.util.Set<OsmPrimitive> |
getCompletePrimitives(DataSet ds)
Replies the set of ids of all complete, non-new primitives (i.e.
|
java.util.Set<OsmPrimitive> |
getDownloadedPrimitives()
Replies the set of primitive ids which have been downloaded by this task list
|
protected void |
handlePotentiallyDeletedPrimitives(java.util.Set<OsmPrimitive> potentiallyDeleted)
Processes a set of primitives (given by a set of their ids) which might be deleted on the
server.
|
protected void |
updatePotentiallyDeletedPrimitives(java.util.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.
|
private final java.util.List<DownloadTask> tasks
private final java.util.List<java.util.concurrent.Future<?>> taskFutures
private final boolean zoomAfterDownload
private ProgressMonitor progressMonitor
public DownloadTaskList()
DownloadTaskList
. Zooms to each download area.public DownloadTaskList(boolean zoomAfterDownload)
DownloadTaskList
.zoomAfterDownload
- whether to zoom to each download areaprivate void addDownloadTask(ProgressMonitor progressMonitor, DownloadTask dt, java.awt.geom.Rectangle2D td, int i, int n)
public java.util.concurrent.Future<?> download(boolean newLayer, java.util.List<java.awt.geom.Rectangle2D> rects, boolean osmData, boolean gpxData, ProgressMonitor progressMonitor)
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 monitorpublic java.util.concurrent.Future<?> download(boolean newLayer, java.util.Collection<java.awt.geom.Area> areas, boolean osmData, boolean gpxData, ProgressMonitor progressMonitor)
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 monitorprotected java.util.Set<OsmPrimitive> getCompletePrimitives(DataSet ds)
ds
- data setprotected void updatePotentiallyDeletedPrimitives(java.util.Set<OsmPrimitive> potentiallyDeleted)
potentiallyDeleted
- a set of ids to check update from the serverprotected void handlePotentiallyDeletedPrimitives(java.util.Set<OsmPrimitive> potentiallyDeleted)
potentiallyDeleted
- a set of primitives (given by their ids)public java.util.Set<OsmPrimitive> getDownloadedPrimitives()