Changeset 12603 in josm


Ignore:
Timestamp:
2017-08-14T13:50:50+02:00 (2 years ago)
Author:
bastiK
Message:

see #14524 - make AbstractTileSourceLayer#currentZoomLevel private and use getter instead of public access

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
3 edited

Legend:

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

    r12541 r12603  
    153153    //public static final BooleanProperty PROP_DRAW_DEBUG = new BooleanProperty(PREFERENCE_PREFIX + ".draw_debug", false);
    154154    /** Zoomlevel at which tiles is currently downloaded. Initial zoom lvl is set to bestZoom */
    155     public int currentZoomLevel;
     155    private int currentZoomLevel;
    156156
    157157    private final AttributionSupport attribution = new AttributionSupport();
     
    757757        }
    758758        return true;
     759    }
     760
     761    /**
     762     * Get the current zoom level of the layer
     763     * @return the current zoom level
     764     * @since 12603
     765     */
     766    public int getZoomLevel() {
     767        return currentZoomLevel;
    759768    }
    760769
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/ZoomToBestAction.java

    r11950 r12603  
    2525        super(tr("Change resolution"));
    2626        this.layer = layer;
    27         setEnabled(!layer.getDisplaySettings().isAutoZoom() && layer.getBestZoom() != layer.currentZoomLevel);
     27        setEnabled(!layer.getDisplaySettings().isAutoZoom() && layer.getBestZoom() != layer.getZoomLevel());
    2828    }
    2929
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/ZoomToNativeLevelAction.java

    r11956 r12603  
    3030    @Override
    3131    public void actionPerformed(ActionEvent ae) {
    32         double newFactor = Math.sqrt(layer.getScaleFactor(layer.currentZoomLevel));
     32        double newFactor = Math.sqrt(layer.getScaleFactor(layer.getZoomLevel()));
    3333        Main.map.mapView.zoomToFactor(newFactor);
    3434        layer.invalidate();
Note: See TracChangeset for help on using the changeset viewer.