Changeset 20412 in osm for applications
- Timestamp:
- 2010-03-11T00:58:51+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
r19267 r20412 65 65 final int cRetriesGetCookie = 10; // 10 times every 3 seconds means 30 seconds trying to get a cookie 66 66 67 public boolean retrieveInterface(WMSLayer wmsLayer) throws DuplicateLayerException {67 public boolean retrieveInterface(WMSLayer wmsLayer) throws DuplicateLayerException, WMSException { 68 68 if (wmsLayer.getName().equals("")) 69 69 return false; … … 75 75 if (cookie == null || isCookieExpired()) 76 76 getCookie(); 77 if (cookie != null && interfaceRef == null) { 77 if (cookie == null) 78 throw new WMSException(tr("Cannot open a new client session.\nServer in maintenance or temporary overloaded.")); 79 if (interfaceRef == null) { 78 80 getInterface(wmsLayer); 79 81 this.lastWMSLayerName = wmsLayer.getName(); 80 } else {81 JOptionPane.showMessageDialog(Main.parent,82 tr("Cannot open a new client session.\nServer in maintenance or temporary overloaded."));83 return false;84 82 } 85 83 openInterface(); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r20390 r20412 90 90 * 1.6 28-Nov-2009 - Fix minor issues if Grab is called without layer (possible since projection rework) 91 91 * 1.7 12-Dec-2009 - Change URL's changes for cookie and downgrade imgs resolution due to WMS changes 92 * 1.8 09-Mar-2010 - filter the mouse button 1 during georeferencing92 * 1.8 11-Mar-2010 - filter the mouse button 1 during georeferencing 93 93 * - retry if getting a new cookie failed (10 times during 30 seconds) 94 94 * - cookie expiration automatically detected and renewed (after 30 minutes) … … 101 101 * - image resolution configurable (high, medium, low) like the online interface 102 102 * - layer selection configurable for vectorized images 103 * - improved download cancellation 103 104 * - from Erik Amzallag: 104 105 * - possibility to modify the auto-sourcing text just before upload 105 106 * - from Clément Ménier: 106 107 * - new option allowing an auto-selection of the first cadastre layer for grab 107 * - non-modal JDialog in MenuActionGrabPlanImage 108 * - non-modal JDialog in MenuActionGrabPlanImage 109 * - new options in the image filter (bilinear, bicubic) 108 110 */ 109 111 public class CadastrePlugin extends Plugin { -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
r20390 r20412 42 42 private static EastNorthBound currentView = null; 43 43 private EastNorthBound viewBox = null; 44 private static String errorMessage; 45 44 46 45 47 public DownloadSVGBuilding(WMSLayer wmsLayer) { … … 53 55 public void realRun() throws IOException, OsmTransferException { 54 56 progressMonitor.indeterminateSubTask(tr("Contacting WMS Server...")); 57 errorMessage = null; 55 58 try { 56 59 if (wmsInterface.retrieveInterface(wmsLayer)) { … … 65 68 } catch (DuplicateLayerException e) { 66 69 System.err.println("removed a duplicated layer"); 70 } catch (WMSException e) { 71 errorMessage = e.getMessage(); 72 grabber.getWmsInterface().resetCookie(); 67 73 } 68 74 } … … 272 278 } 273 279 Main.worker.execute(new DownloadSVGBuilding(wmsLayer)); 280 if (errorMessage != null) 281 JOptionPane.showMessageDialog(Main.parent, errorMessage); 274 282 } 275 283 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
r20390 r20412 46 46 private String svg = null; 47 47 private EastNorthBound viewBox = null; 48 private static String errorMessage; 48 49 49 50 public DownloadSVGTask(WMSLayer wmsLayer) { … … 57 58 public void realRun() throws IOException, OsmTransferException { 58 59 progressMonitor.indeterminateSubTask(tr("Contacting WMS Server...")); 60 errorMessage = null; 59 61 try { 60 62 if (wmsInterface.retrieveInterface(wmsLayer)) { … … 71 73 } catch (DuplicateLayerException e) { 72 74 System.err.println("removed a duplicated layer"); 75 } catch (WMSException e) { 76 errorMessage = e.getMessage(); 77 grabber.getWmsInterface().resetCookie(); 73 78 } 74 79 } … … 218 223 } 219 224 Main.worker.execute(new DownloadSVGTask(wmsLayer)); 225 if (errorMessage != null) 226 JOptionPane.showMessageDialog(Main.parent, errorMessage); 220 227 } 221 228 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
r20390 r20412 21 21 private Bounds bounds; 22 22 private boolean dontGeoreference = false; 23 private static String errorMessage; 23 24 24 25 private class Task extends PleaseWaitRunnable { … … 31 32 public void realRun() throws IOException { 32 33 progressMonitor.indeterminateSubTask(tr("Contacting cadastre WMS ...")); 34 errorMessage = null; 33 35 try { 34 36 if (grabber.getWmsInterface().retrieveInterface(wmsLayer)) { … … 85 87 // we tried to grab onto a duplicated layer (removed) 86 88 System.err.println("removed a duplicated layer"); 89 } catch (WMSException e) { 90 errorMessage = e.getMessage(); 91 grabber.getWmsInterface().resetCookie(); 87 92 } 88 93 } … … 108 113 this.bounds = bounds; 109 114 task = Main.worker.submit(t, t); 115 if (errorMessage != null) 116 JOptionPane.showMessageDialog(Main.parent, errorMessage); 110 117 } 111 118 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java
r20390 r20412 5 5 6 6 import java.io.IOException; 7 8 import javax.swing.JOptionPane; 7 9 8 10 import org.openstreetmap.josm.Main; … … 14 16 15 17 private WMSLayer wmsLayer; 16 17 private Bounds bounds; 18 19 private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber; 18 private Bounds bounds; 19 private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber; 20 private static String errorMessage; 20 21 21 22 public DownloadWMSVectorImage(WMSLayer wmsLayer, Bounds bounds, boolean buildingsOnly) { … … 30 31 public void realRun() throws IOException { 31 32 progressMonitor.indeterminateSubTask(tr("Contacting WMS Server...")); 33 errorMessage = null; 32 34 try { 33 35 if (grabber.getWmsInterface().retrieveInterface(wmsLayer)) { … … 62 64 // we tried to grab onto a duplicated layer (removed) 63 65 System.err.println("removed a duplicated layer"); 66 } catch (WMSException e) { 67 errorMessage = e.getMessage(); 68 grabber.getWmsInterface().resetCookie(); 64 69 } 65 70 } … … 68 73 protected void cancel() { 69 74 grabber.getWmsInterface().cancel(); 75 if (wmsLayer != null) 76 wmsLayer.cancelled = true; 70 77 } 71 78 … … 79 86 80 87 Main.worker.execute(new DownloadWMSVectorImage(wmsLayer, bounds, buildingsOnly)); 81 88 if (errorMessage != null) 89 JOptionPane.showMessageDialog(Main.parent, errorMessage); 82 90 } 83 91 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r20390 r20412 72 72 public EastNorthBound communeBBox = new EastNorthBound(new EastNorth(0,0), new EastNorth(0,0)); 73 73 74 public boolean cancelled; 75 74 76 private boolean isRaster = false; 75 77 private boolean isAlreadyGeoreferenced = false; … … 132 134 133 135 public void grab(CadastreGrabber grabber, Bounds b, boolean useFactor) throws IOException { 136 cancelled = false; 134 137 if (useFactor) { 135 138 if (isRaster) { … … 146 149 int lastSavedImage = images.size(); 147 150 for (EastNorthBound n : dividedBbox) { 151 if (cancelled) 152 return; 148 153 GeorefImage newImage; 149 154 try {
Note:
See TracChangeset
for help on using the changeset viewer.