public class ProjectionPreference extends java.lang.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 . |
Modifier and Type | Field and Description |
---|---|
private javax.swing.JLabel |
bounds |
private JosmComboBox<ICoordinateFormat> |
coordinatesCombo
Combobox with all coordinate display possibilities
|
static ProjectionChoice |
lambert
Lambert conic conform 4 zones using the French geodetic system NTF.
|
static ProjectionChoice |
lambert_cc9
Lambert Conic Conform 9 Zones projection.
|
static ProjectionChoice |
mercator
Mercator Projection.
|
private static java.lang.String |
projectionChoice |
private static java.util.List<ProjectionChoice> |
projectionChoices |
private static java.util.Map<java.lang.String,ProjectionChoice> |
projectionChoicesById |
private javax.swing.JLabel |
projectionCode |
private java.awt.Component |
projectionCodeGlue |
private javax.swing.JLabel |
projectionCodeLabel |
private JosmComboBox<ProjectionChoice> |
projectionCombo
Combobox with all projections available
|
private javax.swing.JLabel |
projectionName |
private java.awt.Component |
projectionNameGlue |
private javax.swing.JLabel |
projectionNameLabel |
private VerticallyScrollablePanel |
projPanel
This is the panel holding all projection preferences
|
private javax.swing.JPanel |
projSubPrefPanel
This variable holds the JPanel with the projection's preferences.
|
private static GBC |
projSubPrefPanelGBC
The GridBagConstraints for the Panel containing the ProjectionSubPrefs.
|
private javax.swing.JPanel |
projSubPrefPanelWrapper |
private static StringProperty |
PROP_COORDINATES |
private static StringProperty |
PROP_PROJECTION_DEFAULT |
private static ListProperty |
PROP_SUB_PROJECTION_DEFAULT |
private JosmComboBox<java.lang.String> |
unitsCombo |
private static java.lang.String[] |
unitsValues |
private static java.lang.String[] |
unitsValuesTr |
static ProjectionChoice |
utm_france_dom
French departements in the Caribbean Sea and Indian Ocean.
|
static ProjectionChoice |
wgs84
WGS84: Directly use latitude / longitude values as x/y.
|
Constructor and Description |
---|
ProjectionPreference() |
Modifier and Type | Method and Description |
---|---|
void |
addGui(PreferenceTabbedPane gui)
Add the GUI elements to the dialog.
|
static java.lang.String |
getCurrentProjectionChoiceId()
Get the id of the projection choice that is currently set.
|
static java.util.List<ProjectionChoice> |
getProjectionChoices() |
static java.util.Collection<java.lang.String> |
getSubprojectionPreference(java.lang.String pcId)
Get the preferences that have been selected the last time for the given
projection choice.
|
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(java.lang.String name,
java.lang.String id,
java.lang.Integer epsg)
Registers a new projection choice.
|
static ProjectionChoice |
registerProjectionChoice(java.lang.String name,
java.lang.String id,
java.lang.Integer epsg,
java.lang.String cacheDir)
Deprecated.
|
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(java.lang.String id,
java.util.Collection<java.lang.String> pref,
boolean makeDefault)
Set projection.
|
private ProjectionChoice |
setupProjectionCombo()
Sets up projection combobox with default values and action listener
|
private void |
updateMeta(ProjectionChoice pc) |
private static final java.util.List<ProjectionChoice> projectionChoices
private static final java.util.Map<java.lang.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 java.lang.String projectionChoice
private static final StringProperty PROP_PROJECTION_DEFAULT
private static final StringProperty PROP_COORDINATES
private static final ListProperty PROP_SUB_PROJECTION_DEFAULT
private static final java.lang.String[] unitsValues
private static final java.lang.String[] unitsValuesTr
private final JosmComboBox<ProjectionChoice> projectionCombo
private final JosmComboBox<ICoordinateFormat> coordinatesCombo
private final JosmComboBox<java.lang.String> unitsCombo
private javax.swing.JPanel projSubPrefPanel
private final javax.swing.JPanel projSubPrefPanelWrapper
private final javax.swing.JLabel projectionCodeLabel
private final java.awt.Component projectionCodeGlue
private final javax.swing.JLabel projectionCode
private final javax.swing.JLabel projectionNameLabel
private final java.awt.Component projectionNameGlue
private final javax.swing.JLabel projectionName
private final javax.swing.JLabel bounds
private final VerticallyScrollablePanel projPanel
private static final GBC projSubPrefPanelGBC
public ProjectionPreference()
public static void registerProjectionChoice(ProjectionChoice c)
@Deprecated public static ProjectionChoice registerProjectionChoice(java.lang.String name, java.lang.String id, java.lang.Integer epsg, java.lang.String cacheDir)
registerProjectionChoice(String, String, Integer)
insteadname
- short name of the projection choice as shown in the GUIid
- short name of the projection choice as shown in the GUIepsg
- the unique numeric EPSG identifier for the projectioncacheDir
- unusedProjectionChoice
private static ProjectionChoice registerProjectionChoice(java.lang.String name, java.lang.String id, java.lang.Integer epsg)
name
- short name of the projection choice as shown in the GUIid
- short name of the projection choice as shown in the GUIepsg
- the unique numeric EPSG identifier for the projectionProjectionChoice
public static java.util.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(java.lang.String id, java.util.Collection<java.lang.String> pref, boolean makeDefault)
id
- id of the selected projection choicepref
- the configuration for the selected projection choicemakeDefault
- true, if it is to be set as permanent default
false, if it is to be set for the current sessionprivate void selectedProjectionChanged(ProjectionChoice pc)
pc
- the choice class representing user selectionprivate ProjectionChoice setupProjectionCombo()
public static java.lang.String getCurrentProjectionChoiceId()
public static java.util.Collection<java.lang.String> getSubprojectionPreference(java.lang.String pcId)
pcId
- id of the projection choicepublic 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.