Changeset 8509 in josm for trunk/src/org/openstreetmap/josm/data/imagery
- Timestamp:
- 2015-06-20T14:36:00+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/imagery
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/Shape.java
r8415 r8509 27 27 String[] components = asString.split(separator); 28 28 if (components.length % 2 != 0) 29 throw new IllegalArgumentException(MessageFormat.format("Even number of doubles expected in string, got {0}: {1}", components.length, asString)); 29 throw new IllegalArgumentException(MessageFormat.format("Even number of doubles expected in string, got {0}: {1}", 30 components.length, asString)); 30 31 for (int i=0; i<components.length; i+=2) { 31 32 addPoint(components[i], components[i+1]); -
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java
r8459 r8509 80 80 * @throws IOException when cache initialization fails 81 81 */ 82 public TMSCachedTileLoader(TileLoaderListener listener, String name, int connectTimeout, int readTimeout, Map<String, String> headers, String cacheDir) throws IOException { 82 public TMSCachedTileLoader(TileLoaderListener listener, String name, int connectTimeout, int readTimeout, 83 Map<String, String> headers, String cacheDir) throws IOException { 83 84 this.cache = JCSCacheManager.getCache(name, 84 85 200, // use fairly small memory cache, as cached objects are quite big, as they contain BufferedImages -
trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
r8470 r8509 98 98 private int totalFileSize; 99 99 private boolean totalFileSizeDirty; // Some file was missing - size needs to be recalculated 100 // No need for hashCode/equals on CacheEntry, object identity is enough. Comparing by values can lead to error - CacheEntry for wrong projection could be found 100 // No need for hashCode/equals on CacheEntry, object identity is enough. 101 // Comparing by values can lead to error - CacheEntry for wrong projection could be found 101 102 private Map<CacheEntry, SoftReference<BufferedImage>> memoryCache = new HashMap<>(); 102 103 private Set<ProjectionBounds> areaToCache; … … 458 459 } 459 460 460 private String generateFileName(ProjectionEntries projectionEntries, double pixelPerDegree, Projection projection, double east, double north, String mimeType) { 461 private String generateFileName(ProjectionEntries projectionEntries, double pixelPerDegree, Projection projection, 462 double east, double north, String mimeType) { 461 463 LatLon ll1 = projection.eastNorth2latlon(new EastNorth(east, north)); 462 464 LatLon ll2 = projection.eastNorth2latlon(new EastNorth(east + 100 / pixelPerDegree, north)); … … 490 492 FILENAME_LOOP: 491 493 while (true) { 492 String result = String.format("%s_%." + precisionLat + "f_%." + precisionLon +"f%s.%s", zoom, ll1.lat(), ll1.lon(), counter==0?"":"_" + counter, extension); 494 String result = String.format("%s_%." + precisionLat + "f_%." + precisionLon +"f%s.%s", 495 zoom, ll1.lat(), ll1.lon(), counter==0?"":"_" + counter, extension); 493 496 for (CacheEntry entry: projectionEntries.entries) { 494 497 if (entry.filename.equals(result)) { … … 511 514 * @throws IOException if any I/O error occurs 512 515 */ 513 public synchronized void saveToCache(BufferedImage img, InputStream imageData, Projection projection, double pixelPerDegree, double east, double north)514 throws IOException {516 public synchronized void saveToCache(BufferedImage img, InputStream imageData, Projection projection, double pixelPerDegree, 517 double east, double north) throws IOException { 515 518 ProjectionEntries projectionEntries = getProjectionEntries(projection); 516 519 CacheEntry entry = findEntry(projectionEntries, pixelPerDegree, east, north);
Note:
See TracChangeset
for help on using the changeset viewer.