org.openstreetmap.josm.plugins.streetside

## Class StreetsideAbstractImage

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

- All Implemented Interfaces:
    java.lang.Comparable<StreetsideAbstractImage>
  Direct Known Subclasses:
    StreetsideCubemap, StreetsideImage, StreetsideImportedImage

      public abstract class StreetsideAbstractImage
      extends java.lang.Object
      implements java.lang.Comparable<StreetsideAbstractImage>

  Abstract superclass for all image objects. At the moment there are 3, `StreetsideImportedImage`, `StreetsideImage`, & `StreetsideCubemap`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `cd` The time the image was captured, in Epoch format.
    `private static float` | `EPSILON` If two values for field cd differ by less than EPSILON both values are considered equal.
    `protected double` | `he` Direction of the picture.
    `protected java.lang.String` | `id`
    `protected org.openstreetmap.josm.data.coor.LatLon` | `latLon` Position of the picture.
    `protected double` | `movingHe` When the object direction is being moved in the map, the temporal direction is stored here
    `private org.openstreetmap.josm.data.coor.LatLon` | `movingLatLon` When the object is being dragged in the map, the temporal position is stored here.
    `private long` | `ne`
    `private long` | `pr`
    `private StreetsideSequence` | `sequence` Sequence of pictures containing this object.
    `private double` | `tempHe` Temporal direction of the picture until it is uploaded
    `private org.openstreetmap.josm.data.coor.LatLon` | `tempLatLon` Temporal position of the picture until it is uploaded.
    `private boolean` | `visible` Whether the image must be drown in the map or not

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `StreetsideAbstractImage(java.lang.String id)` Creates a new object with the given id.
    `protected` | `StreetsideAbstractImage(java.lang.String id, org.openstreetmap.josm.data.coor.LatLon latLon, double he)` Creates a new object in the given position and with the given direction.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getCd()` Returns the Epoch time when the image was captured.
    `java.lang.String` | `getDate()` Returns the date the picture was taken in DMY format.
    `java.lang.String` | `getDate(java.lang.String format)` Returns the date the picture was taken in the given format.
    `double` | `getHe()` Returns the original direction towards the image has been taken.
    `java.lang.String` | `getId()`
    `org.openstreetmap.josm.data.coor.LatLon` | `getLatLon()` Returns a LatLon object containing the original coordinates of the object.
    `double` | `getMovingHe()` Returns the direction towards the image has been taken.
    `org.openstreetmap.josm.data.coor.LatLon` | `getMovingLatLon()` Returns a LatLon object containing the current coordinates of the object.
    `long` | `getNe()`
    `long` | `getPr()`
    `StreetsideSequence` | `getSequence()` Returns the sequence which contains this image.
    `double` | `getTempHe()` Returns the last fixed direction of the object.
    `org.openstreetmap.josm.data.coor.LatLon` | `getTempLatLon()` Returns the last fixed coordinates of the object.
    `boolean` | `isModified()` Returns whether the object has been modified or not.
    `boolean` | `isVisible()` Returns whether the image is visible on the map or not.
    `void` | `move(double x, double y)` Moves the image temporally to another position
    `StreetsideAbstractImage` | `next()` If the StreetsideImage belongs to a StreetsideSequence, returns the next image in the sequence.
    `StreetsideAbstractImage` | `previous()` If the StreetsideImage belongs to a StreetsideSequence, returns the previous image in the sequence.
    `void` | `setCd(long cd)` Sets the Epoch time when the picture was captured.
    `void` | `setHe(double he)`
    `void` | `setId(java.lang.String id)`
    `void` | `setLatLon(org.openstreetmap.josm.data.coor.LatLon latLon)`
    `void` | `setNe(long ne)`
    `void` | `setPr(long pr)`
    `void` | `setSequence(StreetsideSequence sequence)` Sets the StreetsideSequence object which contains the StreetsideImage.
    `void` | `setVisible(boolean visible)` Set's whether the image should be visible on the map or not.
    `void` | `stopMoving()` Called when the mouse button is released, meaning that the picture has stopped being dragged, so the temporal values are saved.
    `void` | `turn(double ca)` Turns the image direction.

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

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

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Field Detail

    - #### EPSILON

          private static final float EPSILON

      If two values for field cd differ by less than EPSILON both values are considered equal.
      See Also:
        Constant Field Values

    - #### id

          protected java.lang.String id

    - #### ne

          private long ne

    - #### pr

          private long pr

    - #### cd

          protected long cd

      The time the image was captured, in Epoch format.

    - #### sequence

          private StreetsideSequence sequence

      Sequence of pictures containing this object.

    - #### latLon

          protected org.openstreetmap.josm.data.coor.LatLon latLon

      Position of the picture.

    - #### he

          protected double he

      Direction of the picture.

    - #### tempLatLon

          private org.openstreetmap.josm.data.coor.LatLon tempLatLon

      Temporal position of the picture until it is uploaded.

    - #### movingLatLon

          private org.openstreetmap.josm.data.coor.LatLon movingLatLon

      When the object is being dragged in the map, the temporal position is stored here.

    - #### tempHe

          private double tempHe

      Temporal direction of the picture until it is uploaded

    - #### movingHe

          protected double movingHe

      When the object direction is being moved in the map, the temporal direction is stored here

    - #### visible

          private boolean visible

      Whether the image must be drown in the map or not

  - ### Constructor Detail

    - #### StreetsideAbstractImage

          protected StreetsideAbstractImage(java.lang.String id,
                                            org.openstreetmap.josm.data.coor.LatLon latLon,
                                            double he)

      Creates a new object in the given position and with the given direction. `LatLon`
      Parameters:
        `id` - - the Streetside image id
        `latLon` - The latitude and longitude of the image.
        `he` - The direction of the picture (0 means north im Mapillary camera direction is not yet supported in the Streetside plugin).

    - #### StreetsideAbstractImage

          protected StreetsideAbstractImage(java.lang.String id)

      Creates a new object with the given id.
      Parameters:
        `id` - - the image id (All images require ids in Streetside)

  - ### Method Detail

    - #### getId

          public java.lang.String getId()

      Returns:
        the id

    - #### setId

          public void setId(java.lang.String id)

      Parameters:
        `id` - the id to set

    - #### getHe

          public double getHe()

      Returns the original direction towards the image has been taken.
      Returns:
        The direction of the image (0 means north and goes clockwise).

    - #### getCd

          public long getCd()

      Returns the Epoch time when the image was captured.
      Returns:
        The long containing the Epoch time when the image was captured.

    - #### getDate

          public java.lang.String getDate()

      Returns the date the picture was taken in DMY format.
      Returns:
        A String object containing the date when the picture was taken.

    - #### getDate

          public java.lang.String getDate(java.lang.String format)

      Returns the date the picture was taken in the given format.
      Parameters:
        `format` - Format of the date. See `SimpleDateFormat`.
      Returns:
        A String containing the date the picture was taken using the given format.
      Throws:
        `java.lang.NullPointerException` - if parameter format is `null`

    - #### getLatLon

          public org.openstreetmap.josm.data.coor.LatLon getLatLon()

      Returns a LatLon object containing the original coordinates of the object.
      Returns:
        The LatLon object with the position of the object.

    - #### getMovingHe

          public double getMovingHe()

      Returns the direction towards the image has been taken.
      Returns:
        The direction of the image (0 means north and goes clockwise).

    - #### getMovingLatLon

          public org.openstreetmap.josm.data.coor.LatLon getMovingLatLon()

      Returns a LatLon object containing the current coordinates of the object. When you are dragging the image this changes.
      Returns:
        The LatLon object with the position of the object.

    - #### getSequence

          public StreetsideSequence getSequence()

      Returns the sequence which contains this image. Never null.
      Returns:
        The StreetsideSequence object that contains this StreetsideImage.

    - #### getTempHe

          public double getTempHe()

      Returns the last fixed direction of the object.
      Returns:
        The last fixed direction of the object. 0 means north.

    - #### getTempLatLon

          public org.openstreetmap.josm.data.coor.LatLon getTempLatLon()

      Returns the last fixed coordinates of the object.
      Returns:
        A LatLon object containing.

    - #### isModified

          public boolean isModified()

      Returns whether the object has been modified or not.
      Returns:
        true if the object has been modified; false otherwise.

    - #### isVisible

          public boolean isVisible()

      Returns whether the image is visible on the map or not.
      Returns:
        True if the image is visible; false otherwise.

    - #### move

          public void move(double x,
                           double y)

      Moves the image temporally to another position
      Parameters:
        `x` - The movement of the image in longitude units.
        `y` - The movement of the image in latitude units.

    - #### next

          public StreetsideAbstractImage next()

      If the StreetsideImage belongs to a StreetsideSequence, returns the next image in the sequence.
      Returns:
        The following StreetsideImage, or null if there is none.

    - #### previous

          public StreetsideAbstractImage previous()

      If the StreetsideImage belongs to a StreetsideSequence, returns the previous image in the sequence.
      Returns:
        The previous StreetsideImage, or null if there is none.

    - #### setHe

          public void setHe(double he)

    - #### setCd

          public void setCd(long cd)

      Sets the Epoch time when the picture was captured.
      Parameters:
        `cd` - Epoch time when the image was captured.

    - #### setLatLon

          public void setLatLon(org.openstreetmap.josm.data.coor.LatLon latLon)

    - #### setSequence

          public void setSequence(StreetsideSequence sequence)

      Sets the StreetsideSequence object which contains the StreetsideImage.
      Parameters:
        `sequence` - The StreetsideSequence that contains the StreetsideImage.
      Throws:
        `java.lang.IllegalArgumentException` - if the image is not already part of the `StreetsideSequence`. Call `StreetsideSequence.add(StreetsideAbstractImage)` first.

    - #### setVisible

          public void setVisible(boolean visible)

      Set's whether the image should be visible on the map or not.
      Parameters:
        `visible` - true if the image is set to be visible; false otherwise.

    - #### stopMoving

          public void stopMoving()

      Called when the mouse button is released, meaning that the picture has stopped being dragged, so the temporal values are saved.

    - #### turn

          public void turn(double ca)

      Turns the image direction.
      Parameters:
        `ca` - The angle the image is moving.

    - #### getNe

          public long getNe()

      Returns:
        the ne

    - #### setNe

          public void setNe(long ne)

      Parameters:
        `ne` - the ne to set

    - #### getPr

          public long getPr()

      Returns:
        the pr

    - #### setPr

          public void setPr(long pr)

      Parameters:
        `pr` - the pr to set

JOSM Plugins