Changeset 21493 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
- Timestamp:
- 2010-05-28T21:22:49+02:00 (15 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.