org.openstreetmap.josm.plugins.streetside

## Class StreetsideData

- java.lang.Object
- - org.openstreetmap.josm.plugins.streetside.StreetsideData

-     public class StreetsideData
      extends Object

  Database class for all the `StreetsideAbstractImage` objects.
  See Also:
    `StreetsideAbstractImage`, `StreetsideSequence`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private List<Bounds>` | `bounds` The bounds of the areas for which the pictures have been downloaded.
    `private StreetsideAbstractImage` | `highlightedImage` The image under the cursor.
    `private Set<StreetsideAbstractImage>` | `images`
    `private List<StreetsideDataListener>` | `listeners` Listeners of the class.
    `private Set<StreetsideAbstractImage>` | `multiSelectedImages` All the images selected, can be more than one.
    `private StreetsideAbstractImage` | `selectedImage` The image currently selected, this is the one being shown.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `StreetsideData()` Creates a new object and adds the initial set of listeners.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(StreetsideAbstractImage image)` Adds an StreetsideImage to the object, and then repaints mapView.
    `void` | `add(StreetsideAbstractImage image, boolean update)` Adds a StreetsideImage to the object, but doesn't repaint mapView.
    `void` | `addAll(Collection<? extends StreetsideAbstractImage> images)` Adds a set of StreetsideImages to the object, and then repaints mapView.
    `void` | `addAll(Collection<? extends StreetsideAbstractImage> newImages, boolean update)` Adds a set of {link StreetsideAbstractImage} objects to this object.
    `void` | `addListener(StreetsideDataListener lis)` Adds a new listener.
    `void` | `addMultiSelectedImage(Collection<StreetsideAbstractImage> images)` Adds a set of `StreetsideAbstractImage` objects to the list of selected images.
    `void` | `addMultiSelectedImage(StreetsideAbstractImage image)` Adds a `StreetsideImage` object to the list of selected images, (when ctrl + click)
    `static void` | `downloadSurroundingCubemaps(StreetsideImage streetsideImage)` Downloads surrounding images of this mapillary image in background threads
    `private static void` | `downloadSurroundingImages(StreetsideImage streetsideImage)` Downloads surrounding images of this mapillary image in background threads
    `private void` | `fireImagesAdded()`
    `private void` | `fireSelectedImageChanged(StreetsideAbstractImage oldImage, StreetsideAbstractImage newImage)`
    `List<Bounds>` | `getBounds()`
    `StreetsideAbstractImage` | `getHighlightedImage()` Returns the image under the mouse cursor.
    `Set<StreetsideAbstractImage>` | `getImages()` Returns a Set containing all images.
    `Set<StreetsideAbstractImage>` | `getMultiSelectedImages()` Returns a List containing all `StreetsideAbstractImage` objects selected with ctrl + click.
    `StreetsideAbstractImage` | `getSelectedImage()` Returns the StreetsideImage object that is currently selected.
    `Set<StreetsideSequence>` | `getSequences()` Returns a Set of all sequences, that the images are part of.
    `void` | `removeListener(StreetsideDataListener lis)` Removes a listener.
    `void` | `selectNext()` If the selected StreetsideImage is part of a StreetsideSequence then the following visible StreetsideImage is selected.
    `void` | `selectNext(boolean moveToPicture)` If the selected StreetsideImage is part of a StreetsideSequence then the following visible StreetsideImage is selected.
    `void` | `selectPrevious()` If the selected StreetsideImage is part of a StreetsideSequence then the previous visible StreetsideImage is selected.
    `void` | `selectPrevious(boolean moveToPicture)` If the selected StreetsideImage is part of a StreetsideSequence then the previous visible StreetsideImage is selected.
    `void` | `setHighlightedImage(StreetsideAbstractImage image)` Highlights the image under the cursor.
    `void` | `setImages(Collection<StreetsideAbstractImage> newImages)` Sets a new `Collection` object as the used set of images.
    `void` | `setSelectedImage(StreetsideAbstractImage image)` Selects a new image.If the user does ctrl + click, this isn't triggered.
    `void` | `setSelectedImage(StreetsideAbstractImage image, boolean zoom)` Selects a new image.If the user does ctrl+click, this isn't triggered.

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

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

