org.openstreetmap.josm.plugins.streetside.io.download

## Class StreetsideDownloader

- java.lang.Object
- - org.openstreetmap.josm.plugins.streetside.io.download.StreetsideDownloader

-     public final class StreetsideDownloader
      extends java.lang.Object

  Class that concentrates all the ways of downloading of the plugin. All the download petitions will be managed one by one.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `StreetsideDownloader.DOWNLOAD_MODE` Possible download modes.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.util.concurrent.ThreadPoolExecutor` | `executor` Executor that will run the petitions.
    `(package private) static org.apache.log4j.Logger` | `logger`
    `private static double` | `MAX_AREA` Max area to be downloaded
    `private static boolean` | `stoppedDownload` Indicates whether the last download request has been rejected because it requested an area that was too big.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `private` | `StreetsideDownloader()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `downloadOSMArea()` Downloads all images of the area covered by the OSM data.
    `static void` | `downloadVisibleArea()` If some part of the current view has not been downloaded, it is downloaded.
    `static void` | `getImages(org.openstreetmap.josm.data.Bounds bounds)` Gets the images within the given bounds.
    `static void` | `getImages(org.openstreetmap.josm.data.coor.LatLon minLatLon, org.openstreetmap.josm.data.coor.LatLon maxLatLon)` Gets all the images in a square.
    `static StreetsideDownloader.DOWNLOAD_MODE` | `getMode()` Returns the current download mode.
    `private static boolean` | `isAreaTooBig(double area)` Checks if the area for which Streetside images should be downloaded is too big.
    `private static boolean` | `isInBounds(org.openstreetmap.josm.data.coor.LatLon latlon)` Checks if the given `LatLon` object lies inside the bounds of the image.
    `private static boolean` | `isViewDownloaded(org.openstreetmap.josm.data.Bounds view)`
    `private static void` | `run(java.lang.Runnable t)`
    `static void` | `stopAll()` Stops all running threads.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          static final org.apache.log4j.Logger logger

    - #### MAX_AREA

          private static final double MAX_AREA

      Max area to be downloaded

    - #### executor

          private static java.util.concurrent.ThreadPoolExecutor executor

      Executor that will run the petitions.

    - #### stoppedDownload

          private static boolean stoppedDownload

      Indicates whether the last download request has been rejected because it requested an area that was too big. Iff true, the last download has been rejected, if false, it was executed.

  - ### Constructor Detail

    - #### StreetsideDownloader

          private StreetsideDownloader()

  - ### Method Detail

    - #### getImages

          public static void getImages(org.openstreetmap.josm.data.coor.LatLon minLatLon,
                                       org.openstreetmap.josm.data.coor.LatLon maxLatLon)

      Gets all the images in a square. It downloads all the images of all the sequences that pass through the given rectangle.
      Parameters:
        `minLatLon` - The minimum latitude and longitude of the rectangle.
        `maxLatLon` - The maximum latitude and longitude of the rectangle

    - #### getImages

          public static void getImages(org.openstreetmap.josm.data.Bounds bounds)

      Gets the images within the given bounds.
      Parameters:
        `bounds` - A `Bounds` object containing the area to be downloaded.

    - #### getMode

          public static StreetsideDownloader.DOWNLOAD_MODE getMode()

      Returns the current download mode.
      Returns:
        the currently enabled `StreetsideDownloader.DOWNLOAD_MODE`

    - #### run

          private static void run(java.lang.Runnable t)

    - #### downloadVisibleArea

          public static void downloadVisibleArea()

      If some part of the current view has not been downloaded, it is downloaded.

    - #### isViewDownloaded

          private static boolean isViewDownloaded(org.openstreetmap.josm.data.Bounds view)

    - #### isInBounds

          private static boolean isInBounds(org.openstreetmap.josm.data.coor.LatLon latlon)

      Checks if the given `LatLon` object lies inside the bounds of the image.
      Parameters:
        `latlon` - The coordinates to check.
      Returns:
        true if it lies inside the bounds; false otherwise;

    - #### downloadOSMArea

          public static void downloadOSMArea()

      Downloads all images of the area covered by the OSM data.

    - #### isAreaTooBig

          private static boolean isAreaTooBig(double area)

      Checks if the area for which Streetside images should be downloaded is too big. This means that probably lots of Streetside images are going to be downloaded, slowing down the program too much. A notification is shown when the download has stopped or continued.
      Parameters:
        `area` - area to check
      Returns:
        `true` if the area is too big

    - #### stopAll

          public static void stopAll()

      Stops all running threads.

JOSM Plugins