Package org.openstreetmap.josm.gui.layer
Class AbstractCachedTileSourceLayer<T extends org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource>
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
-
- org.openstreetmap.josm.gui.layer.Layer
-
- org.openstreetmap.josm.gui.layer.ImageryLayer
-
- org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer<T>
-
- org.openstreetmap.josm.gui.layer.AbstractCachedTileSourceLayer<T>
-
- Type Parameters:
T
- Tile Source class used by this Imagery Layer
- All Implemented Interfaces:
java.awt.image.ImageObserver
,org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener
,ProjectionChangeListener
,ImageryFilterSettings.FilterChangeListener
,TileSourceDisplaySettings.DisplaySettingsChangeListener
,MapViewPaintable
,NavigatableComponent.ZoomChangeListener
,Destroyable
public abstract class AbstractCachedTileSourceLayer<T extends org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource> extends AbstractTileSourceLayer<T>
Class providing cache to other layers
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer
AbstractTileSourceLayer.PrecacheTask, AbstractTileSourceLayer.TileSet, AbstractTileSourceLayer.TileSourceLayerPopup
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer
ImageryLayer.OffsetAction, ImageryLayer.OffsetMenuEntry
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.Layer
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
AbstractMapViewPaintable.CompatibilityModeLayerPainter
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.layer.MapViewPaintable
MapViewPaintable.LayerPainter, MapViewPaintable.MapViewEvent, MapViewPaintable.PaintableInvalidationEvent, MapViewPaintable.PaintableInvalidationListener
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.commons.jcs3.access.behavior.ICacheAccess<java.lang.String,BufferedImageCacheEntry>
cache
private static java.util.Map<java.lang.String,TileLoaderFactory>
loaderFactories
loader factory responsible for loading tiles for all layersprivate TileLoaderFactory
loaderFactory
private static TileLoaderFactory
loaderFactoryOverride
static IntegerProperty
MAX_DISK_CACHE_SIZE
how many object on disk should be stored for TMS region in MB.private static java.lang.String
PREFERENCE_PREFIX
-
Fields inherited from class org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer
coordinateConverter, MAX_ZOOM, MIN_ZOOM, PROP_MAX_ZOOM_LVL, PROP_MIN_ZOOM_LVL, tileCache, tileLoader, tileSource, ZOOM_OFFSET
-
Fields inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer
icon, info, PROP_SHARPEN_LEVEL
-
Fields inherited from class org.openstreetmap.josm.gui.layer.Layer
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCachedTileSourceLayer(ImageryInfo info)
Creates an instance of class based on ImageryInfo
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private org.apache.commons.jcs3.access.behavior.ICacheAccess<java.lang.String,BufferedImageCacheEntry>
getCache()
static org.apache.commons.jcs3.access.CacheAccess<java.lang.String,BufferedImageCacheEntry>
getCache(java.lang.String name)
Returns cache configured object for specified cache region.protected abstract java.lang.String
getCacheName()
protected int
getDiskCacheSize()
protected abstract java.lang.Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader>
getTileLoaderClass()
protected TileLoaderFactory
getTileLoaderFactory()
static TileLoaderFactory
getTileLoaderFactory(java.lang.String name, java.lang.Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader> klazz)
Returns tile loader factory for cache region and specified TileLoader classstatic void
setTileLoaderFactory(TileLoaderFactory newLoaderFactory)
Plugins that wish to set custom tile loader should call this method-
Methods inherited from class org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer
actionSupportLayers, attachToMapView, checkMaxZoomLvl, checkMinZoomLvl, clearErrorTiles, clearTileCache, createAndOpenSaveFileChooser, createDisplaySettings, createMapViewPainter, createTile, decreaseZoomLevel, destroy, displaySettingsChanged, estimateTileCacheSize, filterChanged, getAdjustAction, getBestZoom, getCommonEntries, getDisplaySettings, getDownloadAreaToCacheTask, getHeaders, getInfoComponent, getLayerListEntries, getMaxZoomLvl, getMaxZoomLvl, getMenuEntries, getMinZoomLvl, getMinZoomLvl, getNativeProjections, getOffsetMenuEntries, getScaleFactor, getTileSet, getTileSource, getToolTipText, getZoomLevel, hookUpMapView, imageUpdate, increaseZoomLevel, initTileSource, isSavable, loadAllErrorTiles, loadAllTiles, paint, projectionChanged, registerMenuAddition, registerMenuAddition, setMaxZoomLvl, setMinZoomLvl, setZoomLevel, tileLoadingFinished, visitBoundingBox, zoomChanged, zoomDecreaseAllowed, zoomIncreaseAllowed
-
Methods inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer
addImageProcessor, applyImageProcessors, create, createImageProcessor, createTextField, getChangesetSourceTag, getFilterSettings, getIcon, getImageProcessors, getInfo, getOffsetMenuItem, getOffsetMenuItem, getPPD, isMergable, mergeFrom, removeImageProcessor, toString
-
Methods inherited from class org.openstreetmap.josm.gui.layer.Layer
addPropertyChangeListener, checkSaveConditions, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getDefaultLayerPosition, getLabel, getName, getOpacity, getViewProjectionBounds, hasColor, isBackgroundLayer, isInfoResizable, isProjectionSupported, isRenamed, isVisible, nameSupportedProjections, onPostLoadFromFile, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setColor, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible
-
Methods inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
addInvalidationListener, invalidate, removeInvalidationListener
-
-
-
-
Field Detail
-
loaderFactories
private static final java.util.Map<java.lang.String,TileLoaderFactory> loaderFactories
loader factory responsible for loading tiles for all layers
-
PREFERENCE_PREFIX
private static final java.lang.String PREFERENCE_PREFIX
- See Also:
- Constant Field Values
-
loaderFactoryOverride
private static volatile TileLoaderFactory loaderFactoryOverride
-
MAX_DISK_CACHE_SIZE
public static final IntegerProperty MAX_DISK_CACHE_SIZE
how many object on disk should be stored for TMS region in MB. 500 MB is default value
-
cache
private org.apache.commons.jcs3.access.behavior.ICacheAccess<java.lang.String,BufferedImageCacheEntry> cache
-
loaderFactory
private volatile TileLoaderFactory loaderFactory
-
-
Constructor Detail
-
AbstractCachedTileSourceLayer
protected AbstractCachedTileSourceLayer(ImageryInfo info)
Creates an instance of class based on ImageryInfo- Parameters:
info
- ImageryInfo describing the layer
-
-
Method Detail
-
getTileLoaderFactory
protected TileLoaderFactory getTileLoaderFactory()
- Specified by:
getTileLoaderFactory
in classAbstractTileSourceLayer<T extends org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource>
-
getCache
private org.apache.commons.jcs3.access.behavior.ICacheAccess<java.lang.String,BufferedImageCacheEntry> getCache()
- Returns:
- cache used by this layer
-
setTileLoaderFactory
public static void setTileLoaderFactory(TileLoaderFactory newLoaderFactory)
Plugins that wish to set custom tile loader should call this method- Parameters:
newLoaderFactory
- that will be used to load tiles
-
getTileLoaderFactory
public static TileLoaderFactory getTileLoaderFactory(java.lang.String name, java.lang.Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader> klazz)
Returns tile loader factory for cache region and specified TileLoader class- Parameters:
name
- of the cache regionklazz
- type of the TileLoader- Returns:
- factory returning cached tile loaders using specified cache and TileLoaders
-
getCache
public static org.apache.commons.jcs3.access.CacheAccess<java.lang.String,BufferedImageCacheEntry> getCache(java.lang.String name)
Returns cache configured object for specified cache region.- Parameters:
name
- of cache region- Returns:
- cache configured object for specified cache region
-
getTileLoaderClass
protected abstract java.lang.Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader> getTileLoaderClass()
-
getDiskCacheSize
protected int getDiskCacheSize()
-
getCacheName
protected abstract java.lang.String getCacheName()
-
-