source: josm/trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java@ 12846

Last change on this file since 12846 was 12846, checked in by bastiK, 7 years ago

see #15229 - use Config.getPref() wherever possible

  • Property svn:eol-style set to native
File size: 23.7 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.preferences.projection;
3
4import static org.openstreetmap.josm.data.SystemOfMeasurement.ALL_SYSTEMS;
5import static org.openstreetmap.josm.tools.I18n.tr;
6
7import java.awt.Component;
8import java.awt.GridBagLayout;
9import java.awt.event.ActionListener;
10import java.util.ArrayList;
11import java.util.Collection;
12import java.util.Collections;
13import java.util.HashMap;
14import java.util.List;
15import java.util.Map;
16
17import javax.swing.BorderFactory;
18import javax.swing.JButton;
19import javax.swing.JLabel;
20import javax.swing.JOptionPane;
21import javax.swing.JPanel;
22import javax.swing.JSeparator;
23
24import org.openstreetmap.josm.Main;
25import org.openstreetmap.josm.actions.ExpertToggleAction;
26import org.openstreetmap.josm.data.Bounds;
27import org.openstreetmap.josm.data.SystemOfMeasurement;
28import org.openstreetmap.josm.data.coor.conversion.CoordinateFormatManager;
29import org.openstreetmap.josm.data.coor.conversion.ICoordinateFormat;
30import org.openstreetmap.josm.data.preferences.ListProperty;
31import org.openstreetmap.josm.data.preferences.StringProperty;
32import org.openstreetmap.josm.data.projection.CustomProjection;
33import org.openstreetmap.josm.data.projection.Projection;
34import org.openstreetmap.josm.data.projection.Projections;
35import org.openstreetmap.josm.gui.ExtendedDialog;
36import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
37import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
38import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
39import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
40import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
41import org.openstreetmap.josm.gui.widgets.JosmComboBox;
42import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
43import org.openstreetmap.josm.spi.preferences.Config;
44import org.openstreetmap.josm.tools.GBC;
45import org.openstreetmap.josm.tools.JosmRuntimeException;
46import org.openstreetmap.josm.tools.Logging;
47
48/**
49 * Projection preferences.
50 *
51 * How to add new Projections:
52 * - Find EPSG code for the projection.
53 * - Look up the parameter string for Proj4, e.g. on http://spatialreference.org/
54 * and add it to the file 'data/projection/epsg' in JOSM trunk
55 * - Search for official references and verify the parameter values. These
56 * documents are often available in the local language only.
57 * - Use {@link #registerProjectionChoice}, to make the entry known to JOSM.
58 *
59 * In case there is no EPSG code:
60 * - override {@link AbstractProjectionChoice#getProjection()} and provide
61 * a manual implementation of the projection. Use {@link CustomProjection}
62 * if possible.
63 */
64public class ProjectionPreference implements SubPreferenceSetting {
65
66 /**
67 * Factory used to create a new {@code ProjectionPreference}.
68 */
69 public static class Factory implements PreferenceSettingFactory {
70 @Override
71 public PreferenceSetting createPreferenceSetting() {
72 return new ProjectionPreference();
73 }
74 }
75
76 private static final List<ProjectionChoice> projectionChoices = new ArrayList<>();
77 private static final Map<String, ProjectionChoice> projectionChoicesById = new HashMap<>();
78
79 /**
80 * WGS84: Directly use latitude / longitude values as x/y.
81 */
82 public static final ProjectionChoice wgs84 = registerProjectionChoice(tr("WGS84 Geographic"), "core:wgs84", 4326, "epsg4326");
83
84 /**
85 * Mercator Projection.
86 *
87 * The center of the mercator projection is always the 0 grad coordinate.
88 *
89 * See also USGS Bulletin 1532 (http://pubs.usgs.gov/bul/1532/report.pdf)
90 * initially EPSG used 3785 but that has been superseded by 3857, see https://www.epsg-registry.org/
91 */
92 public static final ProjectionChoice mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 3857);
93
94 /**
95 * Lambert conic conform 4 zones using the French geodetic system NTF.
96 *
97 * This newer version uses the grid translation NTF&lt;-&gt;RGF93 provided by IGN for a submillimetric accuracy.
98 * (RGF93 is the French geodetic system similar to WGS84 but not mathematically equal)
99 *
100 * Source: http://geodesie.ign.fr/contenu/fichiers/Changement_systeme_geodesique.pdf
101 */
102 public static final ProjectionChoice lambert = new LambertProjectionChoice();
103
104 /**
105 * French departements in the Caribbean Sea and Indian Ocean.
106 *
107 * Using the UTM transvers Mercator projection and specific geodesic settings.
108 */
109 public static final ProjectionChoice utm_france_dom = new UTMFranceDOMProjectionChoice();
110
111 /**
112 * Lambert Conic Conform 9 Zones projection.
113 *
114 * As specified by the IGN in this document
115 * http://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/cc9zones.pdf
116 */
117 public static final ProjectionChoice lambert_cc9 = new LambertCC9ZonesProjectionChoice();
118
119 static {
120
121 /************************
122 * Global projections.
123 */
124
125 /**
126 * UTM.
127 */
128 registerProjectionChoice(new UTMProjectionChoice());
129
130 /************************
131 * Regional - alphabetical order by country code.
132 */
133
134 /**
135 * Belgian Lambert 72 projection.
136 *
137 * As specified by the Belgian IGN in this document:
138 * http://www.ngi.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf
139 *
140 * @author Don-vip
141 */
142 registerProjectionChoice(tr("Belgian Lambert 1972"), "core:belgianLambert1972", 31370); // BE
143
144 /**
145 * Belgian Lambert 2008 projection.
146 *
147 * As specified by the Belgian IGN in this document:
148 * http://www.ngi.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf
149 *
150 * @author Don-vip
151 */
152 registerProjectionChoice(tr("Belgian Lambert 2008"), "core:belgianLambert2008", 3812); // BE
153
154 /**
155 * SwissGrid CH1903 / L03, see https://en.wikipedia.org/wiki/Swiss_coordinate_system.
156 *
157 * Actually, what we have here, is CH1903+ (EPSG:2056), but without
158 * the additional false easting of 2000km and false northing 1000 km.
159 *
160 * To get to CH1903, a shift file is required. So currently, there are errors
161 * up to 1.6m (depending on the location).
162 */
163 registerProjectionChoice(new SwissGridProjectionChoice()); // CH
164
165 registerProjectionChoice(new GaussKruegerProjectionChoice()); // DE
166
167 /**
168 * Estonian Coordinate System of 1997.
169 *
170 * Thanks to Johan Montagnat and its geoconv java converter application
171 * (https://www.i3s.unice.fr/~johan/gps/ , published under GPL license)
172 * from which some code and constants have been reused here.
173 */
174 registerProjectionChoice(tr("Lambert Zone (Estonia)"), "core:lambertest", 3301); // EE
175
176 /**
177 * Lambert conic conform 4 zones using the French geodetic system NTF.
178 *
179 * This newer version uses the grid translation NTF<->RGF93 provided by IGN for a submillimetric accuracy.
180 * (RGF93 is the French geodetic system similar to WGS84 but not mathematically equal)
181 *
182 * Source: http://geodesie.ign.fr/contenu/fichiers/Changement_systeme_geodesique.pdf
183 * @author Pieren
184 */
185 registerProjectionChoice(lambert); // FR
186
187 /**
188 * Lambert 93 projection.
189 *
190 * As specified by the IGN in this document
191 * http://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/Lambert-93.pdf
192 * @author Don-vip
193 */
194 registerProjectionChoice(tr("Lambert 93 (France)"), "core:lambert93", 2154); // FR
195
196 /**
197 * Lambert Conic Conform 9 Zones projection.
198 *
199 * As specified by the IGN in this document
200 * http://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/cc9zones.pdf
201 * @author Pieren
202 */
203 registerProjectionChoice(lambert_cc9); // FR
204
205 /**
206 * French departements in the Caribbean Sea and Indian Ocean.
207 *
208 * Using the UTM transvers Mercator projection and specific geodesic settings.
209 */
210 registerProjectionChoice(utm_france_dom); // FR
211
212 /**
213 * LKS-92/ Latvia TM projection.
214 *
215 * Based on data from spatialreference.org.
216 * http://spatialreference.org/ref/epsg/3059/
217 *
218 * @author Viesturs Zarins
219 */
220 registerProjectionChoice(tr("LKS-92 (Latvia TM)"), "core:tmerclv", 3059); // LV
221
222 /**
223 * Netherlands RD projection
224 *
225 * @author vholten
226 */
227 registerProjectionChoice(tr("Rijksdriehoekscoördinaten (Netherlands)"), "core:dutchrd", 28992); // NL
228
229 /**
230 * PUWG 1992 and 2000 are the official cordinate systems in Poland.
231 *
232 * They use the same math as UTM only with different constants.
233 *
234 * @author steelman
235 */
236 registerProjectionChoice(new PuwgProjectionChoice()); // PL
237
238 /**
239 * SWEREF99 13 30 projection. Based on data from spatialreference.org.
240 * http://spatialreference.org/ref/epsg/3008/
241 *
242 * @author Hanno Hecker
243 */
244 registerProjectionChoice(tr("SWEREF99 13 30 / EPSG:3008 (Sweden)"), "core:sweref99", 3008); // SE
245
246 /************************
247 * Projection by Code.
248 */
249 registerProjectionChoice(new CodeProjectionChoice());
250
251 /************************
252 * Custom projection.
253 */
254 registerProjectionChoice(new CustomProjectionChoice());
255 }
256
257 public static void registerProjectionChoice(ProjectionChoice c) {
258 projectionChoices.add(c);
259 projectionChoicesById.put(c.getId(), c);
260 for (String code : c.allCodes()) {
261 Projections.registerProjectionSupplier(code, () -> {
262 Collection<String> pref = c.getPreferencesFromCode(code);
263 c.setPreferences(pref);
264 try {
265 return c.getProjection();
266 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) {
267 Logging.log(Logging.LEVEL_WARN, "Unable to get projection "+code+" with "+c+':', e);
268 return null;
269 }
270 });
271 }
272 }
273
274 public static ProjectionChoice registerProjectionChoice(String name, String id, Integer epsg, String cacheDir) {
275 ProjectionChoice pc = new SingleProjectionChoice(name, id, "EPSG:"+epsg, cacheDir);
276 registerProjectionChoice(pc);
277 return pc;
278 }
279
280 private static ProjectionChoice registerProjectionChoice(String name, String id, Integer epsg) {
281 ProjectionChoice pc = new SingleProjectionChoice(name, id, "EPSG:"+epsg);
282 registerProjectionChoice(pc);
283 return pc;
284 }
285
286 public static List<ProjectionChoice> getProjectionChoices() {
287 return Collections.unmodifiableList(projectionChoices);
288 }
289
290 private static String projectionChoice;
291
292 private static final StringProperty PROP_PROJECTION_DEFAULT = new StringProperty("projection.default", mercator.getId());
293 private static final StringProperty PROP_COORDINATES = new StringProperty("coordinates", null);
294 private static final ListProperty PROP_SUB_PROJECTION_DEFAULT = new ListProperty("projection.default.sub", null);
295 private static final String[] unitsValues = ALL_SYSTEMS.keySet().toArray(new String[ALL_SYSTEMS.size()]);
296 private static final String[] unitsValuesTr = new String[unitsValues.length];
297 static {
298 for (int i = 0; i < unitsValues.length; ++i) {
299 unitsValuesTr[i] = tr(unitsValues[i]);
300 }
301 }
302
303 /**
304 * Combobox with all projections available
305 */
306 private final JosmComboBox<ProjectionChoice> projectionCombo;
307
308 /**
309 * Combobox with all coordinate display possibilities
310 */
311 private final JosmComboBox<ICoordinateFormat> coordinatesCombo;
312
313 private final JosmComboBox<String> unitsCombo = new JosmComboBox<>(unitsValuesTr);
314
315 /**
316 * This variable holds the JPanel with the projection's preferences. If the
317 * selected projection does not implement this, it will be set to an empty
318 * Panel.
319 */
320 private JPanel projSubPrefPanel;
321 private final JPanel projSubPrefPanelWrapper = new JPanel(new GridBagLayout());
322
323 private final JLabel projectionCodeLabel = new JLabel(tr("Projection code"));
324 private final Component projectionCodeGlue = GBC.glue(5, 0);
325 private final JLabel projectionCode = new JLabel();
326 private final JLabel projectionNameLabel = new JLabel(tr("Projection name"));
327 private final Component projectionNameGlue = GBC.glue(5, 0);
328 private final JLabel projectionName = new JLabel();
329 private final JLabel bounds = new JLabel();
330
331 /**
332 * This is the panel holding all projection preferences
333 */
334 private final VerticallyScrollablePanel projPanel = new VerticallyScrollablePanel(new GridBagLayout());
335
336 /**
337 * The GridBagConstraints for the Panel containing the ProjectionSubPrefs.
338 * This is required twice in the code, creating it here keeps both occurrences
339 * in sync
340 */
341 private static final GBC projSubPrefPanelGBC = GBC.std().fill(GBC.BOTH).weight(1.0, 1.0);
342
343 public ProjectionPreference() {
344 this.projectionCombo = new JosmComboBox<>(
345 projectionChoices.toArray(new ProjectionChoice[projectionChoices.size()]));
346 this.coordinatesCombo = new JosmComboBox<>(
347 CoordinateFormatManager.getCoordinateFormats().toArray(new ICoordinateFormat[0]));
348 }
349
350 @Override
351 public void addGui(PreferenceTabbedPane gui) {
352 final ProjectionChoice pc = setupProjectionCombo();
353
354 for (int i = 0; i < coordinatesCombo.getItemCount(); ++i) {
355 if (coordinatesCombo.getItemAt(i).getId().equals(PROP_COORDINATES.get())) {
356 coordinatesCombo.setSelectedIndex(i);
357 break;
358 }
359 }
360
361 for (int i = 0; i < unitsValues.length; ++i) {
362 if (unitsValues[i].equals(SystemOfMeasurement.PROP_SYSTEM_OF_MEASUREMENT.get())) {
363 unitsCombo.setSelectedIndex(i);
364 break;
365 }
366 }
367
368 projPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
369 projPanel.add(new JLabel(tr("Projection method")), GBC.std().insets(5, 5, 0, 5));
370 projPanel.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
371 projPanel.add(projectionCombo, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5));
372 projPanel.add(projectionCodeLabel, GBC.std().insets(25, 5, 0, 5));
373 projPanel.add(projectionCodeGlue, GBC.std().fill(GBC.HORIZONTAL));
374 projPanel.add(projectionCode, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5));
375 projPanel.add(projectionNameLabel, GBC.std().insets(25, 5, 0, 5));
376 projPanel.add(projectionNameGlue, GBC.std().fill(GBC.HORIZONTAL));
377 projPanel.add(projectionName, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5));
378 projPanel.add(new JLabel(tr("Bounds")), GBC.std().insets(25, 5, 0, 5));
379 projPanel.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
380 projPanel.add(bounds, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5));
381 projPanel.add(projSubPrefPanelWrapper, GBC.eol().fill(GBC.HORIZONTAL).insets(20, 5, 5, 5));
382
383 projectionCodeLabel.setLabelFor(projectionCode);
384 projectionNameLabel.setLabelFor(projectionName);
385
386 JButton btnSetAsDefault = new JButton(tr("Set as default"));
387 projPanel.add(btnSetAsDefault, GBC.eol().insets(5, 10, 5, 5));
388 btnSetAsDefault.addActionListener(e -> {
389 ProjectionChoice pc2 = (ProjectionChoice) projectionCombo.getSelectedItem();
390 String id = pc2.getId();
391 Collection<String> prefs = pc2.getPreferences(projSubPrefPanel);
392 setProjection(id, prefs, true);
393 pc2.setPreferences(prefs);
394 Projection proj = pc2.getProjection();
395 new ExtendedDialog(gui, tr("Default projection"), tr("OK"))
396 .setButtonIcons("ok")
397 .setIcon(JOptionPane.INFORMATION_MESSAGE)
398 .setContent(tr("Default projection has been set to ''{0}''", proj.toCode()))
399 .showDialog();
400 });
401 ExpertToggleAction.addVisibilitySwitcher(btnSetAsDefault);
402
403 projPanel.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(0, 5, 0, 10));
404 projPanel.add(new JLabel(tr("Display coordinates as")), GBC.std().insets(5, 5, 0, 5));
405 projPanel.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
406 projPanel.add(coordinatesCombo, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5));
407 projPanel.add(new JLabel(tr("System of measurement")), GBC.std().insets(5, 5, 0, 5));
408 projPanel.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
409 projPanel.add(unitsCombo, GBC.eop().fill(GBC.HORIZONTAL).insets(0, 5, 5, 5));
410 projPanel.add(GBC.glue(1, 1), GBC.std().fill(GBC.HORIZONTAL).weight(1.0, 1.0));
411
412 gui.getMapPreference().addSubTab(this, tr("Map Projection"), projPanel.getVerticalScrollPane());
413
414 selectedProjectionChanged(pc);
415 }
416
417 private void updateMeta(ProjectionChoice pc) {
418 pc.setPreferences(pc.getPreferences(projSubPrefPanel));
419 Projection proj = pc.getProjection();
420 projectionCode.setText(proj.toCode());
421 projectionName.setText(proj.toString());
422 Bounds b = proj.getWorldBoundsLatLon();
423 ICoordinateFormat cf = CoordinateFormatManager.getDefaultFormat();
424 bounds.setText(cf.lonToString(b.getMin()) + ", " + cf.latToString(b.getMin()) + " : " +
425 cf.lonToString(b.getMax()) + ", " + cf.latToString(b.getMax()));
426 boolean showCode = true;
427 boolean showName = false;
428 if (pc instanceof SubPrefsOptions) {
429 showCode = ((SubPrefsOptions) pc).showProjectionCode();
430 showName = ((SubPrefsOptions) pc).showProjectionName();
431 }
432 projectionCodeLabel.setVisible(showCode);
433 projectionCodeGlue.setVisible(showCode);
434 projectionCode.setVisible(showCode);
435 projectionNameLabel.setVisible(showName);
436 projectionNameGlue.setVisible(showName);
437 projectionName.setVisible(showName);
438 }
439
440 @Override
441 public boolean ok() {
442 ProjectionChoice pc = (ProjectionChoice) projectionCombo.getSelectedItem();
443
444 String id = pc.getId();
445 Collection<String> prefs = pc.getPreferences(projSubPrefPanel);
446
447 setProjection(id, prefs, false);
448
449 if (PROP_COORDINATES.put(((ICoordinateFormat) coordinatesCombo.getSelectedItem()).getId())) {
450 CoordinateFormatManager.setCoordinateFormat((ICoordinateFormat) coordinatesCombo.getSelectedItem());
451 }
452
453 int i = unitsCombo.getSelectedIndex();
454 SystemOfMeasurement.setSystemOfMeasurement(unitsValues[i]);
455
456 return false;
457 }
458
459 public static void setProjection() {
460 setProjection(PROP_PROJECTION_DEFAULT.get(), PROP_SUB_PROJECTION_DEFAULT.get(), false);
461 }
462
463 /**
464 * Set projection.
465 * @param id id of the selected projection choice
466 * @param pref the configuration for the selected projection choice
467 * @param makeDefault true, if it is to be set as permanent default
468 * false, if it is to be set for the current session
469 * @since 12306
470 */
471 public static void setProjection(String id, Collection<String> pref, boolean makeDefault) {
472 ProjectionChoice pc = projectionChoicesById.get(id);
473
474 if (pc == null) {
475 JOptionPane.showMessageDialog(
476 Main.parent,
477 tr("The projection {0} could not be activated. Using Mercator", id),
478 tr("Error"),
479 JOptionPane.ERROR_MESSAGE
480 );
481 pref = null;
482 pc = mercator;
483 }
484 id = pc.getId();
485 Config.getPref().putList("projection.sub."+id, pref == null ? null : new ArrayList<>(pref));
486 if (makeDefault) {
487 PROP_PROJECTION_DEFAULT.put(id);
488 PROP_SUB_PROJECTION_DEFAULT.put(pref == null ? null : new ArrayList<>(pref));
489 } else {
490 projectionChoice = id;
491 }
492 pc.setPreferences(pref);
493 Projection proj = pc.getProjection();
494 Main.setProjection(proj);
495 }
496
497 /**
498 * Handles all the work related to update the projection-specific
499 * preferences
500 * @param pc the choice class representing user selection
501 */
502 private void selectedProjectionChanged(final ProjectionChoice pc) {
503 // Don't try to update if we're still starting up
504 int size = projPanel.getComponentCount();
505 if (size < 1)
506 return;
507
508 final ActionListener listener = e -> updateMeta(pc);
509
510 // Replace old panel with new one
511 projSubPrefPanelWrapper.removeAll();
512 projSubPrefPanel = pc.getPreferencePanel(listener);
513 projSubPrefPanelWrapper.add(projSubPrefPanel, projSubPrefPanelGBC);
514 projPanel.revalidate();
515 projSubPrefPanel.repaint();
516 updateMeta(pc);
517 }
518
519 /**
520 * Sets up projection combobox with default values and action listener
521 * @return the choice class for user selection
522 */
523 private ProjectionChoice setupProjectionCombo() {
524 String pcId = getCurrentProjectionChoiceId();
525 ProjectionChoice pc = null;
526 for (int i = 0; i < projectionCombo.getItemCount(); ++i) {
527 ProjectionChoice pc1 = projectionCombo.getItemAt(i);
528 pc1.setPreferences(getSubprojectionPreference(pc1.getId()));
529 if (pc1.getId().equals(pcId)) {
530 projectionCombo.setSelectedIndex(i);
531 selectedProjectionChanged(pc1);
532 pc = pc1;
533 }
534 }
535 // If the ProjectionChoice from the preferences is not available, it
536 // should have been set to Mercator at JOSM start.
537 if (pc == null)
538 throw new JosmRuntimeException("Couldn't find the current projection in the list of available projections!");
539
540 projectionCombo.addActionListener(e -> {
541 ProjectionChoice pc1 = (ProjectionChoice) projectionCombo.getSelectedItem();
542 selectedProjectionChanged(pc1);
543 });
544 return pc;
545 }
546
547 /**
548 * Get the id of the projection choice that is currently set.
549 * @return id of the projection choice that is currently set
550 */
551 public static String getCurrentProjectionChoiceId() {
552 return projectionChoice != null ? projectionChoice : PROP_PROJECTION_DEFAULT.get();
553 }
554
555 /**
556 * Get the preferences that have been selected the last time for the given
557 * projection choice.
558 * @param pcId id of the projection choice
559 * @return projection choice parameters that have been selected by the user
560 * the last time; null if user has never selected the given projection choice
561 */
562 public static Collection<String> getSubprojectionPreference(String pcId) {
563 return Config.getPref().getList("projection.sub."+pcId, null);
564 }
565
566 @Override
567 public boolean isExpert() {
568 return false;
569 }
570
571 @Override
572 public TabPreferenceSetting getTabPreferenceSetting(final PreferenceTabbedPane gui) {
573 return gui.getMapPreference();
574 }
575
576 /**
577 * Selects the given projection.
578 * @param projection The projection to select.
579 * @since 5604
580 */
581 public void selectProjection(ProjectionChoice projection) {
582 if (projectionCombo != null && projection != null) {
583 projectionCombo.setSelectedItem(projection);
584 }
585 }
586}
Note: See TracBrowser for help on using the repository browser.