Changeset 10971 in josm for trunk


Ignore:
Timestamp:
2016-09-07T00:10:08+02:00 (3 years ago)
Author:
Don-vip
Message:

sonar - squid:S138 - Methods should not have too many lines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r10969 r10971  
    16801680            ts = dts.getTileSet(displayZoomLevel);
    16811681            if (!dts.getTileSetInfo(displayZoomLevel).hasAllLoadedTiles && displayZoomLevel < zoom) {
    1682                 /*
    1683                  * if we are showing tiles from lower zoom level, ensure that all tiles are loaded
    1684                  * as they are few, and should not trash the tile cache
    1685                  * This is especially needed when dts.getTileSet(zoom).tooLarge() is true and we are
    1686                  * not loading tiles
    1687                  */
     1682                 // if we are showing tiles from lower zoom level, ensure that all tiles are loaded as they are few,
     1683                 // and should not trash the tile cache
     1684                 // This is especially needed when dts.getTileSet(zoom).tooLarge() is true and we are not loading tiles
    16881685                ts.loadAllTiles(false);
    16891686            }
     
    17131710                }
    17141711                Tile t2 = tempCornerTile(missed);
    1715                 TileSet ts2 = getTileSet(
    1716                         getShiftedLatLon(tileSource.tileXYToLatLon(missed)),
    1717                         getShiftedLatLon(tileSource.tileXYToLatLon(t2)),
    1718                         newzoom);
    1719                 // Instantiating large TileSets is expensive.  If there
    1720                 // are no loaded tiles, don't bother even trying.
     1712                TileSet ts2 = getTileSet(getShiftedLatLon(tileSource.tileXYToLatLon(missed)),
     1713                                         getShiftedLatLon(tileSource.tileXYToLatLon(t2)),
     1714                                         newzoom);
     1715                // Instantiating large TileSets is expensive. If there are no loaded tiles, don't bother even trying.
    17211716                if (ts2.allLoadedTiles().isEmpty()) {
    17221717                    newlyMissedTiles.add(missed);
     
    17461741                displayZoomLevel, this);
    17471742
    1748         //g.drawString("currentZoomLevel=" + currentZoomLevel, 120, 120);
    17491743        g.setColor(Color.lightGray);
    17501744
     
    17561750            myDrawString(g, tr("increase tiles zoom level (change resolution) to see more detail"), 120, 120);
    17571751        }
    1758 
    17591752        if (noTilesAtZoom) {
    17601753            myDrawString(g, tr("No tiles at this zoom level"), 120, 120);
     
    17671760            myDrawString(g, tr("Estimated cache size: {0}", estimateTileCacheSize()), 50, 200);
    17681761            if (tileLoader instanceof TMSCachedTileLoader) {
    1769                 TMSCachedTileLoader cachedTileLoader = (TMSCachedTileLoader) tileLoader;
    17701762                int offset = 200;
    1771                 for (String part: cachedTileLoader.getStats().split("\n")) {
     1763                for (String part: ((TMSCachedTileLoader) tileLoader).getStats().split("\n")) {
    17721764                    offset += 15;
    17731765                    myDrawString(g, tr("Cache stats: {0}", part), 50, offset);
Note: See TracChangeset for help on using the changeset viewer.