Changeset 10805 in josm for trunk/src/org/openstreetmap/josm/gui/MapViewState.java
- Timestamp:
- 2016-08-15T14:45:38+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapViewState.java
r10651 r10805 17 17 import org.openstreetmap.josm.data.coor.EastNorth; 18 18 import org.openstreetmap.josm.data.coor.LatLon; 19 import org.openstreetmap.josm.data.projection.Projecting; 19 20 import org.openstreetmap.josm.data.projection.Projection; 20 21 import org.openstreetmap.josm.gui.download.DownloadDialog; … … 28 29 public final class MapViewState { 29 30 30 private final Projecti on projection;31 private final Projecting projecting; 31 32 32 33 private final int viewWidth; … … 51 52 * @param topLeft The top left corner in east/north space. 52 53 */ 53 private MapViewState(Projecti onprojection, int viewWidth, int viewHeight, double scale, EastNorth topLeft) {54 this.projecti on= projection;54 private MapViewState(Projecting projection, int viewWidth, int viewHeight, double scale, EastNorth topLeft) { 55 this.projecting = projection; 55 56 this.scale = scale; 56 57 this.topLeft = topLeft; … … 63 64 64 65 private MapViewState(EastNorth topLeft, MapViewState mapViewState) { 65 this.projecti on = mapViewState.projection;66 this.projecting = mapViewState.projecting; 66 67 this.scale = mapViewState.scale; 67 68 this.topLeft = topLeft; … … 74 75 75 76 private MapViewState(double scale, MapViewState mapViewState) { 76 this.projecti on = mapViewState.projection;77 this.projecting = mapViewState.projecting; 77 78 this.scale = scale; 78 79 this.topLeft = mapViewState.topLeft; … … 85 86 86 87 private MapViewState(JComponent position, MapViewState mapViewState) { 87 this.projecti on = mapViewState.projection;88 this.projecting = mapViewState.projecting; 88 89 this.scale = mapViewState.scale; 89 90 this.topLeft = mapViewState.topLeft; … … 106 107 } 107 108 108 private MapViewState(Projecti on projection, MapViewState mapViewState) {109 this.projecti on = projection;109 private MapViewState(Projecting projecting, MapViewState mapViewState) { 110 this.projecting = projecting; 110 111 this.scale = mapViewState.scale; 111 112 this.topLeft = mapViewState.topLeft; … … 201 202 */ 202 203 public Projection getProjection() { 203 return projecti on;204 return projecting.getBaseProjection(); 204 205 } 205 206 … … 269 270 */ 270 271 public MapViewState usingProjection(Projection projection) { 271 if (projection.equals(this.projecti on)) {272 if (projection.equals(this.projecting)) { 272 273 return this; 273 274 } else { … … 358 359 * Gets the current position in LatLon coordinates according to the current projection. 359 360 * @return The positon as LatLon. 361 * @see #getLatLonClamped() 360 362 */ 361 363 public LatLon getLatLon() { 362 return projection.eastNorth2latlon(getEastNorth()); 364 return projecting.getBaseProjection().eastNorth2latlon(getEastNorth()); 365 } 366 367 /** 368 * Gets the latlon coordinate clamped to the current world area. 369 * @return The lat/lon coordinate 370 * @since 10805 371 */ 372 public LatLon getLatLonClamped() { 373 return projecting.eastNorth2latlonClamped(getEastNorth()); 363 374 } 364 375 … … 474 485 */ 475 486 public Bounds getLatLonBoundsBox() { 476 return projection.getLatLonBoundsBox(getProjectionBounds()); 487 // TODO @michael2402: Use hillclimb. 488 return projecting.getBaseProjection().getLatLonBoundsBox(getProjectionBounds()); 477 489 } 478 490
Note:
See TracChangeset
for help on using the changeset viewer.