Changeset 5546 in josm
- Timestamp:
- 2012-11-01T11:33:12+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/preferences/projection
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
r5248 r5546 38 38 import org.openstreetmap.josm.tools.Utils; 39 39 40 public class CustomProjectionChoice extends AbstractProjectionChoice implements Alias,SubPrefsOptions {40 public class CustomProjectionChoice extends AbstractProjectionChoice implements SubPrefsOptions { 41 41 42 42 private String pref; … … 230 230 231 231 @Override 232 public String getAlias() {233 return "org.openstreetmap.josm.data.projection.CustomProjectionPrefGui";234 }235 236 @Override237 232 public boolean showProjectionCode() { 238 233 return false; -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java
r5236 r5546 10 10 import org.openstreetmap.josm.data.projection.Projection; 11 11 12 public class GaussKruegerProjectionChoice extends ListProjectionChoice implements Alias{12 public class GaussKruegerProjectionChoice extends ListProjectionChoice { 13 13 14 14 private static String[] zones = { "2", "3", "4", "5" }; … … 57 57 } 58 58 59 @Override60 public String getAlias() {61 return GaussKrueger.class.getName();62 }63 64 59 } -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java
r5236 r5546 16 16 import org.openstreetmap.josm.tools.ImageProvider; 17 17 18 public class LambertCC9ZonesProjectionChoice extends ListProjectionChoice implements Alias{18 public class LambertCC9ZonesProjectionChoice extends ListProjectionChoice { 19 19 20 20 private static String[] lambert9zones = { … … 88 88 } 89 89 90 @Override91 public String getAlias() {92 return LambertCC9Zones.class.getName();93 }94 95 90 } -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java
r5236 r5546 16 16 import org.openstreetmap.josm.tools.ImageProvider; 17 17 18 public class LambertProjectionChoice extends ListProjectionChoice implements Alias{18 public class LambertProjectionChoice extends ListProjectionChoice { 19 19 20 20 public static String[] lambert4zones = { … … 82 82 } 83 83 84 @Override85 public String getAlias() {86 return Lambert.class.getName();87 }88 89 84 } -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r5429 r5546 55 55 private static List<ProjectionChoice> projectionChoices = new ArrayList<ProjectionChoice>(); 56 56 private static Map<String, ProjectionChoice> projectionChoicesById = new HashMap<String, ProjectionChoice>(); 57 private static Map<String, String> aliasNormalizer = new HashMap<String, String>();58 57 59 58 public static ProjectionChoice mercator = new SingleProjectionChoice("core:mercator", new Mercator()); … … 82 81 projectionChoices.add(c); 83 82 projectionChoicesById.put(c.getId(), c); 84 aliasNormalizer.put(c.getId(), c.getId());85 if (c instanceof Alias) {86 String alias = ((Alias) c).getAlias();87 projectionChoicesById.put(alias, c);88 aliasNormalizer.put(alias, c.getId());89 }90 83 } 91 84 … … 288 281 ProjectionChoice pc1 = (ProjectionChoice) projectionCombo.getItemAt(i); 289 282 pc1.setPreferences(getSubprojectionPreference(pc1)); 290 if (pc1.getId().equals( aliasNormalizer.get(PROP_PROJECTION.get()))) {283 if (pc1.getId().equals(PROP_PROJECTION.get())) { 291 284 projectionCombo.setSelectedIndex(i); 292 285 selectedProjectionChanged(pc1); … … 309 302 310 303 private Collection<String> getSubprojectionPreference(ProjectionChoice pc) { 311 Collection<String> c1 = Main.pref.getCollection("projection.sub."+pc.getId(), null); 312 if (c1 != null) 313 return c1; 314 if (pc instanceof Alias) { 315 String alias = ((Alias) pc).getAlias(); 316 String sname = alias.substring(alias.lastIndexOf(".")+1); 317 return Main.pref.getCollection("projection.sub."+sname, null); 318 } 319 return null; 304 return Main.pref.getCollection("projection.sub."+pc.getId(), null); 320 305 } 321 306 -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/PuwgProjectionChoice.java
r5236 r5546 10 10 import org.openstreetmap.josm.data.projection.Puwg; 11 11 12 public class PuwgProjectionChoice extends ListProjectionChoice implements Alias{12 public class PuwgProjectionChoice extends ListProjectionChoice { 13 13 14 14 public PuwgProjectionChoice() { … … 40 40 41 41 @Override 42 public String getAlias() {43 return Puwg.class.getName();44 }45 46 @Override47 42 protected String indexToZone(int index) { 48 43 return Puwg.zones[index].toCode(); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/SingleProjectionChoice.java
r5234 r5546 15 15 * The GUI is an empty panel. 16 16 */ 17 public class SingleProjectionChoice implements ProjectionChoice , Alias{17 public class SingleProjectionChoice implements ProjectionChoice { 18 18 19 19 private String id; … … 72 72 return null; 73 73 } 74 75 @Override76 public String getAlias() {77 return projection.getClass().getName();78 }79 74 } -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
r5236 r5546 20 20 import org.openstreetmap.josm.tools.GBC; 21 21 22 public class UTMProjectionChoice extends ListProjectionChoice implements Alias{22 public class UTMProjectionChoice extends ListProjectionChoice { 23 23 24 24 private static final UTM.Hemisphere DEFAULT_HEMISPHERE = UTM.Hemisphere.North; … … 148 148 } 149 149 150 @Override151 public String getAlias() {152 return UTM.class.getName();153 }154 155 150 } -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTM_France_DOM_ProjectionChoice.java
r5236 r5546 10 10 import org.openstreetmap.josm.data.projection.UTM_France_DOM; 11 11 12 public class UTM_France_DOM_ProjectionChoice extends ListProjectionChoice implements Alias{12 public class UTM_France_DOM_ProjectionChoice extends ListProjectionChoice { 13 13 14 14 private final static String FortMarigotName = tr("Guadeloupe Fort-Marigot 1949"); … … 58 58 } 59 59 60 @Override61 public String getAlias() {62 return UTM_France_DOM.class.getName();63 }64 65 60 }
Note:
See TracChangeset
for help on using the changeset viewer.