Changeset 31518 in osm for applications/editors/josm/plugins/mapillary/src/org
- Timestamp:
- 2015-08-21T22:43:38+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/CacheUtils.java
r31501 r31518 1 1 package org.openstreetmap.josm.plugins.mapillary.cache; 2 2 3 import java.io.IOException; 4 5 import org.openstreetmap.josm.Main; 3 6 import org.openstreetmap.josm.data.cache.CacheEntry; 4 7 import org.openstreetmap.josm.data.cache.CacheEntryAttributes; … … 41 44 * in cache. 42 45 * 43 * @param img The image to be downloaded. 46 * @param img 47 * The image to be downloaded. 44 48 * @param pic 45 49 * The picture type to be downloaded (full quality, thumbnail or … … 51 55 if (new MapillaryCache(img.getKey(), MapillaryCache.Type.THUMBNAIL) 52 56 .get() == null) 53 new MapillaryCache(img.getKey(), MapillaryCache.Type.THUMBNAIL) 54 .submit(IGNORE_DOWNLOAD, false); 57 submit(img.getKey(), MapillaryCache.Type.THUMBNAIL, IGNORE_DOWNLOAD); 55 58 if (new MapillaryCache(img.getKey(), MapillaryCache.Type.FULL_IMAGE) 56 59 .get() == null) 57 new MapillaryCache(img.getKey(), MapillaryCache.Type.FULL_IMAGE) 58 .submit(IGNORE_DOWNLOAD, false); 60 submit(img.getKey(), MapillaryCache.Type.FULL_IMAGE, IGNORE_DOWNLOAD); 59 61 break; 60 62 case THUMBNAIL: 61 new MapillaryCache(img.getKey(), MapillaryCache.Type.THUMBNAIL).submit( 62 IGNORE_DOWNLOAD, false); 63 submit(img.getKey(), MapillaryCache.Type.THUMBNAIL, IGNORE_DOWNLOAD); 63 64 break; 64 65 case FULL_IMAGE: 65 new MapillaryCache(img.getKey(), MapillaryCache.Type.FULL_IMAGE) 66 .submit(IGNORE_DOWNLOAD, false); 66 submit(img.getKey(), MapillaryCache.Type.FULL_IMAGE, IGNORE_DOWNLOAD); 67 67 break; 68 } 69 } 70 71 /** 72 * Requests the picture with the given key and quality and uses the given 73 * listener. 74 * 75 * @param key 76 * The key of the picture to be requested. 77 * @param type 78 * The quality of the picture to be requested. 79 * @param lis 80 * The listener that is going to receive the picture. 81 */ 82 public static void submit(String key, MapillaryCache.Type type, 83 ICachedLoaderListener lis) { 84 try { 85 new MapillaryCache(key, type).submit(lis, false); 86 } catch (IOException e) { 87 Main.error(e); 68 88 } 69 89 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
r31513 r31518 244 244 this.thumbnailCache = new MapillaryCache(mapillaryImage.getKey(), 245 245 MapillaryCache.Type.THUMBNAIL); 246 this.thumbnailCache.submit(this, false); 246 try { 247 this.thumbnailCache.submit(this, false); 248 } catch (IOException e) { 249 Main.error(e); 250 } 247 251 248 252 // Downloads the full resolution image. … … 252 256 this.imageCache = new MapillaryCache(mapillaryImage.getKey(), 253 257 MapillaryCache.Type.FULL_IMAGE); 254 this.imageCache.submit(this, false); 258 try { 259 this.imageCache.submit(this, false); 260 } catch (IOException e) { 261 Main.error(e); 262 } 255 263 } 256 264 } else if (this.image instanceof MapillaryImportedImage) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/export/MapillaryExportDownloadThread.java
r31515 r31518 14 14 import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage; 15 15 import org.openstreetmap.josm.plugins.mapillary.MapillaryImage; 16 import org.openstreetmap.josm.plugins.mapillary.cache.CacheUtils; 16 17 import org.openstreetmap.josm.plugins.mapillary.cache.MapillaryCache; 17 18 … … 54 55 @Override 55 56 public void run() { 56 new MapillaryCache(this.image.getKey(), MapillaryCache.Type.FULL_IMAGE) 57 .submit(this, false); 57 CacheUtils.submit(this.image.getKey(), MapillaryCache.Type.FULL_IMAGE, this); 58 58 } 59 59
Note:
See TracChangeset
for help on using the changeset viewer.