org.openstreetmap.josm.gui.preferences.projection
Class UTMProjectionChoice

java.lang.Object
  extended by org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
      extended by org.openstreetmap.josm.gui.preferences.projection.ListProjectionChoice
          extended by org.openstreetmap.josm.gui.preferences.projection.UTMProjectionChoice
All Implemented Interfaces:
Alias, ProjectionChoice

public class UTMProjectionChoice
extends ListProjectionChoice
implements Alias


Nested Class Summary
private  class UTMProjectionChoice.UTMPanel
           
 
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.preferences.projection.ListProjectionChoice
ListProjectionChoice.CBPanel
 
Field Summary
private static java.util.List<java.lang.String> cbEntries
           
private static UTM.Hemisphere DEFAULT_HEMISPHERE
           
private  UTM.Hemisphere hemisphere
           
 
Fields inherited from class org.openstreetmap.josm.gui.preferences.projection.ListProjectionChoice
defaultIndex, entries, index, label
 
Constructor Summary
UTMProjectionChoice()
           
 
Method Summary
 java.lang.String[] allCodes()
          Return all projection codes supported by this projection class.
 java.lang.String getAlias()
           
 javax.swing.JPanel getPreferencePanel(java.awt.event.ActionListener listener)
          Generate and provide the GUI.
 java.util.Collection<java.lang.String> getPreferences(javax.swing.JPanel panel)
          Extract preferences from the GUI.
 java.util.Collection<java.lang.String> getPreferencesFromCode(java.lang.String code)
          Get Preferences from projection code.
 Projection getProjection()
          Get the projection that matches the internal state.
protected  java.lang.String indexToZone(int index)
          Convert 0-based index to preference value.
 void setPreferences(java.util.Collection<java.lang.String> args)
          Set the internal state to match the preferences.
protected  int zoneToIndex(java.lang.String zone)
          Convert preference value to 0-based index.
 
Methods inherited from class org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
getId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_HEMISPHERE

private static final UTM.Hemisphere DEFAULT_HEMISPHERE

hemisphere

private UTM.Hemisphere hemisphere

cbEntries

private static final java.util.List<java.lang.String> cbEntries
Constructor Detail

UTMProjectionChoice

public UTMProjectionChoice()
Method Detail

getPreferencePanel

public javax.swing.JPanel getPreferencePanel(java.awt.event.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 interface ProjectionChoice
Overrides:
getPreferencePanel in class ListProjectionChoice
Parameters:
listener - listener for any change of preferences
Returns:
the GUI panel

getProjection

public Projection getProjection()
Description copied from interface: ProjectionChoice
Get the projection that matches the internal state.

Specified by:
getProjection in interface ProjectionChoice

getPreferences

public java.util.Collection<java.lang.String> getPreferences(javax.swing.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 interface ProjectionChoice
Overrides:
getPreferences in class ListProjectionChoice

allCodes

public java.lang.String[] allCodes()
Description copied from interface: ProjectionChoice
Return all projection codes supported by this projection class.

Specified by:
allCodes in interface ProjectionChoice

getPreferencesFromCode

public java.util.Collection<java.lang.String> getPreferencesFromCode(java.lang.String code)
Description copied from interface: ProjectionChoice
Get Preferences from projection code.

Specified by:
getPreferencesFromCode in interface ProjectionChoice
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(java.util.Collection<java.lang.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. Argument may be null to reset everything.

Specified by:
setPreferences in interface ProjectionChoice
Overrides:
setPreferences in class ListProjectionChoice

indexToZone

protected java.lang.String indexToZone(int index)
Description copied from class: ListProjectionChoice
Convert 0-based index to preference value.

Specified by:
indexToZone in class ListProjectionChoice

zoneToIndex

protected int zoneToIndex(java.lang.String zone)
Description copied from class: ListProjectionChoice
Convert preference value to 0-based index.

Specified by:
zoneToIndex in class ListProjectionChoice

getAlias

public java.lang.String getAlias()
Specified by:
getAlias in interface Alias


JOSM