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