Class 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.Logger logger  
      private static double MIN_ZOOM_SQUARE_SIDE  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      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 String object 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 seconds
        ref - 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
        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 - if degMinSec doesn't have length 3 or if ref is 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 merged
        imgB - the second image, whose sequence is merged into the sequence of the first image
      • 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) either 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.
        Parameters:
        imgA - one of the images marking where to split the sequence
        imgB - the other image marking where to split the sequence, needs to be a direct neighbour of imgA in the sequence.
      • updateHelpText

        public static void updateHelpText()
        Updates the help text at the bottom of the window.