Class CustomProjectionChoice
java.lang.Object
org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
org.openstreetmap.josm.gui.preferences.projection.CustomProjectionChoice
- All Implemented Interfaces:
ProjectionChoice,SubPrefsOptions
ProjectionChoice where a CRS can be defined using various parameters.
The configuration string mimics the syntax of the PROJ.4 project and should be mostly compatible.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA dialog for the available parameters of the custom projectionprivate static class -
Field Summary
FieldsFields inherited from class org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
id, name -
Constructor Summary
Constructors -
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.getPreferences(JPanel panel) Extract preferences from the GUI.getPreferencesFromCode(String code) Get Preferences from projection code.Get the projection that matches the internal state.Returns projection name.voidsetPreferences(Collection<String> args) Set the internal state to match the preferences.booleanDetermines if the projection code should be displayed in the top panel.booleanDetermines if the projection name should be displayed in the top panel.Methods inherited from class org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
getId, toString
-
Field Details
-
pref
-
-
Constructor Details
-
CustomProjectionChoice
public CustomProjectionChoice()Constructs a newCustomProjectionChoice.
-
-
Method Details
-
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.- Specified by:
setPreferencesin interfaceProjectionChoice- Parameters:
args- preferences as a list of strings; may be null to reset everything.
-
getProjection
Description copied from interface:ProjectionChoiceGet the projection that matches the internal state.- Specified by:
getProjectionin interfaceProjectionChoice- Overrides:
getProjectionin classAbstractProjectionChoice- Returns:
- the effective projection
-
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
-
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.- Specified by:
getPreferencePanelin interfaceProjectionChoice- Parameters:
listener- listener for any change of preferences- Returns:
- the GUI panel
-
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.- Specified by:
getPreferencesin interfaceProjectionChoice- Parameters:
panel- projection preferences panel- Returns:
- preferences as a list of strings; may be null to reset everything.
- See Also:
-
allCodes
Description copied from interface:ProjectionChoiceReturn all projection codes supported by this projection choice.- Specified by:
allCodesin interfaceProjectionChoice- Returns:
- all supported projection codes
-
getPreferencesFromCode
Description copied from interface:ProjectionChoiceGet Preferences from projection code.- Specified by:
getPreferencesFromCodein interfaceProjectionChoice- 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.
-
showProjectionCode
Description copied from interface:SubPrefsOptionsDetermines if the projection code should be displayed in the top panel.- Specified by:
showProjectionCodein interfaceSubPrefsOptions- Returns:
- true, if the projection code should be displayed in the top panel
-
showProjectionName
Description copied from interface:SubPrefsOptionsDetermines if the projection name should be displayed in the top panel.- Specified by:
showProjectionNamein interfaceSubPrefsOptions- Returns:
- true, if the projection name should be displayed in the top panel
-