Ignore:
Timestamp:
2010-05-28T21:22:49+02:00 (16 years ago)
Author:
pieren
Message:

Improve renaming after municipality selection

File:
1 edited

Legend:

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

    r21202 r21493  
    6464    public void actionInterrupted() {
    6565        actionCompleted();
    66         wmsLayer = null;
     66        if (wmsLayer != null) {
     67            Main.map.mapView.removeLayer(wmsLayer);
     68            wmsLayer = null;
     69        }
    6770    }
    6871
     
    101104        // wait until plan image is fully loaded and joined into one single image
    102105        boolean loadedFromCache = downloadWMSPlanImage.waitFinished();
    103         if (wmsLayer.images.size() == 1 && !loadedFromCache) {
     106        if (loadedFromCache) {
     107            Main.map.repaint();
     108        } else if (wmsLayer.images.size() == 0) {
     109            // action cancelled or image loaded from cache (and already georeferenced)
     110            actionInterrupted();
     111        } else {
    104112            int reply = JOptionPane.CANCEL_OPTION;
    105113            if (wmsLayer.isAlreadyGeoreferenced()) {
     
    120128                    startGeoreferencing();
    121129            }
    122         } else // action cancelled or image loaded from cache (and already georeferenced)
    123             Main.map.repaint();
     130        }
    124131    }
    125132
     
    270277                        JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
    271278                        null, options, options[0]);
     279        countMouseClicked = 0;
    272280        if (selectedValue == 0) { // "Cancel"
    273281                // remove layer
     
    275283            wmsLayer = null;
    276284            Main.map.mapView.removeMouseListener(this);
    277                 return false;
    278         } else
    279             countMouseClicked = 0;
     285            return false;
     286        }
    280287        return true;
    281288    }
Note: See TracChangeset for help on using the changeset viewer.