public class LatLonFormatter
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LatLonFormatter.Format
Define the supported different formats for latitude and longitude display.
|
| Modifier and Type | Field and Description |
|---|---|
static LatLonFormatter |
LAT |
static LatLonFormatter |
LON |
| Constructor and Description |
|---|
LatLonFormatter(boolean isLat,
boolean forDisplay)
Create a LatLonFormatter.
|
LatLonFormatter(boolean isLat,
boolean forDisplay,
LatLonFormatter.Format latLonFormat)
Create a LatLonFormatter.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Register a PropertyChangeListener to be informed of changes to the global format value.
|
java.lang.String |
format(double value)
Format the specified latitude or longitude value into a String.
|
static java.lang.String |
format(double latValue,
double lonValue)
Format the specified latitude and longitude pair according to the current global format.
|
static LatLonFormatter.Format |
getGlobalLatLonFormat()
Get the current default format to use for formatting latitudes and longitudes.
|
static void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Unregister a PropertyChangeListener so it will no longer be informed of changes to the global format value.
|
static void |
setGlobalLatLonFormat(LatLonFormatter.Format globalLatLonFormat)
Set the default format to use for formatting latitudes and longitudes.
|
public static final LatLonFormatter LAT
public static final LatLonFormatter LON
public LatLonFormatter(boolean isLat,
boolean forDisplay)
isLat - boolean true if for formatting latitudes, false for formatting longitudes.forDisplay - boolean true if for formatting human-readable displays, false for formatting for machine-to-machine transferspublic LatLonFormatter(boolean isLat,
boolean forDisplay,
LatLonFormatter.Format latLonFormat)
isLat - boolean true if for formatting latitudes, false for formatting longitudes.forDisplay - boolean true if for formatting human-readable displays, false for formatting for machine-to-machine transferslatLonFormat - Format for this formatter, ignoring the global format valuegetGlobalLatLonFormat()public static LatLonFormatter.Format getGlobalLatLonFormat()
public static void setGlobalLatLonFormat(LatLonFormatter.Format globalLatLonFormat)
globalLatLonFormat - Format enum identifying the desired formatpublic static void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l - PropertyChangeListener to registerpublic static void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l - PropertyChangeListener to unregisterpublic java.lang.String format(double value)
value - double latitude or longitude in fractional degrees North or Eastpublic static java.lang.String format(double latValue,
double lonValue)
latValue - latitude in fractional degrees NorthlonValue - longitude in fractional degrees East