Changeset 21493 in osm
- Timestamp:
- 2010-05-28T21:22:49+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
r21191 r21493 175 175 // commune unknown, prompt the list of communes from 176 176 // server and try with codeCommune 177 wmsLayer.setCodeCommune(selectCommuneDialog()); 177 String selected = selectMunicipalityDialog(wmsLayer); 178 if (selected != null) { 179 String newCodeCommune = selected.substring(1, selected.indexOf(">")-2); 180 String newLocation = selected.substring(selected.indexOf(">")+1, selected.lastIndexOf(" - ")); 181 wmsLayer.setCodeCommune(newCodeCommune); 182 wmsLayer.setLocation(newLocation); 183 Main.pref.put("cadastrewms.codeCommune", newCodeCommune); 184 Main.pref.put("cadastrewms.location", newLocation); 185 } 178 186 checkLayerDuplicates(wmsLayer); 179 187 interfaceRef = postForm(wmsLayer, wmsLayer.getCodeCommune()); … … 381 389 } 382 390 383 private String select CommuneDialog() {391 private String selectMunicipalityDialog(WMSLayer wmsLayer) { 384 392 JPanel p = new JPanel(new GridBagLayout()); 385 393 String[] communeList = new String[listOfCommunes.size() + 1]; … … 401 409 if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue())) 402 410 return null; 403 String result = listOfCommunes.elementAt(inputCommuneList.getSelectedIndex()-1); 404 return result.substring(1, result.indexOf(">")-2); 411 return listOfCommunes.elementAt(inputCommuneList.getSelectedIndex()-1); 405 412 } 406 413 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
r20412 r21493 20 20 private WMSLayer wmsLayer; 21 21 private Bounds bounds; 22 private boolean dontGeoreference = false;22 private static boolean dontGeoreference = false; 23 23 private static String errorMessage; 24 24 … … 107 107 MapView mv = Main.map.mapView; 108 108 Bounds bounds = new Bounds(mv.getLatLon(0, mv.getHeight()), mv.getLatLon(mv.getWidth(), 0)); 109 dontGeoreference = false; 109 110 110 111 //Main.worker.execute(new DownloadWMSPlanImage(wmsLayer, bounds)); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
r21202 r21493 64 64 public void actionInterrupted() { 65 65 actionCompleted(); 66 wmsLayer = null; 66 if (wmsLayer != null) { 67 Main.map.mapView.removeLayer(wmsLayer); 68 wmsLayer = null; 69 } 67 70 } 68 71 … … 101 104 // wait until plan image is fully loaded and joined into one single image 102 105 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 { 104 112 int reply = JOptionPane.CANCEL_OPTION; 105 113 if (wmsLayer.isAlreadyGeoreferenced()) { … … 120 128 startGeoreferencing(); 121 129 } 122 } else // action cancelled or image loaded from cache (and already georeferenced) 123 Main.map.repaint(); 130 } 124 131 } 125 132 … … 270 277 JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, 271 278 null, options, options[0]); 279 countMouseClicked = 0; 272 280 if (selectedValue == 0) { // "Cancel" 273 281 // remove layer … … 275 283 wmsLayer = null; 276 284 Main.map.mapView.removeMouseListener(this); 277 return false; 278 } else 279 countMouseClicked = 0; 285 return false; 286 } 280 287 return true; 281 288 }
Note:
See TracChangeset
for help on using the changeset viewer.