org.openstreetmap.josm.plugins.streetside.io.export

## Class StreetsideExportManager

- java.lang.Object
- - org.openstreetmap.josm.gui.PleaseWaitRunnable
  - - org.openstreetmap.josm.plugins.streetside.io.export.StreetsideExportManager

- All Implemented Interfaces:
    Runnable, ProgressMonitor.CancelListener

      public class StreetsideExportManager
      extends PleaseWaitRunnable

  Export main thread. Exportation works by creating a `StreetsideExportWriterThread` and several `StreetsideExportDownloadThread`. The second ones download every single image that is going to be exported and stores them in an `ArrayBlockingQueue`. Then it is picked by the first one and written on the selected folder. Each image will be named by its key.
  See Also:
    `StreetsideExportWriterThread`, `StreetsideExportDownloadThread`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `amount`
    `private ThreadPoolExecutor` | `ex`
    `private Set<StreetsideAbstractImage>` | `images`
    `private String` | `path`
    `private ArrayBlockingQueue<BufferedImage>` | `queue`
    `private ArrayBlockingQueue<StreetsideAbstractImage>` | `queueImages`
    `private Thread` | `writer`

    - ### Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable

      `progressMonitor`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreetsideExportManager(List<StreetsideImportedImage> images)` Constructor used to rewrite imported images.
    `StreetsideExportManager(Set<StreetsideAbstractImage> images, String path)` Main constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `cancel()`
    `protected void` | `finish()`
    `protected void` | `realRun()`

    - ### Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable

      `afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run`

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

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

- - ### Field Detail

    - #### queue

          private final ArrayBlockingQueue<BufferedImage> queue

    - #### queueImages

          private final ArrayBlockingQueue<StreetsideAbstractImage> queueImages

    - #### amount

          private int amount

    - #### images

          private Set<StreetsideAbstractImage> images

    - #### path

          private String path

    - #### writer

          private Thread writer

    - #### ex

          private ThreadPoolExecutor ex

  - ### Constructor Detail

    - #### StreetsideExportManager

          public StreetsideExportManager(Set<StreetsideAbstractImage> images,
                                         String path)

      Main constructor.
      Parameters:
        `images` - Set of `StreetsideAbstractImage` objects to be exported.
        `path` - Export path.

    - #### StreetsideExportManager

          public StreetsideExportManager(List<StreetsideImportedImage> images)
                                  throws IOException

      Constructor used to rewrite imported images.
      Parameters:
        `images` - The set of `StreetsideImportedImage` object that is going to be rewritten.
      Throws:
        `IOException` - If the file of one of the `StreetsideImportedImage` objects doesn't contain a picture.

  - ### Method Detail

    - #### cancel

          protected void cancel()

      Specified by:
        `cancel` in class `PleaseWaitRunnable`

    - #### realRun

          protected void realRun()
                          throws IOException

      Specified by:
        `realRun` in class `PleaseWaitRunnable`
      Throws:
        `IOException`

    - #### finish

          protected void finish()

      Specified by:
        `finish` in class `PleaseWaitRunnable`

JOSM Plugins