public final class StreetsideUtils extends Object
Modifier and Type | Field and Description |
---|---|
private static double |
MIN_ZOOM_SQUARE_SIDE |
Modifier | Constructor and Description |
---|---|
private |
StreetsideUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
browse(URL url)
Open the default browser in the given URL.
|
static String |
currentDate()
Returns the current date formatted as EXIF timestamp.
|
static long |
currentTime()
Returns current time in Epoch format (milliseconds since 1970-01-01T00:00:00+0000)
|
static double |
degMinSecToDouble(org.apache.commons.imaging.common.RationalNumber[] degMinSec,
String ref)
Calculates the decimal degree-value from a degree value given in
degrees-minutes-seconds-format
|
static long |
getEpoch(String date,
String format)
Parses a string with a given format and returns the Epoch time.
|
static void |
join(StreetsideAbstractImage imgA,
StreetsideAbstractImage imgB)
Joins two images into the same sequence.
|
static void |
showAllPictures()
Zooms to fit all the
StreetsideAbstractImage objects stored in the
database. |
static void |
showPictures(Set<StreetsideAbstractImage> images,
boolean select)
Zooms to fit all the given
StreetsideAbstractImage objects. |
static List<StreetsideAbstractImage> |
sortImagesInSequence(List<StreetsideAbstractImage> images) |
static void |
unjoin(StreetsideAbstractImage imgA,
StreetsideAbstractImage imgB)
Separates two images belonging to the same sequence.
|
static void |
updateHelpText()
Updates the help text at the bottom of the window.
|
private static final double MIN_ZOOM_SQUARE_SIDE
private StreetsideUtils()
public static void browse(URL url) throws IOException
url
- The (not-null) URL that is going to be opened.IOException
- when the URL could not be openedpublic static String currentDate()
TimeZone.getDefault()
).String
object containing the current date.public static long currentTime()
public static long getEpoch(String date, String format) throws ParseException
TimeZone.getDefault()
).date
- The string containing the date.format
- The format of the date.ParseException
- if the date cannot be parsed with the given formatpublic static double degMinSecToDouble(org.apache.commons.imaging.common.RationalNumber[] degMinSec, String ref)
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:
GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH
) or
south (
GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH
) of
the equatorGpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_EAST
) or
west (GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_WEST
) of the equatorIllegalArgumentException
- if degMinSec
doesn't have length 3 or if ref
is
not one of the values mentioned abovepublic static void join(StreetsideAbstractImage imgA, StreetsideAbstractImage imgB)
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 imagepublic static void showAllPictures()
StreetsideAbstractImage
objects stored in the
database.public static void showPictures(Set<StreetsideAbstractImage> images, boolean select)
StreetsideAbstractImage
objects.images
- The images your are zooming to.select
- Whether the added images must be selected or not.public static void unjoin(StreetsideAbstractImage imgA, StreetsideAbstractImage imgB)
imgA
or imgB
(whichever appears first in the sequence) are put into the first of the two sequences.
All others are put into the second new sequence.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 of imgA
in the sequence.public static void updateHelpText()
public static List<StreetsideAbstractImage> sortImagesInSequence(List<StreetsideAbstractImage> images)