Changeset 19371 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
- Timestamp:
- 2010-01-10T15:46:08+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r19267 r19371 51 51 protected Vector<GeorefImage> images = new Vector<GeorefImage>(); 52 52 53 protected final int serializeFormatVersion = 2; 53 /** 54 * v1 to v2 = not supported 55 * v2 to v3 = add 4 more EastNorth coordinates in GeorefImages 56 */ 57 protected final int serializeFormatVersion = 3; 58 59 public static int currentFormat; 54 60 55 61 private ArrayList<EastNorthBound> dividedBbox = new ArrayList<EastNorthBound>(); … … 69 75 public double X0, Y0, angle, fX, fY; 70 76 77 // bbox of the georeferenced raster image (the nice horizontal and vertical box) 71 78 private EastNorth rasterMin; 72 79 private EastNorth rasterMax; … … 89 96 90 97 public void destroy() { 98 // if the layer is currently saving the images in the cache, wait until it's finished 99 while (!cacheControl.isCachePipeEmpty()) { 100 System.out.println("Try to close a WMSLayer which is currently saving in cache : wait 1 sec."); 101 CadastrePlugin.safeSleep(1000); 102 } 91 103 super.destroy(); 92 104 images = null; … … 364 376 double ratio = rasterSizeY/rasterSizeX; 365 377 // keep same ratio on screen as WMS bbox (stored in communeBBox) 366 rasterMin = new EastNorth(eaMin.getX(), rasterCenter.getY()-(eaMax.getX()-eaMin.getX())*ratio/2); 367 rasterMax = new EastNorth(eaMax.getX(), rasterCenter.getY()+(eaMax.getX()-eaMin.getX())*ratio/2); 378 rasterMin = new EastNorth(eaMin.getX(), rasterCenter.getY()-(eaMax.getX()-eaMin.getX())*ratio/2); 379 rasterMax = new EastNorth(eaMax.getX(), rasterCenter.getY()+(eaMax.getX()-eaMin.getX())*ratio/2); 368 380 rasterRatio = (rasterMax.getX()-rasterMin.getX())/rasterSizeX; 369 381 } … … 402 414 */ 403 415 public boolean read(ObjectInputStream ois, int currentLambertZone) throws IOException, ClassNotFoundException { 404 int sfv = ois.readInt();405 if ( sfv != this.serializeFormatVersion) {416 currentFormat = ois.readInt();; 417 if (currentFormat < 2) { 406 418 JOptionPane.showMessageDialog(Main.parent, tr("Unsupported cache file version; found {0}, expected {1}\nCreate a new one.", 407 sfv, this.serializeFormatVersion), tr("Cache Format Error"), JOptionPane.ERROR_MESSAGE);419 currentFormat, this.serializeFormatVersion), tr("Cache Format Error"), JOptionPane.ERROR_MESSAGE); 408 420 return false; 409 421 } … … 531 543 public void setCommuneBBox(EastNorthBound entireCommune) { 532 544 this.communeBBox = entireCommune; 533 // if (Main.proj instanceof LambertCC9Zones)534 // setLambertCC9Zone(communeBBox.min.north());535 545 } 536 546 … … 545 555 return lambertZone; 546 556 } 547 548 // public void setLambertCC9Zone(double north) {549 // int lambertZone = LambertCC9Zones.north2ZoneNumber(north);550 // this.lambertZone = lambertZone;551 // if (((LambertCC9Zones)Main.proj).getLayoutZone() != lambertZone) {552 // String currentZone = MenuActionLambertZone.lambert9zones[((LambertCC9Zones)Main.proj).getLayoutZone()+1];553 // String destZone = MenuActionLambertZone.lambert9zones[lambertZone+1];554 // if (Main.map.mapView.getAllLayers().size() == 1) {555 // /* Enable this code below when JOSM will have a proper support of dynamic projection change556 // *557 // System.out.println("close all layers and change current Lambert zone from "+LambertCC9Zones.layoutZone+" to "+lambertZone);558 // Bounds b = null;559 // if (Main.map != null && Main.map.mapView != null)560 // b = Main.map.mapView.getRealBounds();561 // LambertCC9Zones.layoutZone = lambertZone;562 // Main.map.mapView.zoomTo(b);563 // */564 // } else {565 // JOptionPane.showMessageDialog(Main.parent, tr("Current layer is in Lambert CC9 Zone \"{0}\"\n"+566 // "where the commune is in Lambert CC9 Zone \"{1}\".\n"+567 // "Upload your changes, close all layers and change\n"+568 // "manually the Lambert zone from the Cadastre menu"569 // , currentZone, destZone));570 // }571 // }572 // }573 557 574 558 public EastNorth getRasterCenter() {
Note:
See TracChangeset
for help on using the changeset viewer.