Changeset 13182 in josm for trunk/src/org
- Timestamp:
- 2017-12-02T18:51:17+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r13173 r13182 63 63 protected String name; 64 64 protected String code; 65 protected String cacheDir;66 65 protected Bounds bounds; 67 66 private double metersPerUnitWMTS; -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/AbstractProjectionChoice.java
r13173 r13182 11 11 * Super class for ProjectionChoice implementations. 12 12 * <p> 13 * Handles common parameters <code>name</code> , <code>id</code> and <code>cacheDir</code>.13 * Handles common parameters <code>name</code> and <code>id</code>. 14 14 */ 15 15 public abstract class AbstractProjectionChoice implements ProjectionChoice { … … 17 17 protected String name; 18 18 protected String id; 19 protected String cacheDir;20 19 21 20 /** … … 24 23 * @param name short name of the projection choice as shown in the GUI 25 24 * @param id unique identifier for the projection choice 26 * @param cacheDir a cache directory name 25 * @param cacheDir unused 26 * @deprecated use {@link #AbstractProjectionChoice(String, String)} instead 27 27 */ 28 @Deprecated 28 29 public AbstractProjectionChoice(String name, String id, String cacheDir) { 29 this.name = name; 30 this.id = id; 31 this.cacheDir = cacheDir; 30 this(name, id); 32 31 } 33 32 … … 35 34 * Constructs a new {@code AbstractProjectionChoice}. 36 35 * 37 * Only for core projection choices, where chacheDir is the same as38 * the second part of the id.39 36 * @param name short name of the projection choice as shown in the GUI 40 37 * @param id unique identifier for the projection choice 41 38 */ 42 39 public AbstractProjectionChoice(String name, String id) { 43 this(name, id, null); 44 if (!id.startsWith("core:")) throw new IllegalArgumentException(id+" does not start with core:"); 45 this.cacheDir = id.substring(5); 40 this.name = name; 41 this.id = id; 46 42 } 47 43 … … 56 52 } 57 53 54 /** 55 * Returns current projection code. 56 * @return current projection code 57 */ 58 58 public abstract String getCurrentCode(); 59 59 60 /** 61 * Returns projection name. 62 * @return projection name 63 */ 60 64 public abstract String getProjectionName(); 61 65 -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r12846 r13182 80 80 * WGS84: Directly use latitude / longitude values as x/y. 81 81 */ 82 public static final ProjectionChoice wgs84 = registerProjectionChoice(tr("WGS84 Geographic"), "core:wgs84", 4326 , "epsg4326");82 public static final ProjectionChoice wgs84 = registerProjectionChoice(tr("WGS84 Geographic"), "core:wgs84", 4326); 83 83 84 84 /** … … 272 272 } 273 273 274 /** 275 * Registers a new projection choice. 276 * @param name short name of the projection choice as shown in the GUI 277 * @param id short name of the projection choice as shown in the GUI 278 * @param epsg the unique numeric EPSG identifier for the projection 279 * @param cacheDir unused 280 * @return the registered {@link ProjectionChoice} 281 * @deprecated use {@link #registerProjectionChoice(String, String, Integer)} instead 282 */ 283 @Deprecated 274 284 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 285 return registerProjectionChoice(name, id, epsg); 286 } 287 288 /** 289 * Registers a new projection choice. 290 * @param name short name of the projection choice as shown in the GUI 291 * @param id short name of the projection choice as shown in the GUI 292 * @param epsg the unique numeric EPSG identifier for the projection 293 * @return the registered {@link ProjectionChoice} 294 */ 280 295 private static ProjectionChoice registerProjectionChoice(String name, String id, Integer epsg) { 281 296 ProjectionChoice pc = new SingleProjectionChoice(name, id, "EPSG:"+epsg); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/SingleProjectionChoice.java
r10173 r13182 23 23 * @param id unique identifier for the projection choice, e.g. "core:thisproj" 24 24 * @param code the unique identifier for the projection, e.g. "EPSG:1234" 25 * @param cacheDir a cache directory name 25 * @param cacheDir unused 26 * @deprecated use {@link #SingleProjectionChoice(String, String, String)} instead 26 27 */ 28 @Deprecated 27 29 public SingleProjectionChoice(String name, String id, String code, String cacheDir) { 28 super(name, id, cacheDir); 29 this.code = code; 30 this(name, id, code); 30 31 } 31 32
Note:
See TracChangeset
for help on using the changeset viewer.