Changeset 15961 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
- Timestamp:
- 2009-06-17T09:46:26+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
r13611 r15961 41 41 final String cBBoxCommunStart = "new GeoBox("; 42 42 final String cBBoxCommunEnd = ")"; 43 43 44 44 final String cInterfaceVector = "afficherCarteCommune.do"; 45 45 final String cInterfaceRaster = "afficherCarteTa.do"; 46 46 47 47 CadastreInterface(CadastreGrabber cadastreGrabber) { 48 48 this.cadastreGrabber = cadastreGrabber; 49 49 } 50 50 51 51 public boolean retrieveInterface(WMSLayer wmsLayer) throws DuplicateLayerException { 52 52 if (wmsLayer.name.equals("")) … … 64 64 JOptionPane.showMessageDialog(Main.parent, 65 65 tr("Town/city {0} not found or not available in WMS.\n" + 66 "Please check its availibility on www.cadastre.gouv.fr", wmsLayer.getLocation()));66 "Please check its availibility on www.cadastre.gouv.fr", wmsLayer.getLocation())); 67 67 return false; 68 68 } … … 99 99 cadastreGrabber.setLastWMSLayerName(null); 100 100 } 101 101 102 102 public void resetCookieIfNewLayer(String newWMSLayerName) { 103 103 if (!newWMSLayerName.equals(cadastreGrabber.getLastWMSLayerName())) { … … 105 105 } 106 106 } 107 107 108 108 public void setCookie() { 109 109 urlConn.setRequestProperty("Cookie", cookie); 110 110 } 111 111 112 112 private void getInterface(WMSLayer wmsLayer) throws IOException, DuplicateLayerException { 113 113 // first attempt : search for given name without codeCommune … … 134 134 } 135 135 } 136 136 137 137 if (interfaceRef == null) 138 138 throw new IOException("Town/city " + wmsLayer.getLocation() + " not found."); 139 139 } 140 140 141 141 private void openInterface() throws IOException { 142 142 try { … … 158 158 } 159 159 } 160 160 161 161 /** 162 162 * Post the form with the commune name and check the returned answer which is embedded 163 163 * in HTTP XML packets. This function doesn't use an XML parser yet but that would be a good idea 164 164 * for the next releases. 165 * Two possibilities : 165 * Two possibilities : 166 166 * - either the commune name matches and we receive an URL starting with "afficherCarteCommune.do" or 167 167 * - we don't receive a single answer but a list of possible values. This answer looks like: … … 171 171 * <option value="QK066" >COLMAR - 68000</option> 172 172 * </select> 173 * 173 * 174 174 * @param location 175 175 * @param codeCommune … … 245 245 return null; 246 246 } 247 247 248 248 private void parseCommuneList(String input) { 249 249 if (input.indexOf(c0ptionListStart) != -1) { … … 264 264 } 265 265 } 266 266 267 267 private void parseTAList(String input) { 268 268 while (input.indexOf(cInterfaceRaster) != -1) { … … 272 272 if (!listOfTA.contains(codeTA)) { 273 273 System.out.println("parse "+codeTA); 274 listOfTA.add(codeTA); 274 listOfTA.add(codeTA); 275 275 } 276 276 input = input.substring(cInterfaceRaster.length()); … … 314 314 return cInterfaceRaster + "?f=" + codeCommune; 315 315 } 316 316 317 317 public EastNorthBound retrieveCommuneBBox() throws IOException { 318 318 if (interfaceRef == null) … … 340 340 return parseBBoxCommune(line); 341 341 } 342 342 343 343 private EastNorthBound parseBBoxCommune(String input) { 344 344 if (input.indexOf(cBBoxCommunStart) != -1) { … … 356 356 return null; 357 357 } 358 358 359 359 private void checkLayerDuplicates(WMSLayer wmsLayer) throws DuplicateLayerException { 360 360 if (Main.map != null) { … … 369 369 } 370 370 } 371 372 public void cancel() { 371 372 public void cancel() { 373 373 Main.pleaseWaitDlg.currentAction.setText(tr("Aborting...")); 374 374 if (urlConn != null) {
Note:
See TracChangeset
for help on using the changeset viewer.
