Class LayoutLocation


  • public final class LayoutLocation
    extends java.lang.Object
    Represents a "node location" on a UI layout.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  LayoutLocation.Type
      Designates the type of location; either geographic or logical grid.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<LayoutLocation> fromCompactListString​(java.lang.String compactList)
      Returns a list of layout locations from a compact string representation.
      static LayoutLocation fromCompactString​(java.lang.String s)
      Produces a layout location instance from a compact string representation.
      java.lang.String id()
      Returns the identifier associated with this location.
      boolean isOrigin()
      Returns true if the coordinates indicate the origin (0, 0) of the coordinate system; false otherwise.
      double latOrY()
      Returns the latitude (geo) or y-coord (grid) data value.
      static LayoutLocation layoutLocation​(java.lang.String id, java.lang.String locType, double latOrY, double longOrX)
      Creates an instance of a layout location.
      static LayoutLocation layoutLocation​(java.lang.String id, LayoutLocation.Type locType, double latOrY, double longOrX)
      Creates an instance of a layout location.
      LayoutLocation.Type locType()
      Returns the location type (geo or grid), which indicates how the data is to be interpreted.
      double longOrX()
      Returns the longitude (geo) or x-coord (grid) data value.
      java.lang.String toCompactListString()
      Produces a compact string representation of this instance.
      static java.lang.String toCompactListString​(java.util.List<LayoutLocation> locs)
      Produces a compact encoding of a list of layout locations.
      static java.lang.String toCompactListString​(LayoutLocation... locs)
      Produces a compact encoding of a list of layout locations.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • isOrigin

        public boolean isOrigin()
        Returns true if the coordinates indicate the origin (0, 0) of the coordinate system; false otherwise.
        Returns:
        true if geo-coordinates are set; false otherwise
      • id

        public java.lang.String id()
        Returns the identifier associated with this location.
        Returns:
        the identifier
      • locType

        public LayoutLocation.Type locType()
        Returns the location type (geo or grid), which indicates how the data is to be interpreted.
        Returns:
        location type
      • latOrY

        public double latOrY()
        Returns the latitude (geo) or y-coord (grid) data value.
        Returns:
        geo latitude or grid y-coord
      • longOrX

        public double longOrX()
        Returns the longitude (geo) or x-coord (grid) data value.
        Returns:
        geo longitude or grid x-coord
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toCompactListString

        public java.lang.String toCompactListString()
        Produces a compact string representation of this instance.
        Returns:
        compact string rep
      • fromCompactString

        public static LayoutLocation fromCompactString​(java.lang.String s)
        Produces a layout location instance from a compact string representation.
        Parameters:
        s - the compact string
        Returns:
        a corresponding instance
      • toCompactListString

        public static java.lang.String toCompactListString​(LayoutLocation... locs)
        Produces a compact encoding of a list of layout locations.
        Parameters:
        locs - array of layout location instances
        Returns:
        string encoding
      • toCompactListString

        public static java.lang.String toCompactListString​(java.util.List<LayoutLocation> locs)
        Produces a compact encoding of a list of layout locations.
        Parameters:
        locs - list of layout location instances
        Returns:
        string encoding
      • fromCompactListString

        public static java.util.List<LayoutLocation> fromCompactListString​(java.lang.String compactList)
        Returns a list of layout locations from a compact string representation.
        Parameters:
        compactList - string representation
        Returns:
        corresponding list of layout locations
      • layoutLocation

        public static LayoutLocation layoutLocation​(java.lang.String id,
                                                    LayoutLocation.Type locType,
                                                    double latOrY,
                                                    double longOrX)
        Creates an instance of a layout location.
        Parameters:
        id - an identifier for the item at this location
        locType - the location type
        latOrY - geo latitude / grid y-coord
        longOrX - geo longitude / grid x-coord
        Returns:
        layout location instance
      • layoutLocation

        public static LayoutLocation layoutLocation​(java.lang.String id,
                                                    java.lang.String locType,
                                                    double latOrY,
                                                    double longOrX)
        Creates an instance of a layout location.
        Parameters:
        id - an identifier for the item at this location
        locType - the location type ("geo" or "grid")
        latOrY - geo latitude / grid y-coord
        longOrX - geo longitude / grid x-coord
        Returns:
        layout location instance
        Throws:
        java.lang.IllegalArgumentException - if the type is not "geo" or "grid"