Class CoordinateFormatManager
- java.lang.Object
-
- org.openstreetmap.josm.data.coor.conversion.CoordinateFormatManager
-
public final class CoordinateFormatManager extends Object
Class that manages the available coordinate formats.- Since:
- 12735
-
-
Field Summary
Fields Modifier and Type Field Description private static ICoordinateFormat
defaultCoordinateFormat
private static List<ICoordinateFormat>
formats
-
Constructor Summary
Constructors Modifier Constructor Description private
CoordinateFormatManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ICoordinateFormat
getCoordinateFormat(String id)
Get registered coordinate format by idstatic List<ICoordinateFormat>
getCoordinateFormats()
Get the list of all registered coordinate formats.static ICoordinateFormat
getDefaultFormat()
Replies the default coordinate format to be usestatic void
registerCoordinateFormat(ICoordinateFormat format)
Register a coordinate format.static void
setCoordinateFormat(ICoordinateFormat format)
Sets the default coordinate format
-
-
-
Field Detail
-
formats
private static final List<ICoordinateFormat> formats
-
defaultCoordinateFormat
private static volatile ICoordinateFormat defaultCoordinateFormat
-
-
Constructor Detail
-
CoordinateFormatManager
private CoordinateFormatManager()
-
-
Method Detail
-
registerCoordinateFormat
public static void registerCoordinateFormat(ICoordinateFormat format)
Register a coordinate format.It will be available as a choice in the preferences.
- Parameters:
format
- the coordinate format
-
getCoordinateFormats
public static List<ICoordinateFormat> getCoordinateFormats()
Get the list of all registered coordinate formats.- Returns:
- the list of all registered coordinate formats
-
getDefaultFormat
public static ICoordinateFormat getDefaultFormat()
Replies the default coordinate format to be use- Returns:
- the default coordinate format
-
setCoordinateFormat
public static void setCoordinateFormat(ICoordinateFormat format)
Sets the default coordinate format- Parameters:
format
- the default coordinate format
-
getCoordinateFormat
public static ICoordinateFormat getCoordinateFormat(String id)
Get registered coordinate format by id- Parameters:
id
- id of the coordinate format to get- Returns:
- the registered
ICoordinateFormat
with given id, ornull
if no match is found
-
-