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:
    java.lang.Runnable, org.openstreetmap.josm.gui.progress.ProgressMonitor.CancelListener

      public class StreetsideExportManager
      extends org.openstreetmap.josm.gui.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 java.util.concurrent.ThreadPoolExecutor` | `ex`
    `private java.util.Set<StreetsideAbstractImage>` | `images`
    `(package private) static org.apache.log4j.Logger` | `logger`
    `private java.lang.String` | `path`
    `private java.util.concurrent.ArrayBlockingQueue<java.awt.image.BufferedImage>` | `queue`
    `private java.util.concurrent.ArrayBlockingQueue<StreetsideAbstractImage>` | `queueImages`
    `private java.lang.Thread` | `writer`

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

      `progressMonitor`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreetsideExportManager(java.util.List<StreetsideImportedImage> images)` Constructor used to rewrite imported images.
    `StreetsideExportManager(java.util.Set<StreetsideAbstractImage> images, java.lang.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

    - #### logger

          static final org.apache.log4j.Logger logger

    - #### queue

          private final java.util.concurrent.ArrayBlockingQueue<java.awt.image.BufferedImage> queue

    - #### queueImages

          private final java.util.concurrent.ArrayBlockingQueue<StreetsideAbstractImage> queueImages

    - #### amount

          private int amount

    - #### images

          private java.util.Set<StreetsideAbstractImage> images

    - #### path

          private java.lang.String path

    - #### writer

          private java.lang.Thread writer

    - #### ex

          private java.util.concurrent.ThreadPoolExecutor ex

  - ### Constructor Detail

    - #### StreetsideExportManager

          public StreetsideExportManager(java.util.Set<StreetsideAbstractImage> images,
                                         java.lang.String path)

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

    - #### StreetsideExportManager

          public StreetsideExportManager(java.util.List<StreetsideImportedImage> images)
                                  throws java.io.IOException

      Constructor used to rewrite imported images.
      Parameters:
        `images` - The set of `StreetsideImportedImage` object that is going to be rewritten.
      Throws:
        `java.io.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 `org.openstreetmap.josm.gui.PleaseWaitRunnable`

    - #### realRun

          protected void realRun()
                          throws java.io.IOException

      Specified by:
        `realRun` in class `org.openstreetmap.josm.gui.PleaseWaitRunnable`
      Throws:
        `java.io.IOException`

    - #### finish

          protected void finish()

      Specified by:
        `finish` in class `org.openstreetmap.josm.gui.PleaseWaitRunnable`

JOSM Plugins