Changeset 8598 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java
- Timestamp:
- 2015-07-12T23:55:18+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java
r8540 r8598 12 12 import javax.swing.SpinnerNumberModel; 13 13 14 import org.openstreetmap.josm.data.imagery.CachedTileLoaderFactory;15 14 import org.openstreetmap.josm.data.imagery.TMSCachedTileLoader; 16 15 import org.openstreetmap.josm.data.imagery.TMSCachedTileLoaderJob; 17 16 import org.openstreetmap.josm.gui.layer.TMSLayer; 18 import org.openstreetmap.josm.gui.widgets.JosmTextField;19 17 import org.openstreetmap.josm.tools.GBC; 20 18 … … 31 29 private final JSpinner maxZoomLvl; 32 30 private final JCheckBox addToSlippyMapChosser = new JCheckBox(); 33 private final JosmTextField tilecacheDir = new JosmTextField(); 34 private final JSpinner maxElementsOnDisk; 31 35 32 private final JSpinner maxConcurrentDownloads; 36 33 private final JSpinner maxDownloadsPerHost; … … 46 43 maxZoomLvl = new JSpinner(new SpinnerNumberModel( 47 44 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));50 45 maxConcurrentDownloads = new JSpinner(new SpinnerNumberModel( 51 46 TMSCachedTileLoaderJob.THREAD_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1)); 52 47 maxDownloadsPerHost = new JSpinner(new SpinnerNumberModel( 53 48 TMSCachedTileLoader.HOST_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1)); 49 54 50 55 51 add(new JLabel(tr("Auto zoom by default: ")), GBC.std()); … … 73 69 add(addToSlippyMapChosser, GBC.eol().fill(GBC.HORIZONTAL)); 74 70 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 79 71 add(new JLabel(tr("Maximum concurrent downloads: ")), GBC.std()); 80 72 add(GBC.glue(5, 0), GBC.std()); … … 84 76 add(GBC.glue(5, 0), GBC.std()); 85 77 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());91 78 92 79 } … … 101 88 this.maxZoomLvl.setValue(TMSLayer.getMaxZoomLvl(null)); 102 89 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());105 90 this.maxConcurrentDownloads.setValue(TMSCachedTileLoaderJob.THREAD_LIMIT.get()); 106 91 this.maxDownloadsPerHost.setValue(TMSCachedTileLoader.HOST_LIMIT.get()); … … 114 99 boolean restartRequired = false; 115 100 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())) { 117 102 restartRequired = true; 118 103 } … … 122 107 TMSLayer.setMaxZoomLvl((Integer) this.maxZoomLvl.getValue()); 123 108 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 }129 109 130 110 if (!TMSCachedTileLoader.THREAD_LIMIT.get().equals(this.maxConcurrentDownloads.getValue())) { … … 138 118 } 139 119 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 145 120 return restartRequired; 146 121 }
Note:
See TracChangeset
for help on using the changeset viewer.