org.openstreetmap.josm.plugins.streetside.actions

## Class WalkThread

- java.lang.Object
- - java.lang.Thread
  - - org.openstreetmap.josm.plugins.streetside.actions.WalkThread

- All Implemented Interfaces:
    Runnable, StreetsideDataListener

      public class WalkThread
      extends Thread
      implements StreetsideDataListener

  Thread containing the walk process.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.lang.Thread

      `Thread.State, Thread.UncaughtExceptionHandler`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private StreetsideData` | `data`
    `private boolean` | `end`
    `private boolean` | `followSelected`
    `private boolean` | `goForward`
    `private int` | `interval`
    `private BufferedImage` | `lastImage`
    `private boolean` | `paused`
    `private boolean` | `waitForFullQuality`

    - ### Fields inherited from class java.lang.Thread

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WalkThread(int interval, boolean waitForPicture, boolean followSelected, boolean goForward)` Main constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `end()` Called when the walk stops by itself of forcefully.
    `void` | `imagesAdded()` Fired when any image is added to the database.
    `void` | `pause()` Pauses the execution.
    `void` | `play()` Continues with the execution if paused.
    `private void` | `preDownloadCubemaps(StreetsideImage startImage, int n, CacheUtils.PICTURE type)`
    `private static void` | `preDownloadImages(StreetsideImage startImage, int n, CacheUtils.PICTURE type)` Downloads n images into the cache beginning from the supplied start-image (including the start-image itself).
    `void` | `run()`
    `void` | `selectedImageChanged(StreetsideAbstractImage oldImage, StreetsideAbstractImage newImage)` Fired when the selected image is changed by something different from manually clicking on the icon.
    `void` | `stopWalk()` Stops the execution.

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

      `activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

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

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

- - ### Field Detail

    - #### interval

          private final int interval

    - #### data

          private final StreetsideData data

    - #### end

          private boolean end

    - #### waitForFullQuality

          private final boolean waitForFullQuality

    - #### followSelected

          private final boolean followSelected

    - #### goForward

          private final boolean goForward

    - #### lastImage

          private BufferedImage lastImage

    - #### paused

          private volatile boolean paused

  - ### Constructor Detail

    - #### WalkThread

          public WalkThread(int interval,
                            boolean waitForPicture,
                            boolean followSelected,
                            boolean goForward)

      Main constructor.
      Parameters:
        `interval` - How often the images switch.
        `waitForPicture` - If it must wait for the full resolution picture or just the thumbnail.
        `followSelected` - Zoom to each image that is selected.
        `goForward` - true to go forward; false to go backwards.

  - ### Method Detail

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`
      Overrides:
        `run` in class `Thread`

    - #### preDownloadCubemaps

          private void preDownloadCubemaps(StreetsideImage startImage,
                                           int n,
                                           CacheUtils.PICTURE type)

    - #### preDownloadImages

          private static void preDownloadImages(StreetsideImage startImage,
                                                int n,
                                                CacheUtils.PICTURE type)

      Downloads n images into the cache beginning from the supplied start-image (including the start-image itself).
      Parameters:
        `startImage` - the image to start with (this and the next n-1 images in the same sequence are downloaded)
        `n` - the number of images to download
        `type` - the quality of the image (full or thumbnail)

    - #### imagesAdded

          public void imagesAdded()

      Description copied from interface: `StreetsideDataListener`
      Fired when any image is added to the database.
      Specified by:
        `imagesAdded` in interface `StreetsideDataListener`

    - #### selectedImageChanged

          public void selectedImageChanged(StreetsideAbstractImage oldImage,
                                           StreetsideAbstractImage newImage)

      Description copied from interface: `StreetsideDataListener`
      Fired when the selected image is changed by something different from manually clicking on the icon.
      Specified by:
        `selectedImageChanged` in interface `StreetsideDataListener`
      Parameters:
        `oldImage` - Old selected `StreetsideAbstractImage`
        `newImage` - New selected `StreetsideAbstractImage`

    - #### play

          public void play()

      Continues with the execution if paused.

    - #### pause

          public void pause()

      Pauses the execution.

    - #### stopWalk

          public void stopWalk()

      Stops the execution.

    - #### end

          public void end()

      Called when the walk stops by itself of forcefully.

JOSM Plugins