Changeset 11860 in josm


Ignore:
Timestamp:
2017-04-09T13:52:57+02:00 (8 months ago)
Author:
Don-vip
Message:

see #7427 - checkstyle

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java

    r11858 r11860  
    1818import org.openstreetmap.josm.Main;
    1919import org.openstreetmap.josm.data.coor.EastNorth;
    20 import org.openstreetmap.josm.data.coor.LatLon;
    2120import org.openstreetmap.josm.data.projection.Projection;
    2221import org.openstreetmap.josm.gui.layer.WMSLayer;
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r11858 r11860  
    10761076    }
    10771077
    1078      /**
     1078    /**
    10791079     * Draw a tile image on screen.
    10801080     * @param g the Graphics2D
     
    11841184
    11851185            // applying all filters to this layer
    1186             img = applyImageProcessors((BufferedImage) img);
     1186            img = applyImageProcessors(img);
    11871187
    11881188            Shape clip;
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r11858 r11860  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.layer;
    3 
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    53
    64import java.util.ArrayList;
    75import java.util.Collection;
    86import java.util.Collections;
    9 import java.util.List;
    107
    118import org.apache.commons.jcs.access.CacheAccess;
     
    2421import org.openstreetmap.josm.data.preferences.BooleanProperty;
    2522import org.openstreetmap.josm.data.preferences.IntegerProperty;
    26 import org.openstreetmap.josm.data.projection.Projection;
    2723
    2824/**
  • trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java

    r11858 r11860  
    1313import javax.swing.AbstractAction;
    1414import javax.swing.Action;
    15 import javax.swing.JOptionPane;
    1615
    1716import org.apache.commons.jcs.access.CacheAccess;
     
    2928import org.openstreetmap.josm.data.projection.Projection;
    3029import org.openstreetmap.josm.data.projection.Projections;
    31 import org.openstreetmap.josm.gui.ExtendedDialog;
    3230import org.openstreetmap.josm.gui.layer.imagery.TileSourceDisplaySettings;
    3331import org.openstreetmap.josm.tools.CheckParameterUtil;
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/ReprojectionTile.java

    r11858 r11860  
    1818/**
    1919 * Tile class that stores a reprojected version of the original tile.
     20 * @since 11858
    2021 */
    2122public class ReprojectionTile extends Tile {
     
    2526    protected boolean maxZoomReached;
    2627
     28    /**
     29     * Constructs a new {@code ReprojectionTile}.
     30     * @param source sourec tile
     31     * @param xtile X coordinate
     32     * @param ytile Y coordinate
     33     * @param zoom zoom level
     34     */
    2735    public ReprojectionTile(TileSource source, int xtile, int ytile, int zoom) {
    2836        super(source, xtile, ytile, zoom);
     
    5058        return true;
    5159    }
    52    
     60
    5361    @Override
    5462    public void setImage(BufferedImage image) {
     
    100108        Dimension dim = getDimension(pbTargetAligned, scaleMapView);
    101109        Integer scaleFix = limitScale(source.getTileSize(), Math.sqrt(dim.getWidth() * dim.getHeight()));
    102         double scale = scaleFix == null ? scaleMapView : scaleMapView * scaleFix;
     110        double scale = scaleFix == null ? scaleMapView : (scaleMapView * scaleFix);
    103111
    104112        ImageWarp.PointTransform pointTransform = pt -> {
     
    153161     */
    154162    protected Integer limitScale(double lenOrig, double lenNow) {
    155         double LIMIT = 3;
    156         if (lenNow > LIMIT * lenOrig) {
    157             int n = (int) Math.ceil((Math.log(lenNow) - Math.log(LIMIT * lenOrig)) / Math.log(2));
     163        final double limit = 3;
     164        if (lenNow > limit * lenOrig) {
     165            int n = (int) Math.ceil((Math.log(lenNow) - Math.log(limit * lenOrig)) / Math.log(2));
    158166            int f = 1 << n;
    159167            double lenNowFixed = lenNow / f;
    160             if (!(lenNowFixed <= LIMIT * lenOrig)) throw new AssertionError();
    161             if (!(lenNowFixed > LIMIT * lenOrig / 2)) throw new AssertionError();
     168            if (lenNowFixed > limit * lenOrig) throw new AssertionError();
     169            if (lenNowFixed <= limit * lenOrig / 2) throw new AssertionError();
    162170            return f;
    163171        }
    164         if (lenNow > LIMIT * lenOrig / 2)
     172        if (lenNow > limit * lenOrig / 2)
    165173            return 1;
    166174        return null;
Note: See TracChangeset for help on using the changeset viewer.