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<CoordinateFormat> |
coordinatesCombo
Combobox with all coordinate display possibilities
|
static ProjectionChoice |
lambert |
static ProjectionChoice |
lambert_cc9 |
static ProjectionChoice |
mercator |
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 javax.swing.JPanel |
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 |
private static CollectionProperty |
PROP_SUB_PROJECTION |
static StringProperty |
PROP_SYSTEM_OF_MEASUREMENT |
private JosmComboBox<java.lang.String> |
unitsCombo |
private static java.lang.String[] |
unitsValues |
private static java.lang.String[] |
unitsValuesTr |
static ProjectionChoice |
utm_france_dom |
static ProjectionChoice |
wgs84 |
Constructor and Description |
---|
ProjectionPreference() |
Modifier and Type | Method and Description |
---|---|
void |
addGui(PreferenceTabbedPane gui)
Add the GUI elements to the dialog.
|
static java.util.List<ProjectionChoice> |
getProjectionChoices() |
private java.util.Collection<java.lang.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(java.lang.String name,
java.lang.String id,
java.lang.Integer epsg) |
static ProjectionChoice |
registerProjectionChoice(java.lang.String name,
java.lang.String id,
java.lang.Integer epsg,
java.lang.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(java.lang.String id,
java.util.Collection<java.lang.String> pref) |
private ProjectionChoice |
setupProjectionCombo()
Sets up projection combobox with default values and action listener
|
private void |
updateMeta(ProjectionChoice pc) |
private static java.util.List<ProjectionChoice> projectionChoices
private static 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 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 java.lang.String[] unitsValues
private static final java.lang.String[] unitsValuesTr
private final JosmComboBox<ProjectionChoice> projectionCombo
private final JosmComboBox<CoordinateFormat> coordinatesCombo
private final JosmComboBox<java.lang.String> unitsCombo
private javax.swing.JPanel projSubPrefPanel
private javax.swing.JPanel projSubPrefPanelWrapper
private javax.swing.JLabel projectionCodeLabel
private java.awt.Component projectionCodeGlue
private javax.swing.JLabel projectionCode
private javax.swing.JLabel projectionNameLabel
private java.awt.Component projectionNameGlue
private javax.swing.JLabel projectionName
private javax.swing.JLabel bounds
private final javax.swing.JPanel projPanel
private static final GBC projSubPrefPanelGBC
public ProjectionPreference()
public static void registerProjectionChoice(ProjectionChoice c)
public static ProjectionChoice registerProjectionChoice(java.lang.String name, java.lang.String id, java.lang.Integer epsg, java.lang.String cacheDir)
private static ProjectionChoice registerProjectionChoice(java.lang.String name, java.lang.String id, java.lang.Integer epsg)
public static java.util.List<ProjectionChoice> getProjectionChoices()
public void addGui(PreferenceTabbedPane gui)
PreferenceSetting
addGui
in interface PreferenceSetting
private void updateMeta(ProjectionChoice pc)
public boolean ok()
PreferenceSetting
ok
in interface PreferenceSetting
public static void setProjection()
public static void setProjection(java.lang.String id, java.util.Collection<java.lang.String> pref)
private void selectedProjectionChanged(ProjectionChoice pc)
pc
- the choice class representing user selectionprivate ProjectionChoice setupProjectionCombo()
private java.util.Collection<java.lang.String> getSubprojectionPreference(ProjectionChoice pc)
public boolean isExpert()
PreferenceSetting
isExpert
in interface PreferenceSetting
public TabPreferenceSetting getTabPreferenceSetting(PreferenceTabbedPane gui)
SubPreferenceSetting
getTabPreferenceSetting
in interface SubPreferenceSetting
public void selectProjection(ProjectionChoice projection)
projection
- The projection to select.