Changeset 31540 in osm


Ignore:
Timestamp:
2015-09-08T21:49:43+02:00 (9 years ago)
Author:
wiktorn
Message:

Remove org.openstreetmap.gui.jmapviewer.JobDispatcher as it is not use anymore. Addresses: #josm11840

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  
    103103     */
    104104    public JMapViewer() {
    105         this(new MemoryTileCache(), 8);
     105        this(new MemoryTileCache());
    106106        new DefaultMapController(this);
    107107    }
     
    110110     * Creates a new {@link JMapViewer} instance.
    111111     * @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
    114115    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) {
    116125        tileSource = new OsmTileSource.Mapnik();
    117126        tileController = new TileController(tileSource, tileCache, this);
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java

    r31522 r31540  
    178178        return getClass().getSimpleName();
    179179    }
     180
     181    @Override
     182    public void cancelOutstandingTasks() {
     183        // intentionally left empty - OsmTileLoader doesn't maintain queue
     184    }
    180185}
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/TileController.java

    r31434 r31540  
    22package org.openstreetmap.gui.jmapviewer;
    33
    4 import org.openstreetmap.gui.jmapviewer.JobDispatcher.JobThread;
    54import org.openstreetmap.gui.jmapviewer.interfaces.TileCache;
    65import org.openstreetmap.gui.jmapviewer.interfaces.TileLoader;
     
    1312    protected TileSource tileSource;
    1413
    15     protected JobDispatcher jobDispatcher;
    16 
    1714    public TileController(TileSource source, TileCache tileCache, TileLoaderListener listener) {
    1815        this.tileSource = source;
    1916        this.tileLoader = new OsmTileLoader(listener);
    2017        this.tileCache = tileCache;
    21         this.jobDispatcher = JobDispatcher.getInstance();
    2218    }
    2319
     
    8177    /**
    8278     * Removes all jobs from the queue that are currently not being processed.
     79     *
    8380     */
    8481    public void cancelOutstandingJobs() {
    85         jobDispatcher.cancelOutstandingJobs();
     82        tileLoader.cancelOutstandingTasks();
    8683    }
    8784}
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileLoader.java

    r31429 r31540  
    2121     */
    2222    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();
    2329}
Note: See TracChangeset for help on using the changeset viewer.