Changeset 34616 in osm for applications/viewer/jmapviewer/src/org
- Timestamp:
- 2018-09-02T19:25:17+02:00 (6 years ago)
- Location:
- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Coordinate.java
r34084 r34616 20 20 private transient Point2D.Double data; 21 21 22 /** 23 * Constructs a new {@code Coordinate}. 24 * @param lat latitude in degrees 25 * @param lon longitude in degrees 26 */ 22 27 public Coordinate(double lat, double lon) { 23 28 data = new Point2D.Double(lon, lat); … … 62 67 @Override 63 68 public int hashCode() { 64 int hash = 3; 65 hash = 61 * hash + Objects.hashCode(this.data); 66 return hash; 69 return Objects.hashCode(data); 67 70 } 68 71 69 72 @Override 70 73 public boolean equals(Object obj) { 71 if (obj == null) { 74 if (this == obj) 75 return true; 76 if (obj == null || !(obj instanceof Coordinate)) 72 77 return false; 73 }74 if (getClass() != obj.getClass()) {75 return false;76 }77 78 final Coordinate other = (Coordinate) obj; 78 return Objects.equals( this.data, other.data);79 return Objects.equals(data, other.data); 79 80 } 80 81 } -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Projected.java
r33286 r34616 53 53 @Override 54 54 public int hashCode() { 55 int hash = 3; 56 hash = 61 * hash + Objects.hashCode(this.data); 57 return hash; 55 return Objects.hashCode(data); 58 56 } 59 57 60 58 @Override 61 59 public boolean equals(Object obj) { 62 if (obj == null) { 60 if (this == obj) 61 return true; 62 if (obj == null || !(obj instanceof Projected)) 63 63 return false; 64 }65 if (getClass() != obj.getClass()) {66 return false;67 }68 64 final Projected other = (Projected) obj; 69 return Objects.equals( this.data, other.data);65 return Objects.equals(data, other.data); 70 66 } 71 67 } 72 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java
r33286 r34616 10 10 import java.util.HashMap; 11 11 import java.util.Map; 12 import java.util.Objects; 12 13 import java.util.concurrent.Callable; 13 14 … … 340 341 if (this == obj) 341 342 return true; 342 if (obj == null )343 if (obj == null || !(obj instanceof Tile)) 343 344 return false; 344 if (getClass() != obj.getClass()) 345 return false; 346 Tile other = (Tile) obj; 347 if (xtile != other.xtile) 348 return false; 349 if (ytile != other.ytile) 350 return false; 351 if (zoom != other.zoom) 352 return false; 353 return getTileSource().equals(other.getTileSource()); 345 final Tile other = (Tile) obj; 346 return xtile == other.xtile 347 && ytile == other.ytile 348 && zoom == other.zoom 349 && Objects.equals(source, other.source); 354 350 } 355 351 … … 460 456 loaded = false; 461 457 } 462 463 458 } -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/ICoordinate.java
r31429 r34616 2 2 package org.openstreetmap.gui.jmapviewer.interfaces; 3 3 4 /** 5 * Latitude/Longitude coordinates. 6 */ 4 7 public interface ICoordinate { 5 8 9 /** 10 * Returns latitude. 11 * @return latitude in degrees 12 */ 6 13 double getLat(); 7 14 15 /** 16 * Sets latitude. 17 * @param lat latitude in degrees 18 */ 8 19 void setLat(double lat); 9 20 21 /** 22 * Returns longitude. 23 * @return longitude in degrees 24 */ 10 25 double getLon(); 11 26 27 /** 28 * Sets longitude. 29 * @param lon longitude in degrees 30 */ 12 31 void setLon(double lon); 13 32 } -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java
r34177 r34616 190 190 ec * Math.pow(Math.tan(Math.PI/4 + Math.asin(E * sinl)/2), E); 191 191 double df = 1/(1 - sinl) - ec * E * cosl/((1 - E * sinl) * 192 (Math.sqrt(1 - E * E * sinl * sinl)));192 Math.sqrt(1 - E * E * sinl * sinl)); 193 193 194 194 return f/df;
Note:
See TracChangeset
for help on using the changeset viewer.