Ignore:
Timestamp:
2016-06-19T16:08:56+02:00 (8 years ago)
Author:
donvip
Message:

fix #josm12953 - Replace most uses of MapView.getActiveLayer and similar methods (patch by michael2402, modified) - gsoc-core

Location:
applications/editors/josm/plugins/CommandLine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/CommandLine/build.xml

    r31926 r32329  
    44    <property name="commit.message" value="JOSM/CommandLine: fix exception after JOSM update"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="9170"/>
     6    <property name="plugin.main.version" value="10279"/>
    77
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java

    r31927 r32329  
    369369                break;
    370370            case IMAGERYURL:
    371                 Layer layer = Main.map.mapView.getActiveLayer();
     371                Layer layer = Main.getLayerManager().getActiveLayer();
    372372                if (layer != null) {
    373373                    if (!(layer instanceof ImageryLayer)) {
    374                         List<ImageryLayer> imageryLayers = Main.map.mapView.getLayersOfType(ImageryLayer.class);
     374                        List<ImageryLayer> imageryLayers = Main.getLayerManager().getLayersOfType(ImageryLayer.class);
    375375                        if (imageryLayers.size() == 1) {
    376376                            layer = imageryLayers.get(0);
     
    389389                break;
    390390            case IMAGERYOFFSET:
    391                 Layer olayer = Main.map.mapView.getActiveLayer();
     391                Layer olayer = Main.getLayerManager().getActiveLayer();
    392392                if (olayer != null) {
    393393                    if (!(olayer instanceof ImageryLayer)) {
    394                         List<ImageryLayer> imageryLayers = Main.map.mapView.getLayersOfType(ImageryLayer.class);
     394                        List<ImageryLayer> imageryLayers = Main.getLayerManager().getLayersOfType(ImageryLayer.class);
    395395                        if (imageryLayers.size() == 1) {
    396396                            olayer = imageryLayers.get(0);
     
    597597                        GpxFilter gpxFilter = new GpxFilter();
    598598                        gpxFilter.initBboxFilter(bbox);
    599                         List<GpxLayer> gpxLayers = Main.map.mapView.getLayersOfType(GpxLayer.class);
     599                        List<GpxLayer> gpxLayers = Main.getLayerManager().getLayersOfType(GpxLayer.class);
    600600                        for (GpxLayer gpxLayer : gpxLayers) {
    601601                            gpxFilter.addGpxData(gpxLayer.data);
Note: See TracChangeset for help on using the changeset viewer.