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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java

    r29714 r32329  
    22package cadastre_fr;
    33
     4import static org.openstreetmap.josm.tools.I18n.marktr;
    45import static org.openstreetmap.josm.tools.I18n.tr;
    5 import static org.openstreetmap.josm.tools.I18n.marktr;
    66
    77import java.awt.event.ActionEvent;
     
    1212import org.openstreetmap.josm.Main;
    1313import org.openstreetmap.josm.actions.JosmAction;
    14 import org.openstreetmap.josm.gui.layer.Layer;
    1514
    1615public class MenuActionGrabPlanImage extends JosmAction implements Runnable {
     
    3635        if (wmsLayer == null || Main.map == null || Main.map.mapView == null) return;
    3736        if (!rasterImageGeoreferencer.isRunning()) return;
    38         for (Layer l : Main.map.mapView.getAllLayersAsList())
    39             if (l == wmsLayer)
    40                 return;
     37        if (Main.getLayerManager().containsLayer(wmsLayer))
     38                return;
    4139        JOptionPane.showMessageDialog(Main.parent, tr("Georeferencing interrupted"));
    4240        rasterImageGeoreferencer.actionInterrupted();
    4341    }
    4442
    45     public void actionPerformed(ActionEvent ae) {
     43    @Override
     44        public void actionPerformed(ActionEvent ae) {
    4645        if (Main.map != null) {
    4746            if (CadastrePlugin.isCadastreProjection()) {
     
    5857    }
    5958
    60     public void run() {
     59    @Override
     60        public void run() {
    6161        // wait until plan image is fully loaded and joined into one single image
    6262        boolean loadedFromCache = downloadWMSPlanImage.waitFinished();
Note: See TracChangeset for help on using the changeset viewer.