Changeset 25045 in osm for applications/editors/josm/plugins/cadastre-fr
- Timestamp:
- 2011-01-13T23:27:42+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r23190 r25045 124 124 static JMenu cadastreJMenu; 125 125 126 public static CadastreGrabber cadastreGrabber = new CadastreGrabber();127 128 126 public static String source = ""; 129 127 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
r23190 r25045 37 37 38 38 private WMSLayer wmsLayer; 39 private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber;40 39 private CadastreInterface wmsInterface; 41 40 private String svg = null; … … 49 48 50 49 this.wmsLayer = wmsLayer; 51 this.wmsInterface = grabber.getWmsInterface();50 this.wmsInterface = wmsLayer.grabber.getWmsInterface(); 52 51 } 53 52 … … 70 69 } catch (WMSException e) { 71 70 errorMessage = e.getMessage(); 72 grabber.getWmsInterface().resetCookie();71 wmsLayer.grabber.getWmsInterface().resetCookie(); 73 72 } 74 73 } … … 76 75 @Override 77 76 protected void cancel() { 78 grabber.getWmsInterface().cancel();77 wmsLayer.grabber.getWmsInterface().cancel(); 79 78 } 80 79 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
r23190 r25045 42 42 43 43 private WMSLayer wmsLayer; 44 private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber;45 44 private CadastreInterface wmsInterface; 46 45 private String svg = null; … … 52 51 53 52 this.wmsLayer = wmsLayer; 54 this.wmsInterface = grabber.getWmsInterface();53 this.wmsInterface = wmsLayer.grabber.getWmsInterface(); 55 54 } 56 55 … … 75 74 } catch (WMSException e) { 76 75 errorMessage = e.getMessage(); 77 grabber.getWmsInterface().resetCookie();76 wmsLayer.grabber.getWmsInterface().resetCookie(); 78 77 } 79 78 } … … 81 80 @Override 82 81 protected void cancel() { 83 grabber.getWmsInterface().cancel();82 wmsLayer.grabber.getWmsInterface().cancel(); 84 83 } 85 84 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
r24934 r25045 24 24 25 25 private class Task extends PleaseWaitRunnable { 26 private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber;27 26 public Task(WMSLayer wmsLayer, Bounds bounds) { 28 27 super(tr("Downloading {0}", wmsLayer.getName())); … … 34 33 errorMessage = null; 35 34 try { 36 if ( grabber.getWmsInterface().retrieveInterface(wmsLayer)) {35 if (wmsLayer.grabber.getWmsInterface().retrieveInterface(wmsLayer)) { 37 36 if (!wmsLayer.getImages().isEmpty()) { 38 37 //JOptionPane.showMessageDialog(Main.parent,tr("Image already loaded")); … … 46 45 // till here 47 46 dontGeoreference = true; 48 } else if ( grabber.getWmsInterface().downloadCancelled){47 } else if (wmsLayer.grabber.getWmsInterface().downloadCancelled){ 49 48 // do nothing 50 49 } else { … … 59 58 if (wmsLayer.isRaster()) { 60 59 // set raster image commune bounding box based on current view (before adjustment) 61 grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer);60 wmsLayer.grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer); 62 61 wmsLayer.setRasterBounds(bounds); 63 62 // grab new images from wms server into active layer 64 wmsLayer.grab( grabber,bounds);65 if ( grabber.getWmsInterface().downloadCancelled) {63 wmsLayer.grab(bounds); 64 if (wmsLayer.grabber.getWmsInterface().downloadCancelled) { 66 65 wmsLayer.clearImages(); 67 66 Main.map.mapView.repaint(); … … 89 88 } catch (WMSException e) { 90 89 errorMessage = e.getMessage(); 91 grabber.getWmsInterface().resetCookie();90 wmsLayer.grabber.getWmsInterface().resetCookie(); 92 91 } 93 92 } … … 95 94 @Override 96 95 protected void cancel() { 97 grabber.getWmsInterface().cancel();96 wmsLayer.grabber.getWmsInterface().cancel(); 98 97 dontGeoreference = true; 99 98 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java
r24934 r25045 17 17 private WMSLayer wmsLayer; 18 18 private Bounds bounds; 19 private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber;20 19 private static String errorMessage; 21 20 … … 32 31 errorMessage = null; 33 32 try { 34 if ( grabber.getWmsInterface().retrieveInterface(wmsLayer)) {33 if (wmsLayer.grabber.getWmsInterface().retrieveInterface(wmsLayer)) { 35 34 if (wmsLayer.getImages().isEmpty()) { 36 35 // first time we grab an image for this layer … … 50 49 } else { 51 50 // set vectorized commune bounding box by opening the standard web window 52 grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer);51 wmsLayer.grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer); 53 52 } 54 53 } 55 54 // grab new images from wms server into active layer 56 wmsLayer.grab( grabber,bounds);55 wmsLayer.grab(bounds); 57 56 } 58 57 } catch (DuplicateLayerException e) { … … 61 60 } catch (WMSException e) { 62 61 errorMessage = e.getMessage(); 63 grabber.getWmsInterface().resetCookie();62 wmsLayer.grabber.getWmsInterface().resetCookie(); 64 63 } 65 64 } … … 67 66 @Override 68 67 protected void cancel() { 69 grabber.getWmsInterface().cancel();68 wmsLayer.grabber.getWmsInterface().cancel(); 70 69 if (wmsLayer != null) 71 70 wmsLayer.grabThread.setCancelled(true); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java
r25033 r25045 1 // License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others 1 2 package cadastre_fr; 2 3 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
r24907 r25045 65 65 String codeDepartement = ""; 66 66 String codeCommune = ""; 67 boolean changeInterface = false;68 67 JLabel labelSectionNewLocation = new JLabel(tr("Add a new municipality layer")); 69 68 JPanel p = new JPanel(new GridBagLayout()); … … 105 104 location = inputTown.getText().toUpperCase(); 106 105 codeDepartement = departements[inputDepartement.getSelectedIndex()*2]; 107 changeInterface = true;108 106 Main.pref.put("cadastrewms.location", location); 109 107 Main.pref.put("cadastrewms.codeCommune", codeCommune); … … 130 128 } else if (existingLayers != null && existingLayers.size() > 0 && Main.map.mapView.getActiveLayer() instanceof WMSLayer) { 131 129 wmsLayer = (WMSLayer)Main.map.mapView.getActiveLayer(); 132 changeInterface = true;133 130 } 134 131 135 if (changeInterface)136 CadastrePlugin.cadastreGrabber.getWmsInterface().resetInterfaceRefIfNewLayer(wmsLayer.getName());137 132 return wmsLayer; 138 133 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java
r18544 r25045 20 20 21 21 public void actionPerformed(ActionEvent e) { 22 CadastrePlugin.cadastreGrabber.getWmsInterface().resetCookie();22 //CadastrePlugin.cadastreGrabber.getWmsInterface().resetCookie(); 23 23 } 24 24 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r25033 r25045 46 46 private int lambertZone = -1; 47 47 48 public CadastreGrabber grabber = new CadastreGrabber(); 49 48 50 protected static final Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage( 49 51 CadastrePlugin.class.getResource("/images/cadastre_small.png"))); … … 126 128 } 127 129 128 public void grab( CadastreGrabber grabber,Bounds b) throws IOException {130 public void grab(Bounds b) throws IOException { 129 131 grabThread.setCancelled(false); 130 132 grabThread.setGrabber(grabber);
Note:
See TracChangeset
for help on using the changeset viewer.