org.openstreetmap.josm.actions.downloadtasks
Class DownloadOsmTaskList

java.lang.Object
  extended by org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTaskList

public class DownloadOsmTaskList
extends java.lang.Object

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.


Nested Class Summary
(package private)  class DownloadOsmTaskList.PostDownloadProcessor
           
 
Field Summary
private  java.util.List<java.util.concurrent.Future<?>> osmTaskFutures
           
private  java.util.List<DownloadTask> osmTasks
           
private  ProgressMonitor progressMonitor
           
 
Constructor Summary
DownloadOsmTaskList()
           
 
Method Summary
 java.util.concurrent.Future<?> download(boolean newLayer, java.util.Collection<java.awt.geom.Area> areas, 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, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

osmTasks

private java.util.List<DownloadTask> osmTasks

osmTaskFutures

private java.util.List<java.util.concurrent.Future<?>> osmTaskFutures

progressMonitor

private ProgressMonitor progressMonitor
Constructor Detail

DownloadOsmTaskList

public DownloadOsmTaskList()
Method Detail

download

public java.util.concurrent.Future<?> download(boolean newLayer,
                                               java.util.List<java.awt.geom.Rectangle2D> rects,
                                               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 layer
The - List of Rectangle2D to download

download

public java.util.concurrent.Future<?> download(boolean newLayer,
                                               java.util.Collection<java.awt.geom.Area> areas,
                                               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 layer
The - Collection of Areas to download

getCompletePrimitives

protected java.util.Set<OsmPrimitive> getCompletePrimitives(DataSet ds)
Replies the set of ids of all complete, non-new primitives (i.e. those with ! primitive.incomplete)

Returns:
the set of ids of all complete, non-new primitives

updatePotentiallyDeletedPrimitives

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.

Parameters:
potentiallyDeleted - a set of ids to check update from the server

handlePotentiallyDeletedPrimitives

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. 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

public java.util.Set<OsmPrimitive> 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


JOSM