Changeset 10742 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2016-08-06T01:08:18+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:CallToDeprecatedMethod - remove calls to deprecated methods

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r10687 r10742  
    885885            return ((DrawAction) map.mapMode).getInProgressSelection();
    886886        } else {
    887             DataSet ds = getCurrentDataSet();
     887            DataSet ds = getLayerManager().getEditDataSet();
    888888            if (ds == null) return null;
    889889            return ds.getSelected();
  • trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java

    r9214 r10742  
    1313import org.openstreetmap.josm.Main;
    1414import org.openstreetmap.josm.data.coor.LatLon;
     15import org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer;
    1516import org.openstreetmap.josm.gui.layer.ImageryLayer;
    1617
     
    101102    }
    102103
    103     public static void bookmarkOffset(String name, ImageryLayer layer) {
     104    public static void bookmarkOffset(String name, AbstractTileSourceLayer layer) {
    104105        LatLon center;
    105106        if (Main.isDisplayingMapView()) {
     
    110111        OffsetBookmark nb = new OffsetBookmark(
    111112                Main.getProjection().toCode(), layer.getInfo().getName(),
    112                 name, layer.getDx(), layer.getDy(), center.lon(), center.lat());
     113                name, layer.getDisplaySettings().getDx(), layer.getDisplaySettings().getDy(), center.lon(), center.lat());
    113114        for (ListIterator<OffsetBookmark> it = allBookmarks.listIterator(); it.hasNext();) {
    114115            OffsetBookmark b = it.next();
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r10669 r10742  
    190190    /**
    191191     * This class is an adapter for the old layer change interface.
    192      * <p>
    193      * New implementations should use {@link org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener}
    194192     * @author Michael Zangl
    195193     * @since 10271
    196      */
     194     * @deprecated New implementations should use {@link org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener}
     195     */
     196    @Deprecated
    197197    protected static class LayerChangeAdapter implements ActiveLayerChangeListener, LayerManager.LayerChangeListener {
    198198
     
    669669     */
    670670    public boolean isActiveLayerDrawable() {
    671          return getEditLayer() != null;
     671         return layerManager.getEditLayer() != null;
    672672    }
    673673
     
    678678     */
    679679    public boolean isActiveLayerVisible() {
    680         OsmDataLayer e = getEditLayer();
     680        OsmDataLayer e = layerManager.getEditLayer();
    681681        return e != null && e.isVisible();
    682682    }
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r10673 r10742  
    12461246
    12471247    private LatLon getShiftedLatLon(EastNorth en) {
    1248         return Main.getProjection().eastNorth2latlon(en.add(-getDx(), -getDy()));
     1248        return Main.getProjection().eastNorth2latlon(en.add(-getDisplaySettings().getDx(), -getDisplaySettings().getDy()));
    12491249    }
    12501250
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r10721 r10742  
    143143    public static <T> boolean exists(Iterable<T> collection, Class<? extends T> clazz) {
    144144        CheckParameterUtil.ensureParameterNotNull(clazz, "clazz");
    145         return exists(collection, clazz::isInstance);
     145        return StreamUtils.toStream(collection).anyMatch(clazz::isInstance);
    146146    }
    147147
Note: See TracChangeset for help on using the changeset viewer.