|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.preferences.projection.ProjectionPreference
public class ProjectionPreference
Projection preferences.
How to add new Projections:
- Find EPSG code for the projection.
- Look up the parameter string for Proj4, e.g. on http://spatialreference.org/
and add it to the file 'data/epsg' in JOSM trunk
- Search for official references and verify the parameter values. These
documents are often available in the local language only.
- Use #registerProjectionChoice()
, 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.
Nested Class Summary | |
---|---|
static class |
ProjectionPreference.Factory
|
Field Summary | |
---|---|
private javax.swing.JLabel |
bounds
|
private JosmComboBox |
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 |
projectionCombo
Combobox with all projections available |
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 |
unitsCombo
|
private static java.lang.String[] |
unitsValues
|
private static java.lang.String[] |
unitsValuesTr
|
static ProjectionChoice |
utm_france_dom
|
static ProjectionChoice |
wgs84
|
Constructor Summary | |
---|---|
ProjectionPreference()
|
Method Summary | |
---|---|
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 |
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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 JosmComboBox projectionCombo
private JosmComboBox coordinatesCombo
private JosmComboBox 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 bounds
private javax.swing.JPanel projPanel
private static GBC projSubPrefPanelGBC
Constructor Detail |
---|
public ProjectionPreference()
Method Detail |
---|
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)
proj
- private 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |