Class StreetsideUtils
- java.lang.Object
-
- org.openstreetmap.josm.plugins.streetside.utils.StreetsideUtils
-
public final class StreetsideUtils extends java.lang.Object
Set of utilities.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static org.apache.log4j.Loggerloggerprivate static doubleMIN_ZOOM_SQUARE_SIDE
-
Constructor Summary
Constructors Modifier Constructor Description privateStreetsideUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidbrowse(java.net.URL url)Open the default browser in the given URL.static java.lang.StringcurrentDate()Returns the current date formatted as EXIF timestamp.static longcurrentTime()Returns current time in Epoch format (milliseconds since 1970-01-01T00:00:00+0000)static doubledegMinSecToDouble(org.apache.commons.imaging.common.RationalNumber[] degMinSec, java.lang.String ref)Calculates the decimal degree-value from a degree value given in degrees-minutes-seconds-formatstatic longgetEpoch(java.lang.String date, java.lang.String format)Parses a string with a given format and returns the Epoch time.static voidjoin(StreetsideAbstractImage imgA, StreetsideAbstractImage imgB)Joins two images into the same sequence.static voidshowAllPictures()Zooms to fit all theStreetsideAbstractImageobjects stored in the database.static voidshowPictures(java.util.Set<StreetsideAbstractImage> images, boolean select)Zooms to fit all the givenStreetsideAbstractImageobjects.static voidunjoin(StreetsideAbstractImage imgA, StreetsideAbstractImage imgB)Separates two images belonging to the same sequence.static voidupdateHelpText()Updates the help text at the bottom of the window.
-
-
-
Field Detail
-
logger
static final org.apache.log4j.Logger logger
-
MIN_ZOOM_SQUARE_SIDE
private static final double MIN_ZOOM_SQUARE_SIDE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StreetsideUtils
private StreetsideUtils()
-
-
Method Detail
-
browse
public static void browse(java.net.URL url) throws java.io.IOException
Open the default browser in the given URL.- Parameters:
url- The (not-null) URL that is going to be opened.- Throws:
java.io.IOException- when the URL could not be opened
-
currentDate
public static java.lang.String currentDate()
Returns the current date formatted as EXIF timestamp. As timezone the default timezone of the JVM is used (TimeZone.getDefault()).- Returns:
- A
Stringobject containing the current date.
-
currentTime
public static long currentTime()
Returns current time in Epoch format (milliseconds since 1970-01-01T00:00:00+0000)- Returns:
- The current date in Epoch format.
-
getEpoch
public static long getEpoch(java.lang.String date, java.lang.String format) throws java.text.ParseException
Parses a string with a given format and returns the Epoch time. If no timezone information is given, the default timezone of the JVM is used (TimeZone.getDefault()).- Parameters:
date- The string containing the date.format- The format of the date.- Returns:
- The date in Epoch format.
- Throws:
java.text.ParseException- if the date cannot be parsed with the given format
-
degMinSecToDouble
public static double degMinSecToDouble(org.apache.commons.imaging.common.RationalNumber[] degMinSec, java.lang.String ref)
Calculates the decimal degree-value from a degree value given in degrees-minutes-seconds-format- Parameters:
degMinSec- an array of length 3, the values in there are (in this order) degrees, minutes and secondsref- the latitude or longitude reference determining if the given value is:- north (
GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH) or south (GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH) of the equator - east (
GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_EAST) or west (GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_WEST) of the equator
- north (
- Returns:
- the decimal degree-value for the given input, negative when west of 0-meridian or south of equator, positive otherwise
- Throws:
java.lang.IllegalArgumentException- ifdegMinSecdoesn't have length 3 or ifrefis not one of the values mentioned above
-
join
public static void join(StreetsideAbstractImage imgA, StreetsideAbstractImage imgB)
Joins two images into the same sequence. One of them must be the last image of a sequence, the other one the beginning of a different one.- Parameters:
imgA- the first image, into whose sequence the images from the sequence of the second image are mergedimgB- the second image, whose sequence is merged into the sequence of the first image
-
showAllPictures
public static void showAllPictures()
Zooms to fit all theStreetsideAbstractImageobjects stored in the database.
-
showPictures
public static void showPictures(java.util.Set<StreetsideAbstractImage> images, boolean select)
Zooms to fit all the givenStreetsideAbstractImageobjects.- Parameters:
images- The images your are zooming to.select- Whether the added images must be selected or not.
-
unjoin
public static void unjoin(StreetsideAbstractImage imgA, StreetsideAbstractImage imgB)
Separates two images belonging to the same sequence. The two images have to be consecutive in the same sequence. Two new sequences are created and all images up to (and including) eitherimgAorimgB(whichever appears first in the sequence) are put into the first of the two sequences. All others are put into the second new sequence.- Parameters:
imgA- one of the images marking where to split the sequenceimgB- the other image marking where to split the sequence, needs to be a direct neighbour ofimgAin the sequence.
-
updateHelpText
public static void updateHelpText()
Updates the help text at the bottom of the window.
-
-