Ignore:
Timestamp:
2015-07-12T23:55:18+02:00 (9 years ago)
Author:
wiktorn
Message:

TileSource:

  • added method - getTileId that returns unique identifier for the tile, that should not collide with other tile sources
  • added JavaDocs

JCSCacheManager:

  • moved from object count limit to object size limit
  • fixed bug with unnecessary re-creation of auxilary cache, that could result in cache corruption/loss of current cache data

CachedTileLoaderFactory, WMSCachedTileLoader, TMSCachedTileLoader

  • un-abstract CachedTileLoaderFactory, use reflection to create TileLoaders
  • adjust constructors

TMSCachedTileLoader, AbstractCachedTileSourceLayer:

  • move cache related settings to AbstractCachedTileSourceLayer
  • move cache instation to AbstractCachedTileSourceLayer
  • make "flush tile cache" command clear only one tile source

TMSCachedTileLoaderJob:

  • make "flush tile cache" command clear only one tile source
  • reorder methods

TemplatedWMSTileSource:

  • java docs
  • inline of private methods: getTileXMax, getTileYMax
  • fix sonar issues
  • make WMS layer zoom levels closer to TMS (addresses: #11459)

WMTSTileSource:

  • fix Sonar issues
  • use topLeftCorner in X/Y tile max calculations instead of world bounds (fixes issues with WMTS-es, for which topLeftCorner lies outside projection world bounds)

AbstractTileSourceLayer:

  • draw warning, when min-zoom-level is set, and tiles are not loaded due to too many tiles on screen

TMSLayer, WMSLayer, WMTSLayer:

  • expose access to cache object for ImageryPreferences

CacheContentsPanel:

  • add panel for managing cache regions and tile sources within the regions

CommonSettingsPanel, TMSSettingsPanel:

  • move settings common to all imagery layers from TMSSettingsPanel to CommonSettingsPanel
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java

    r8540 r8598  
    1212import javax.swing.SpinnerNumberModel;
    1313
    14 import org.openstreetmap.josm.data.imagery.CachedTileLoaderFactory;
    1514import org.openstreetmap.josm.data.imagery.TMSCachedTileLoader;
    1615import org.openstreetmap.josm.data.imagery.TMSCachedTileLoaderJob;
    1716import org.openstreetmap.josm.gui.layer.TMSLayer;
    18 import org.openstreetmap.josm.gui.widgets.JosmTextField;
    1917import org.openstreetmap.josm.tools.GBC;
    2018
     
    3129    private final JSpinner maxZoomLvl;
    3230    private final JCheckBox addToSlippyMapChosser = new JCheckBox();
    33     private final JosmTextField tilecacheDir = new JosmTextField();
    34     private final JSpinner maxElementsOnDisk;
     31
    3532    private final JSpinner maxConcurrentDownloads;
    3633    private final JSpinner maxDownloadsPerHost;
     
    4643        maxZoomLvl = new JSpinner(new SpinnerNumberModel(
    4744                TMSLayer.PROP_MAX_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM, 1));
    48         maxElementsOnDisk = new JSpinner(new SpinnerNumberModel(
    49                 TMSCachedTileLoader.MAX_OBJECTS_ON_DISK.get().intValue(), 0, Integer.MAX_VALUE, 1));
    5045        maxConcurrentDownloads = new JSpinner(new SpinnerNumberModel(
    5146                TMSCachedTileLoaderJob.THREAD_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1));
    5247        maxDownloadsPerHost = new JSpinner(new SpinnerNumberModel(
    5348                TMSCachedTileLoader.HOST_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1));
     49
    5450
    5551        add(new JLabel(tr("Auto zoom by default: ")), GBC.std());
     
    7369        add(addToSlippyMapChosser, GBC.eol().fill(GBC.HORIZONTAL));
    7470
    75         add(new JLabel(tr("Tile cache directory: ")), GBC.std());
    76         add(GBC.glue(5, 0), GBC.std());
    77         add(tilecacheDir, GBC.eol().fill(GBC.HORIZONTAL));
    78 
    7971        add(new JLabel(tr("Maximum concurrent downloads: ")), GBC.std());
    8072        add(GBC.glue(5, 0), GBC.std());
     
    8476        add(GBC.glue(5, 0), GBC.std());
    8577        add(maxDownloadsPerHost, GBC.eol());
    86 
    87 
    88         add(new JLabel(tr("Maximum elements in disk cache: ")), GBC.std());
    89         add(GBC.glue(5, 0), GBC.std());
    90         add(this.maxElementsOnDisk, GBC.eol());
    9178
    9279    }
     
    10188        this.maxZoomLvl.setValue(TMSLayer.getMaxZoomLvl(null));
    10289        this.minZoomLvl.setValue(TMSLayer.getMinZoomLvl(null));
    103         this.tilecacheDir.setText(CachedTileLoaderFactory.PROP_TILECACHE_DIR.get());
    104         this.maxElementsOnDisk.setValue(TMSCachedTileLoader.MAX_OBJECTS_ON_DISK.get());
    10590        this.maxConcurrentDownloads.setValue(TMSCachedTileLoaderJob.THREAD_LIMIT.get());
    10691        this.maxDownloadsPerHost.setValue(TMSCachedTileLoader.HOST_LIMIT.get());
     
    11499        boolean restartRequired = false;
    115100
    116         if (TMSLayer.PROP_ADD_TO_SLIPPYMAP_CHOOSER.get() != this.addToSlippyMapChosser.isSelected()) {
     101        if (!TMSLayer.PROP_ADD_TO_SLIPPYMAP_CHOOSER.get().equals(this.addToSlippyMapChosser.isSelected())) {
    117102            restartRequired = true;
    118103        }
     
    122107        TMSLayer.setMaxZoomLvl((Integer) this.maxZoomLvl.getValue());
    123108        TMSLayer.setMinZoomLvl((Integer) this.minZoomLvl.getValue());
    124 
    125         if (!TMSCachedTileLoader.MAX_OBJECTS_ON_DISK.get().equals(this.maxElementsOnDisk.getValue())) {
    126             TMSCachedTileLoader.MAX_OBJECTS_ON_DISK.put((Integer) this.maxElementsOnDisk.getValue());
    127             restartRequired = true;
    128         }
    129109
    130110        if (!TMSCachedTileLoader.THREAD_LIMIT.get().equals(this.maxConcurrentDownloads.getValue())) {
     
    138118        }
    139119
    140         if (!CachedTileLoaderFactory.PROP_TILECACHE_DIR.get().equals(this.tilecacheDir.getText())) {
    141             restartRequired = true;
    142             CachedTileLoaderFactory.PROP_TILECACHE_DIR.put(this.tilecacheDir.getText());
    143         }
    144 
    145120        return restartRequired;
    146121    }
Note: See TracChangeset for help on using the changeset viewer.