Class UTMProjectionChoice
- java.lang.Object
-
- org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
-
- org.openstreetmap.josm.gui.preferences.projection.ListProjectionChoice
-
- org.openstreetmap.josm.gui.preferences.projection.UTMProjectionChoice
-
- All Implemented Interfaces:
ProjectionChoice
public class UTMProjectionChoice extends ListProjectionChoice
ProjectionChoice for UTM.- See Also:
- UTM
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
UTMProjectionChoice.UTMPanel
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.preferences.projection.ListProjectionChoice
ListProjectionChoice.CBPanel
-
-
Field Summary
Fields Modifier and Type Field Description private static List<String>
cbEntries
private static TransverseMercator.Hemisphere
DEFAULT_HEMISPHERE
private TransverseMercator.Hemisphere
hemisphere
-
Fields inherited from class org.openstreetmap.josm.gui.preferences.projection.ListProjectionChoice
defaultIndex, entries, index, label
-
Fields inherited from class org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
id, name
-
-
Constructor Summary
Constructors Constructor Description UTMProjectionChoice()
Constructs a newUTMProjectionChoice
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]
allCodes()
Return all projection codes supported by this projection choice.String
getCurrentCode()
Returns current projection code.JPanel
getPreferencePanel(ActionListener listener)
Generate and provide the GUI.Collection<String>
getPreferences(JPanel panel)
Extract preferences from the GUI.Collection<String>
getPreferencesFromCode(String code)
Get Preferences from projection code.String
getProjectionName()
Returns projection name.protected String
indexToZone(int idx)
Convert 0-based index to preference value.void
setPreferences(Collection<String> args)
Set the internal state to match the preferences.protected int
zoneToIndex(String zone)
Convert preference value to 0-based index.-
Methods inherited from class org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
getId, getProjection, toString
-
-
-
-
Field Detail
-
DEFAULT_HEMISPHERE
private static final TransverseMercator.Hemisphere DEFAULT_HEMISPHERE
-
hemisphere
private TransverseMercator.Hemisphere hemisphere
-
-
Constructor Detail
-
UTMProjectionChoice
public UTMProjectionChoice()
Constructs a newUTMProjectionChoice
.
-
-
Method Detail
-
getPreferencePanel
public JPanel getPreferencePanel(ActionListener listener)
Description copied from interface:ProjectionChoice
Generate and provide the GUI. It will be displayed to the user. Call the listener, when the user makes changes in the GUI, so the projection info in the top panel gets updated.- Specified by:
getPreferencePanel
in interfaceProjectionChoice
- Overrides:
getPreferencePanel
in classListProjectionChoice
- Parameters:
listener
- listener for any change of preferences- Returns:
- the GUI panel
-
getCurrentCode
public String getCurrentCode()
Description copied from class:AbstractProjectionChoice
Returns current projection code.- Specified by:
getCurrentCode
in classAbstractProjectionChoice
- Returns:
- current projection code
-
getProjectionName
public String getProjectionName()
Description copied from class:AbstractProjectionChoice
Returns projection name.- Specified by:
getProjectionName
in classAbstractProjectionChoice
- Returns:
- projection name
-
getPreferences
public Collection<String> getPreferences(JPanel panel)
Description copied from interface:ProjectionChoice
Extract preferences from the GUI. Will be called when the preference dialog is dismissed or when the listener from getPreferencePanel is invoked.- Specified by:
getPreferences
in interfaceProjectionChoice
- Overrides:
getPreferences
in classListProjectionChoice
- Parameters:
panel
- projection preferences panel- Returns:
- preferences as a list of strings; may be null to reset everything.
- See Also:
ProjectionChoice.setPreferences(java.util.Collection<java.lang.String>)
-
allCodes
public String[] allCodes()
Description copied from interface:ProjectionChoice
Return all projection codes supported by this projection choice.- Returns:
- all supported projection codes
-
getPreferencesFromCode
public Collection<String> getPreferencesFromCode(String code)
Description copied from interface:ProjectionChoice
Get Preferences from projection code.- Parameters:
code
- projection code- Returns:
- null when code is not part of this projection choice. An empty Collection as return value indicates, that the code is supported, but no preferences are required to set it up.
-
setPreferences
public void setPreferences(Collection<String> args)
Description copied from interface:ProjectionChoice
Set the internal state to match the preferences. Will be called before getPreferencePanel and when the listener from getPreferencePanel is invoked.- Specified by:
setPreferences
in interfaceProjectionChoice
- Overrides:
setPreferences
in classListProjectionChoice
- Parameters:
args
- preferences as a list of strings; may be null to reset everything.
-
indexToZone
protected String indexToZone(int idx)
Description copied from class:ListProjectionChoice
Convert 0-based index to preference value.- Specified by:
indexToZone
in classListProjectionChoice
- Parameters:
idx
- 0-based index- Returns:
- preference value
- See Also:
ListProjectionChoice.zoneToIndex(java.lang.String)
-
zoneToIndex
protected int zoneToIndex(String zone)
Description copied from class:ListProjectionChoice
Convert preference value to 0-based index.- Specified by:
zoneToIndex
in classListProjectionChoice
- Parameters:
zone
- preference value- Returns:
- 0-based index
- See Also:
ListProjectionChoice.indexToZone(int)
-
-