- - ### Field Detail

    - #### images

          private final Set<StreetsideAbstractImage> images

    - #### selectedImage

          private StreetsideAbstractImage selectedImage

      The image currently selected, this is the one being shown.

    - #### highlightedImage

          private StreetsideAbstractImage highlightedImage

      The image under the cursor.

    - #### multiSelectedImages

          private final Set<StreetsideAbstractImage> multiSelectedImages

      All the images selected, can be more than one.

    - #### listeners

          private final List<StreetsideDataListener> listeners

      Listeners of the class.

    - #### bounds

          private final List<Bounds> bounds

      The bounds of the areas for which the pictures have been downloaded.

  - ### Constructor Detail

    - #### StreetsideData

          protected StreetsideData()

      Creates a new object and adds the initial set of listeners.

  - ### Method Detail

    - #### add

          public void add(StreetsideAbstractImage image)

      Adds an StreetsideImage to the object, and then repaints mapView.
      Parameters:
        `image` - The image to be added.

    - #### add

          public void add(StreetsideAbstractImage image,
                          boolean update)

      Adds a StreetsideImage to the object, but doesn't repaint mapView. This is needed for concurrency.
      Parameters:
        `image` - The image to be added.
        `update` - Whether the map must be updated or not (updates are currently unsupported by Streetside).

    - #### addAll

          public void addAll(Collection<? extends StreetsideAbstractImage> images)

      Adds a set of StreetsideImages to the object, and then repaints mapView.
      Parameters:
        `images` - The set of images to be added.

    - #### addAll

          public void addAll(Collection<? extends StreetsideAbstractImage> newImages,
                             boolean update)

      Adds a set of {link StreetsideAbstractImage} objects to this object.
      Parameters:
        `newImages` - The set of images to be added.
        `update` - Whether the map must be updated or not.

    - #### addListener

          public final void addListener(StreetsideDataListener lis)

      Adds a new listener.
      Parameters:
        `lis` - Listener to be added.

    - #### addMultiSelectedImage

          public void addMultiSelectedImage(StreetsideAbstractImage image)

      Adds a `StreetsideImage` object to the list of selected images, (when ctrl + click)
      Parameters:
        `image` - The `StreetsideImage` object to be added.

    - #### addMultiSelectedImage

          public void addMultiSelectedImage(Collection<StreetsideAbstractImage> images)

      Adds a set of `StreetsideAbstractImage` objects to the list of selected images.
      Parameters:
        `images` - A `Collection` object containing the set of images to be added.

    - #### getBounds

          public List<Bounds> getBounds()

    - #### removeListener

          public void removeListener(StreetsideDataListener lis)

      Removes a listener.
      Parameters:
        `lis` - Listener to be removed.

    - #### setHighlightedImage

          public void setHighlightedImage(StreetsideAbstractImage image)

      Highlights the image under the cursor.
      Parameters:
        `image` - The image under the cursor.

    - #### getHighlightedImage

          public StreetsideAbstractImage getHighlightedImage()

      Returns the image under the mouse cursor.
      Returns:
        The image under the mouse cursor.

    - #### getImages

          public Set<StreetsideAbstractImage> getImages()

      Returns a Set containing all images.
      Returns:
        A Set object containing all images.

    - #### getSequences

          public Set<StreetsideSequence> getSequences()

      Returns a Set of all sequences, that the images are part of.
      Returns:
        all sequences that are contained in the Streetside data

    - #### getSelectedImage

          public StreetsideAbstractImage getSelectedImage()

      Returns the StreetsideImage object that is currently selected.
      Returns:
        The selected StreetsideImage object.

    - #### fireImagesAdded

          private void fireImagesAdded()

    - #### selectNext

          public void selectNext()

      If the selected StreetsideImage is part of a StreetsideSequence then the following visible StreetsideImage is selected. In case there is none, does nothing.
      Throws:
        `IllegalStateException` - if the selected image is null or the selected image doesn't belong to a sequence.

    - #### selectNext

          public void selectNext(boolean moveToPicture)

      If the selected StreetsideImage is part of a StreetsideSequence then the following visible StreetsideImage is selected. In case there is none, does nothing.
      Parameters:
        `moveToPicture` - True if the view must me moved to the next picture.
      Throws:
        `IllegalStateException` - if the selected image is null or the selected image doesn't belong to a sequence.

    - #### selectPrevious

          public void selectPrevious()

      If the selected StreetsideImage is part of a StreetsideSequence then the previous visible StreetsideImage is selected. In case there is none, does nothing.
      Throws:
        `IllegalStateException` - if the selected image is null or the selected image doesn't belong to a sequence.

    - #### selectPrevious

          public void selectPrevious(boolean moveToPicture)

      If the selected StreetsideImage is part of a StreetsideSequence then the previous visible StreetsideImage is selected. In case there is none, does nothing. * @throws IllegalStateException if the selected image is null or the selected image doesn't belong to a sequence.
      Parameters:
        `moveToPicture` - True if the view must me moved to the previous picture.
      Throws:
        `IllegalStateException` - if the selected image is null or the selected image doesn't belong to a sequence.

    - #### setSelectedImage

          public void setSelectedImage(StreetsideAbstractImage image)

      Selects a new image.If the user does ctrl + click, this isn't triggered.
      Parameters:
        `image` - The StreetsideImage which is going to be selected

    - #### setSelectedImage

          public void setSelectedImage(StreetsideAbstractImage image,
                                       boolean zoom)

      Selects a new image.If the user does ctrl+click, this isn't triggered. You can choose whether to center the view on the new image or not.
      Parameters:
        `image` - The `StreetsideImage` which is going to be selected.
        `zoom` - True if the view must be centered on the image; false otherwise.

    - #### downloadSurroundingImages

          private static void downloadSurroundingImages(StreetsideImage streetsideImage)

      Downloads surrounding images of this mapillary image in background threads
      Parameters:
        `streetsideImage` - the image for which the surrounding images should be downloaded

    - #### downloadSurroundingCubemaps

          public static void downloadSurroundingCubemaps(StreetsideImage streetsideImage)

      Downloads surrounding images of this mapillary image in background threads
      Parameters:
        `streetsideImage` - the image for which the surrounding images should be downloaded

    - #### fireSelectedImageChanged

          private void fireSelectedImageChanged(StreetsideAbstractImage oldImage,
                                                StreetsideAbstractImage newImage)

    - #### getMultiSelectedImages

          public Set<StreetsideAbstractImage> getMultiSelectedImages()

      Returns a List containing all `StreetsideAbstractImage` objects selected with ctrl + click.
      Returns:
        A List object containing all the images selected.

    - #### setImages

          public void setImages(Collection<StreetsideAbstractImage> newImages)

      Sets a new `Collection` object as the used set of images. Any images that are already present, are removed.
      Parameters:
        `newImages` - the new image list (previously set images are completely replaced)

JOSM Plugins