Changeset 12486 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
- Timestamp:
- 2017-07-22T14:25:19+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r12485 r12486 501 501 */ 502 502 private ProjectionChoice setupProjectionCombo() { 503 String pcId = projectionChoice != null ? projectionChoice : PROP_PROJECTION_DEFAULT.get();503 String pcId = getCurrentProjectionChoiceId(); 504 504 ProjectionChoice pc = null; 505 505 for (int i = 0; i < projectionCombo.getItemCount(); ++i) { 506 506 ProjectionChoice pc1 = projectionCombo.getItemAt(i); 507 pc1.setPreferences(getSubprojectionPreference(pc1 ));507 pc1.setPreferences(getSubprojectionPreference(pc1.getId())); 508 508 if (pc1.getId().equals(pcId)) { 509 509 projectionCombo.setSelectedIndex(i); … … 524 524 } 525 525 526 private static Collection<String> getSubprojectionPreference(ProjectionChoice pc) { 527 return Main.pref.getCollection("projection.sub."+pc.getId(), null); 526 /** 527 * Get the id of the projection choice that is currently set. 528 * @return id of the projection choice that is currently set 529 */ 530 public static String getCurrentProjectionChoiceId() { 531 return projectionChoice != null ? projectionChoice : PROP_PROJECTION_DEFAULT.get(); 532 } 533 534 /** 535 * Get the preferences that have been selected the last time for the given 536 * projection choice. 537 * @param pcId id of the projection choice 538 * @return projection choice parameters that have been selected by the user 539 * the last time; null if user has never selected the given projection choice 540 */ 541 public static Collection<String> getSubprojectionPreference(String pcId) { 542 return Main.pref.getCollection("projection.sub."+pcId, null); 528 543 } 529 544
Note:
See TracChangeset
for help on using the changeset viewer.