Class DownloadTaskList


  • public class DownloadTaskList
    extends 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.
    Since:
    6053
    • Constructor Detail

      • DownloadTaskList

        public DownloadTaskList()
        Constructs a new DownloadTaskList. Zooms to each download area.
      • DownloadTaskList

        public DownloadTaskList​(boolean zoomAfterDownload)
        Constructs a new DownloadTaskList.
        Parameters:
        zoomAfterDownload - whether to zoom to each download area
        Since:
        15205
    • Method Detail

      • 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 layer
        rects - The List of Rectangle2D to download
        osmData - Set to true if OSM data should be downloaded
        gpxData - Set to true if GPX data should be downloaded
        progressMonitor - 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 layer
        areas - The Collection of Areas to download
        osmData - Set to true if OSM data should be downloaded
        gpxData - Set to true if GPX data should be downloaded
        progressMonitor - The progress monitor
        Returns:
        The Future representing the asynchronous download task
      • getCompletePrimitives

        protected Set<OsmPrimitivegetCompletePrimitives​(DataSet ds)
        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

        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.
        Parameters:
        potentiallyDeleted - a set of ids to check update from the server
      • handlePotentiallyDeletedPrimitives

        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. 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 Set<OsmPrimitivegetDownloadedPrimitives()
        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