Changeset 8714 in josm for trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java
- Timestamp:
- 2015-09-01T22:57:30+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java
r8624 r8714 10 10 11 11 import org.openstreetmap.gui.jmapviewer.tilesources.BingAerialTileSource; 12 import org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo; 12 13 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.gui.util.GuiHelper; 13 15 import org.openstreetmap.josm.io.CacheCustomContent; 14 16 import org.openstreetmap.josm.io.UTFInputStreamReader; … … 23 25 */ 24 26 public class CachedAttributionBingAerialTileSource extends BingAerialTileSource { 27 private Runnable attributionDownloadedTask; 28 25 29 /** 26 30 * Creates tile source … … 30 34 super(info); 31 35 } 36 37 /** 38 * Creates tile source 39 * @param info ImageryInfo description of this tile source 40 * @param attributionDownloadedTask runnable to be executed once attribution is loaded 41 */ 42 43 public CachedAttributionBingAerialTileSource(TileSourceInfo info, Runnable attributionDownloadedTask) { 44 super(info); 45 this.attributionDownloadedTask = attributionDownloadedTask; 46 } 47 32 48 33 49 class BingAttributionData extends CacheCustomContent<IOException> { … … 59 75 try { 60 76 String xml = attributionLoader.updateIfRequiredString(); 61 return parseAttributionText(new InputSource(new StringReader((xml)))); 77 List<Attribution> ret = parseAttributionText(new InputSource(new StringReader((xml)))); 78 if (attributionDownloadedTask != null) { 79 GuiHelper.runInEDT(attributionDownloadedTask); 80 attributionDownloadedTask = null; 81 } 82 return ret; 62 83 } catch (IOException ex) { 63 84 Main.warn("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds.");
Note:
See TracChangeset
for help on using the changeset viewer.