Class SingleProjectionChoice
java.lang.Object
org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
org.openstreetmap.josm.gui.preferences.projection.SingleProjectionChoice
- All Implemented Interfaces:
ProjectionChoice
- Direct Known Subclasses:
SwissGridProjectionChoice
ProjectionChoice, that offers just one projection as choice.
The GUI is an empty panel.
-
Field Summary
FieldsFields inherited from class org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
id, name -
Constructor Summary
ConstructorsConstructorDescriptionSingleProjectionChoice(String name, String id, String code) Constructs a newSingleProjectionChoice. -
Method Summary
Modifier and TypeMethodDescriptionString[]allCodes()Return all projection codes supported by this projection choice.Returns current projection code.getPreferencePanel(ActionListener listener) Generate and provide the GUI.Extract preferences from the GUI.getPreferencesFromCode(String code) Get Preferences from projection code.Returns projection name.voidsetPreferences(Collection<String> args) Set the internal state to match the preferences.Methods inherited from class org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
getId, getProjection, toString
-
Field Details
-
code
-
-
Constructor Details
-
SingleProjectionChoice
Constructs a newSingleProjectionChoice.- Parameters:
name- short name of the projection choice as shown in the GUIid- unique identifier for the projection choice, e.g. "core:thisproj"code- the unique identifier for the projection, e.g. "EPSG:1234"
-
-
Method Details
-
getPreferencePanel
Description copied from interface:ProjectionChoiceGenerate 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
-
allCodes
Description copied from interface:ProjectionChoiceReturn all projection codes supported by this projection choice.- Returns:
- all supported projection codes
-
setPreferences
Description copied from interface:ProjectionChoiceSet the internal state to match the preferences. Will be called before getPreferencePanel and when the listener from getPreferencePanel is invoked.- Parameters:
args- preferences as a list of strings; may be null to reset everything.
-
getPreferences
Description copied from interface:ProjectionChoiceExtract preferences from the GUI. Will be called when the preference dialog is dismissed or when the listener from getPreferencePanel is invoked.- Parameters:
p- projection preferences panel- Returns:
- preferences as a list of strings; may be null to reset everything.
- See Also:
-
getPreferencesFromCode
Description copied from interface:ProjectionChoiceGet 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.
-
getCurrentCode
Description copied from class:AbstractProjectionChoiceReturns current projection code.- Specified by:
getCurrentCodein classAbstractProjectionChoice- Returns:
- current projection code
-
getProjectionName
Description copied from class:AbstractProjectionChoiceReturns projection name.- Specified by:
getProjectionNamein classAbstractProjectionChoice- Returns:
- projection name
-