public class ProjectionPreference extends Object implements SubPreferenceSetting
registerProjectionChoice(org.openstreetmap.josm.gui.preferences.projection.ProjectionChoice)
, to make the entry known to JOSM.
In case there is no EPSG code:
- override AbstractProjectionChoice.getProjection()
and provide
a manual implementation of the projection. Use CustomProjection
if possible.Modifier and Type | Class and Description |
---|---|
static class |
ProjectionPreference.Factory
Factory used to create a new
ProjectionPreference . |
Constructor and Description |
---|
ProjectionPreference() |
Modifier and Type | Method and Description |
---|---|
void |
addGui(PreferenceTabbedPane gui)
Add the GUI elements to the dialog.
|
static List<ProjectionChoice> |
getProjectionChoices() |
private static Collection<String> |
getSubprojectionPreference(ProjectionChoice pc) |
TabPreferenceSetting |
getTabPreferenceSetting(PreferenceTabbedPane gui)
Returns the preference setting (displayed in the specified preferences tab pane) that contains this preference setting.
|
boolean |
isExpert()
Called to know if the preferences tab has only to be displayed in expert mode.
|
boolean |
ok()
Called when OK is pressed to save the setting in the preferences file.
|
static void |
registerProjectionChoice(ProjectionChoice c) |
private static ProjectionChoice |
registerProjectionChoice(String name,
String id,
Integer epsg) |
static ProjectionChoice |
registerProjectionChoice(String name,
String id,
Integer epsg,
String cacheDir) |
private void |
selectedProjectionChanged(ProjectionChoice pc)
Handles all the work related to update the projection-specific
preferences
|
void |
selectProjection(ProjectionChoice projection)
Selects the given projection.
|
static void |
setProjection() |
static void |
setProjection(String id,
Collection<String> pref) |
private ProjectionChoice |
setupProjectionCombo()
Sets up projection combobox with default values and action listener
|
private void |
updateMeta(ProjectionChoice pc) |
private static List<ProjectionChoice> projectionChoices
private static Map<String,ProjectionChoice> projectionChoicesById
public static final ProjectionChoice wgs84
public static final ProjectionChoice mercator
public static final ProjectionChoice lambert
public static final ProjectionChoice utm_france_dom
public static final ProjectionChoice lambert_cc9
private static final StringProperty PROP_PROJECTION
private static final StringProperty PROP_COORDINATES
private static final CollectionProperty PROP_SUB_PROJECTION
public static final StringProperty PROP_SYSTEM_OF_MEASUREMENT
private static final String[] unitsValues
private static final String[] unitsValuesTr
private final JosmComboBox<ProjectionChoice> projectionCombo
private final JosmComboBox<CoordinateFormat> coordinatesCombo
private final JosmComboBox<String> unitsCombo
private JPanel projSubPrefPanel
private final JPanel projSubPrefPanelWrapper
private JLabel projectionCodeLabel
private Component projectionCodeGlue
private final JLabel projectionCode
private JLabel projectionNameLabel
private Component projectionNameGlue
private final JLabel projectionName
private static final GBC projSubPrefPanelGBC
public ProjectionPreference()
public static void registerProjectionChoice(ProjectionChoice c)
public static ProjectionChoice registerProjectionChoice(String name, String id, Integer epsg, String cacheDir)
private static ProjectionChoice registerProjectionChoice(String name, String id, Integer epsg)
public static List<ProjectionChoice> getProjectionChoices()
public void addGui(PreferenceTabbedPane gui)
PreferenceSetting
addGui
in interface PreferenceSetting
gui
- the preferences tab paneprivate void updateMeta(ProjectionChoice pc)
public boolean ok()
PreferenceSetting
ok
in interface PreferenceSetting
true
if restart is requiredpublic static void setProjection()
public static void setProjection(String id, Collection<String> pref)
private void selectedProjectionChanged(ProjectionChoice pc)
pc
- the choice class representing user selectionprivate ProjectionChoice setupProjectionCombo()
private static Collection<String> getSubprojectionPreference(ProjectionChoice pc)
public boolean isExpert()
PreferenceSetting
isExpert
in interface PreferenceSetting
public TabPreferenceSetting getTabPreferenceSetting(PreferenceTabbedPane gui)
SubPreferenceSetting
getTabPreferenceSetting
in interface SubPreferenceSetting
gui
- preferences tabbed panepublic void selectProjection(ProjectionChoice projection)
projection
- The projection to select.