Class MilStd2525UnitsFormat
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.util.UnitsFormat
-
- gov.nasa.worldwind.symbology.milstd2525.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.
-
-
Field Summary
-
Fields inherited from class gov.nasa.worldwind.util.UnitsFormat
ACRE, altitudeUnits, altitudeUnitsMultiplier, altitudeUnitsSymbol, areaUnits, areaUnitsMultiplier, areaUnitsSymbol, FEET, FORMAT_AREA, FORMAT_DECIMAL_DEGREES, FORMAT_EYE_ALTITUDE, FORMAT_HEADING, FORMAT_LENGTH, FORMAT_PITCH, FORMAT_TERRAIN_HEIGHT, FORMAT_UTM_EASTING, FORMAT_UTM_NORTHING, HECTARE, IMPERIAL_SYSTEM, KILOMETERS, LABEL_DATUM, LABEL_EYE_ALTITUDE, LABEL_HEADING, LABEL_LATITUDE, LABEL_LATLON_LAT, LABEL_LATLON_LON, LABEL_LONGITUDE, LABEL_PITCH, LABEL_TERRAIN_HEIGHT, LABEL_UTM_EASTING, LABEL_UTM_NORTHING, LABEL_UTM_ZONE, lengthUnits, lengthUnitsMultiplier, lengthUnitsSymbol, METERS, METRIC_SYSTEM, MILES, NAUTICAL_MILES, NL, showDMS, SQUARE_FEET, SQUARE_KILOMETERS, SQUARE_METERS, SQUARE_MILES, SQUARE_YARDS, SYMBOL_ACRE, SYMBOL_FEET, SYMBOL_HECTARE, SYMBOL_KILOMETERS, SYMBOL_METERS, SYMBOL_MILES, SYMBOL_NAUTICAL_MILES, SYMBOL_SQUARE_FEET, SYMBOL_SQUARE_KILOMETERS, SYMBOL_SQUARE_METERS, SYMBOL_SQUARE_MILES, SYMBOL_SQUARE_YARDS, SYMBOL_YARDS, YARDS
-
-
Constructor Summary
Constructors Constructor Description MilStd2525UnitsFormat()Construct an instance that displays length in kilometers, area in square kilometers and angles in degrees, minutes, seconds.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.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringlatitude(Angle angle)Format a latitude value.java.lang.StringlatLon(LatLon latlon)Format angles of latitude and longitude according to the current angle format.java.lang.Stringlongitude(Angle angle)Format a longitude value.voidsetAltitudeUnits(java.lang.String altitudeUnits)Specifies the units in which to display altitude values.protected voidsetDefaultLabels()Establishes the labels to use when displaying values other than length and area.-
Methods inherited from class gov.nasa.worldwind.util.UnitsFormat
angle, angleNL, area, areaNL, eyeAltitude, eyeAltitudeNL, getAltitudeUnits, getAltitudeUnitsMultiplier, getAltitudeUnitsSymbol, getAreaUnits, getAreaUnitsMultiplier, getAreaUnitsSymbol, getAreaUnitsSystem, getFormat, getLabel, getLengthUnits, getLengthUnitsMultiplier, getLengthUnitsSymbol, getLengthUnitsSystem, heading, heading, headingNL, headingNL, isShowDMS, latitudeNL, latLon2, latLon2NL, latLonNL, length, lengthNL, longitudeNL, pitch, pitchNL, setAreaUnits, setDefaultFormats, setFormat, setLabel, setLengthUnits, setShowDMS, setUnitsSystem, terrainHeight, terrainHeightNL, utmEasting, utmEastingNL, utmNorthing, utmNorthingNL, utmZone, utmZoneNL
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
-
-
-
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 areMETERS, KILOMETERS, MILES, NAUTICAL_MILES, YARDSandFEET.areaUnits- the desired area units. Available area units areSQUARE_METERS, SQUARE_KILOMETERS, HECTARE, ACRE, SQUARE_YARDandSQUARE_FEET.- Throws:
java.lang.IllegalArgumentException- if eitherlengthUnitsorareaUnitsis 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 areMETERS, KILOMETERS, MILES, NAUTICAL_MILES, YARDSandFEET.areaUnits- the desired area units. Available area units areSQUARE_METERS, SQUARE_KILOMETERS, HECTARE, ACRE, SQUARE_YARDandSQUARE_FEET.showDMS- true if the desired angle format is degrees-minutes-seconds, false if the format is decimal degrees.- Throws:
java.lang.IllegalArgumentException- if eitherlengthUnitsorareaUnitsis 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:
latitudein classUnitsFormat- 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:
longitudein classUnitsFormat- Parameters:
angle- the angle to format.- Returns:
- a string containing the formatted angle.
- Throws:
java.lang.IllegalArgumentException- if the angle is null.
-
latLon
public java.lang.String latLon(LatLon latlon)
Format angles of latitude and longitude according to the current angle format.The values are formatted using the current
UnitsFormat.LABEL_LATLON_LAT,UnitsFormat.LABEL_LATLON_LONand angle format.- Overrides:
latLonin classUnitsFormat- Parameters:
latlon- the angles to format.- Returns:
- a string containing the formatted angles.
-
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:
setAltitudeUnitsin classUnitsFormat- Parameters:
altitudeUnits- the desired altitude units. SeeUnitsFormat(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:
setDefaultLabelsin classUnitsFormat
-
-