Class MilStd2525UnitsFormat

  • All Implemented Interfaces:
    AVList

    public class MilStd2525UnitsFormat
    extends UnitsFormat
    Units format configured to format locations and altitudes according to the defaults defined by MIL-STD-2525C.
    • Constructor Detail

      • MilStd2525UnitsFormat

        public MilStd2525UnitsFormat()
        Construct an instance that displays length in kilometers, area in square kilometers and angles in degrees, minutes, seconds.
      • MilStd2525UnitsFormat

        public MilStd2525UnitsFormat​(java.lang.String lengthUnits,
                                     java.lang.String areaUnits)
        Constructs an instance that display length and area in specified units, and angles in degrees, minutes, seconds.
        Parameters:
        lengthUnits - the desired length units. Available length units are METERS, KILOMETERS, MILES, NAUTICAL_MILES, YARDS and FEET.
        areaUnits - the desired area units. Available area units are SQUARE_METERS, SQUARE_KILOMETERS, HECTARE, ACRE, SQUARE_YARD and SQUARE_FEET.
        Throws:
        java.lang.IllegalArgumentException - if either lengthUnits or areaUnits is null.
      • MilStd2525UnitsFormat

        public MilStd2525UnitsFormat​(java.lang.String lengthUnits,
                                     java.lang.String areaUnits,
                                     boolean showDMS)
        Constructs an instance that display length and area in specified units, and angles in a specified format.
        Parameters:
        lengthUnits - the desired length units. Available length units are METERS, KILOMETERS, MILES, NAUTICAL_MILES, YARDS and FEET.
        areaUnits - the desired area units. Available area units are SQUARE_METERS, SQUARE_KILOMETERS, HECTARE, ACRE, SQUARE_YARD and SQUARE_FEET.
        showDMS - true if the desired angle format is degrees-minutes-seconds, false if the format is decimal degrees.
        Throws:
        java.lang.IllegalArgumentException - if either lengthUnits or areaUnits is null.
    • Method Detail

      • latitude

        public java.lang.String latitude​(Angle angle)
        Format a latitude value. If this format is configured to show degrees, minutes, and seconds then the returned string will use the format "DDMMSS.S".
        Overrides:
        latitude in class UnitsFormat
        Parameters:
        angle - the angle to format.
        Returns:
        a string containing the formatted angle.
        Throws:
        java.lang.IllegalArgumentException - if the angle is null.
      • longitude

        public java.lang.String longitude​(Angle angle)
        Format a longitude value. If this format is configured to show degrees, minutes, and seconds then the returned string will use the format "DDDMMSS.S".
        Overrides:
        longitude in class UnitsFormat
        Parameters:
        angle - the angle to format.
        Returns:
        a string containing the formatted angle.
        Throws:
        java.lang.IllegalArgumentException - if the angle is null.
      • setAltitudeUnits

        public void setAltitudeUnits​(java.lang.String altitudeUnits)
        Specifies the units in which to display altitude values. Units subsequently formatted by the instance are converted from meters to the desired units prior to formatting.
        Overrides:
        setAltitudeUnits in class UnitsFormat
        Parameters:
        altitudeUnits - the desired altitude units. See UnitsFormat(String, String, boolean) for the list of those available.
      • setDefaultLabels

        protected void setDefaultLabels()
        Establishes the labels to use when displaying values other than length and area. A label is a string placed before the value and its units. Examples are Latitude 24.36, UTM Zone: 12, and Eye Altitude: 500 km, where the emphasized terms are the labels. Subclasses can override this method to establish labels other than the defaults. The default labels are drawn from the current message properties. The recognized labels are those indicated by the "LABEL_" constants defined by this class or by its subclasses.
        Overrides:
        setDefaultLabels in class UnitsFormat