Changeset 31540 in osm for applications/viewer/jmapviewer/src/org/openstreetmap/gui
- Timestamp:
- 2015-09-08T21:49:43+02:00 (9 years ago)
- Location:
- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
r31439 r31540 103 103 */ 104 104 public JMapViewer() { 105 this(new MemoryTileCache() , 8);105 this(new MemoryTileCache()); 106 106 new DefaultMapController(this); 107 107 } … … 110 110 * Creates a new {@link JMapViewer} instance. 111 111 * @param tileCache The cache where to store tiles 112 * @param downloadThreadCount The number of parallel threads for retrieving the tiles 113 */ 112 * @depraceted @param downloadThreadCount not used anymore 113 */ 114 @Deprecated 114 115 public JMapViewer(TileCache tileCache, int downloadThreadCount) { 115 JobDispatcher.setMaxWorkers(downloadThreadCount); 116 this(tileCache); 117 } 118 119 /** 120 * Creates a new {@link JMapViewer} instance. 121 * @param tileCache The cache where to store tiles 122 * 123 */ 124 public JMapViewer(TileCache tileCache) { 116 125 tileSource = new OsmTileSource.Mapnik(); 117 126 tileController = new TileController(tileSource, tileCache, this); -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java
r31522 r31540 178 178 return getClass().getSimpleName(); 179 179 } 180 181 @Override 182 public void cancelOutstandingTasks() { 183 // intentionally left empty - OsmTileLoader doesn't maintain queue 184 } 180 185 } -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/TileController.java
r31434 r31540 2 2 package org.openstreetmap.gui.jmapviewer; 3 3 4 import org.openstreetmap.gui.jmapviewer.JobDispatcher.JobThread;5 4 import org.openstreetmap.gui.jmapviewer.interfaces.TileCache; 6 5 import org.openstreetmap.gui.jmapviewer.interfaces.TileLoader; … … 13 12 protected TileSource tileSource; 14 13 15 protected JobDispatcher jobDispatcher;16 17 14 public TileController(TileSource source, TileCache tileCache, TileLoaderListener listener) { 18 15 this.tileSource = source; 19 16 this.tileLoader = new OsmTileLoader(listener); 20 17 this.tileCache = tileCache; 21 this.jobDispatcher = JobDispatcher.getInstance();22 18 } 23 19 … … 81 77 /** 82 78 * Removes all jobs from the queue that are currently not being processed. 79 * 83 80 */ 84 81 public void cancelOutstandingJobs() { 85 jobDispatcher.cancelOutstandingJobs();82 tileLoader.cancelOutstandingTasks(); 86 83 } 87 84 } -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileLoader.java
r31429 r31540 21 21 */ 22 22 TileJob createTileLoaderJob(Tile tile); 23 24 /** 25 * cancels all outstanding tasks in the queue. This should rollback the state of the tiles in the queue 26 * to loading = false / loaded = false 27 */ 28 void cancelOutstandingTasks(); 23 29 }
Note:
See TracChangeset
for help on using the changeset viewer.