Changeset 11188 in josm
- Timestamp:
- 2016-10-30T00:11:11+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/CachedTileLoaderFactory.java
r10651 r11188 14 14 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; 15 15 import org.openstreetmap.josm.data.preferences.StringProperty; 16 import org.openstreetmap.josm.tools.CheckParameterUtil; 16 17 17 18 /** … … 35 36 */ 36 37 public CachedTileLoaderFactory(ICacheAccess<String, BufferedImageCacheEntry> cache, Class<? extends TileLoader> tileLoaderClass) { 38 CheckParameterUtil.ensureParameterNotNull(cache, "cache"); 37 39 this.cache = cache; 38 40 try { -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
r10755 r11188 39 39 import org.openstreetmap.josm.data.imagery.ImageryLayerInfo; 40 40 import org.openstreetmap.josm.data.imagery.TMSCachedTileLoader; 41 import org.openstreetmap.josm.data.imagery.TileLoaderFactory; 41 42 import org.openstreetmap.josm.data.preferences.StringProperty; 42 43 import org.openstreetmap.josm.gui.layer.AbstractCachedTileSourceLayer; … … 128 129 headers.put("User-Agent", Version.getInstance().getFullAgentString()); 129 130 130 cachedLoader = AbstractCachedTileSourceLayer.getTileLoaderFactory("TMS", TMSCachedTileLoader.class).makeTileLoader(this, headers); 131 TileLoaderFactory cachedLoaderFactory = AbstractCachedTileSourceLayer.getTileLoaderFactory("TMS", TMSCachedTileLoader.class); 132 if (cachedLoaderFactory != null) { 133 cachedLoader = cachedLoaderFactory.makeTileLoader(this, headers); 134 } else { 135 cachedLoader = null; 136 } 131 137 132 138 uncachedLoader = new OsmTileLoader(this); … … 206 212 207 213 public final void setFileCacheEnabled(boolean enabled) { 208 if (enabled ) {214 if (enabled && cachedLoader != null) { 209 215 setTileLoader(cachedLoader); 210 216 } else { -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractCachedTileSourceLayer.java
r9860 r11188 113 113 */ 114 114 public static TileLoaderFactory getTileLoaderFactory(String name, Class<? extends TileLoader> klazz) { 115 return new CachedTileLoaderFactory(getCache(name), klazz); 115 CacheAccess<String, BufferedImageCacheEntry> cache = getCache(name); 116 if (cache == null) { 117 return null; 118 } 119 return new CachedTileLoaderFactory(cache, klazz); 116 120 } 117 121
Note:
See TracChangeset
for help on using the changeset viewer.