Class TMSCachedTileLoader

  • All Implemented Interfaces:
    org.openstreetmap.gui.jmapviewer.interfaces.CachedTileLoader, org.openstreetmap.gui.jmapviewer.interfaces.TileLoader
    Direct Known Subclasses:
    WMSCachedTileLoader

    public class TMSCachedTileLoader
    extends Object
    implements org.openstreetmap.gui.jmapviewer.interfaces.TileLoader, org.openstreetmap.gui.jmapviewer.interfaces.CachedTileLoader
    Wrapper class that bridges between JCS cache and Tile Loaders
    • Constructor Detail

      • TMSCachedTileLoader

        public TMSCachedTileLoader​(org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener listener,
                                   org.apache.commons.jcs3.access.behavior.ICacheAccess<String,​BufferedImageCacheEntry> cache,
                                   TileJobOptions options)
        Constructor
        Parameters:
        listener - called when tile loading has finished
        cache - of the cache
        options - tile job options
    • Method Detail

      • createTileLoaderJob

        public org.openstreetmap.gui.jmapviewer.interfaces.TileJob createTileLoaderJob​(org.openstreetmap.gui.jmapviewer.Tile tile)
        Specified by:
        createTileLoaderJob in interface org.openstreetmap.gui.jmapviewer.interfaces.TileLoader
      • clearCache

        public void clearCache​(org.openstreetmap.gui.jmapviewer.interfaces.TileSource source)
        Specified by:
        clearCache in interface org.openstreetmap.gui.jmapviewer.interfaces.CachedTileLoader
      • getStats

        public String getStats()
        Returns cache statistics as string.
        Returns:
        cache statistics as string
      • cancelOutstandingTasks

        public void cancelOutstandingTasks()
        cancels all outstanding tasks in the queue. This rollbacks the state of the tiles in the queue to loading = false / loaded = false
        Specified by:
        cancelOutstandingTasks in interface org.openstreetmap.gui.jmapviewer.interfaces.TileLoader
      • hasOutstandingTasks

        public boolean hasOutstandingTasks()
        Specified by:
        hasOutstandingTasks in interface org.openstreetmap.gui.jmapviewer.interfaces.TileLoader
      • shutdown

        public void shutdown()
        Shutdown the job dispatcher provided that it's not the default one