Changeset 34342 in osm for applications/editors/josm


Ignore:
Timestamp:
2018-06-22T23:57:45+02:00 (7 years ago)
Author:
donvip
Message:

see #josm14120 - fix deprecation warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java

    r34208 r34342  
    4747import org.openstreetmap.josm.gui.MapFrame;
    4848import org.openstreetmap.josm.gui.PleaseWaitRunnable;
     49import org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer;
    4950import org.openstreetmap.josm.gui.layer.GpxLayer;
    5051import org.openstreetmap.josm.gui.layer.ImageryLayer;
     
    7677    static final String pluginDir = Main.pref.getPluginsDirectory().getAbsolutePath() + "/CommandLine/";
    7778
    78     @SuppressWarnings("serial")
    7979    public CommandLine(PluginInformation info) {
    8080        super(info);
     
    282282                Layer olayer = MainApplication.getLayerManager().getActiveLayer();
    283283                if (olayer != null) {
    284                     if (!(olayer instanceof ImageryLayer)) {
    285                         List<ImageryLayer> imageryLayers = MainApplication.getLayerManager().getLayersOfType(ImageryLayer.class);
     284                    if (!(olayer instanceof AbstractTileSourceLayer)) {
     285                        @SuppressWarnings("rawtypes")
     286                        List<AbstractTileSourceLayer> imageryLayers = MainApplication.getLayerManager().getLayersOfType(
     287                                AbstractTileSourceLayer.class);
    286288                        if (imageryLayers.size() == 1) {
    287289                            olayer = imageryLayers.get(0);
     
    292294                    }
    293295                }
    294                 loadParameter((String.valueOf(((ImageryLayer) olayer).getDx()) + "," + String.valueOf(((ImageryLayer) olayer).getDy())), true);
     296                loadParameter((String.valueOf(((AbstractTileSourceLayer<?>) olayer).getDisplaySettings().getDx()) + "," +
     297                               String.valueOf(((AbstractTileSourceLayer<?>) olayer).getDisplaySettings().getDy())), true);
    295298                action = new DummyAction(this);
    296299                break;
Note: See TracChangeset for help on using the changeset viewer.