public class UnitPreferences extends AtakPreferences
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALTITUDE_REFERENCE |
static java.lang.String |
ALTITUDE_UNITS |
static java.lang.String |
AREA_SYSTEM |
static java.lang.String |
BEARING_UNITS |
static java.lang.String |
COORD_FMT |
static java.lang.String |
FT_MILES_THRESH |
static java.lang.String |
M_KM_THRESH |
static java.lang.String |
NORTH_REFERENCE |
static java.lang.String |
RANGE_SYSTEM |
_context, _prefs
Constructor and Description |
---|
UnitPreferences(MapView mapView) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
formatAltitude(GeoPoint point)
Produce a human-readable altitude string
|
java.lang.String |
formatAltitude(GeoPointMetaData pointMD)
Produce a human-readable altitude string
|
java.lang.String |
formatPoint(GeoPoint point,
boolean includeAlt)
Given a point, format the point using the default preference into a human readable format.
|
java.lang.String |
formatPoint(GeoPointMetaData point,
boolean includeAlt)
Produce a human-readable coordinate string
|
java.lang.String |
getAltitudeReference()
Get the current altitude reference for display
|
Span |
getAltitudeUnits()
Get the preferred altitude units
|
int |
getAreaSystem()
Get the preferred area system
|
Angle |
getBearingUnits()
Get the preferred bearing units
|
CoordinateFormat |
getCoordinateFormat()
Get the preferred coordinate format
|
NorthReference |
getNorthReference()
Get the preferred north reference
|
int |
getRangeSystem()
Get the preferred range system
|
Span |
getRangeUnits(double range)
Get preferred range units based on set thresholds
|
void |
setAltitudeUnits(Span unit) |
void |
setAreaSystem(int system) |
void |
setBearingUnits(Angle units) |
void |
setCoordinateFormat(CoordinateFormat format) |
void |
setNorthReference(NorthReference ref)
Set the north reference for the default units.
|
void |
setRangeSystem(int rangeSys) |
contains, get, get, get, get, get, getAll, getSharedPrefs, getStringSet, registerListener, remove, set, unregisterListener
public static final java.lang.String COORD_FMT
public static final java.lang.String RANGE_SYSTEM
public static final java.lang.String BEARING_UNITS
public static final java.lang.String NORTH_REFERENCE
public static final java.lang.String FT_MILES_THRESH
public static final java.lang.String M_KM_THRESH
public static final java.lang.String AREA_SYSTEM
public static final java.lang.String ALTITUDE_REFERENCE
public static final java.lang.String ALTITUDE_UNITS
public UnitPreferences(MapView mapView)
public CoordinateFormat getCoordinateFormat()
public void setCoordinateFormat(CoordinateFormat format)
public int getRangeSystem()
Span#ENGLISH
, Span#METRIC
, or Span#NM
public void setRangeSystem(int rangeSys)
public Span getRangeUnits(double range)
range
- Range value to use as reference (meters)public int getAreaSystem()
Area.METRIC
, Area.ENGLISH
, Area.NM
,
or Area.AC
public void setAreaSystem(int system)
public Angle getBearingUnits()
public void setBearingUnits(Angle units)
public java.lang.String getAltitudeReference()
public Span getAltitudeUnits()
public void setAltitudeUnits(Span unit)
public NorthReference getNorthReference()
public void setNorthReference(NorthReference ref)
ref
- the reference to be used.public java.lang.String formatPoint(GeoPointMetaData point, boolean includeAlt)
point
- PointincludeAlt
- True to include altitude on a new linepublic java.lang.String formatPoint(GeoPoint point, boolean includeAlt)
point
- the point to be usedincludeAlt
- if altitude should be included in the human readable stringpublic java.lang.String formatAltitude(GeoPointMetaData pointMD)
pointMD
- Altitude pointpublic java.lang.String formatAltitude(GeoPoint point)
point
- Altitude point