org.openstreetmap.josm.gui.preferences.projection
Interface ProjectionChoice

All Known Implementing Classes:
AbstractProjectionChoice, CustomProjectionChoice, GaussKruegerProjectionChoice, LambertCC9ZonesProjectionChoice, LambertProjectionChoice, ListProjectionChoice, PuwgProjectionChoice, SingleProjectionChoice, SwissGridProjectionChoice, UTM_France_DOM_ProjectionChoice, UTMProjectionChoice

public interface ProjectionChoice

This class offers a choice of projections to the user. It can display a GUI panel, in order to select the parameters.


Method Summary
 java.lang.String[] allCodes()
          Return all projection codes supported by this projection class.
 java.lang.String getId()
          Get a unique id for the projection choice.
 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.
 void setPreferences(java.util.Collection<java.lang.String> args)
          Set the internal state to match the preferences.
 

Method Detail

getId

java.lang.String getId()
Get a unique id for the projection choice.


setPreferences

void setPreferences(java.util.Collection<java.lang.String> args)
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.


getProjection

Projection getProjection()
Get the projection that matches the internal state.


getPreferencePanel

javax.swing.JPanel getPreferencePanel(java.awt.event.ActionListener listener)
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.

Parameters:
listener - listener for any change of preferences
Returns:
the GUI panel

getPreferences

java.util.Collection<java.lang.String> getPreferences(javax.swing.JPanel panel)
Extract preferences from the GUI. Will be called when the preference dialog is dismissed or when the listener from getPreferencePanel is invoked.


allCodes

java.lang.String[] allCodes()
Return all projection codes supported by this projection class.


getPreferencesFromCode

java.util.Collection<java.lang.String> getPreferencesFromCode(java.lang.String code)
Get Preferences from 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.


JOSM