Changeset 18207 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
- Timestamp:
- 2009-10-18T18:11:09+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r17719 r18207 19 19 import javax.swing.Icon; 20 20 import javax.swing.ImageIcon; 21 import javax.swing.JDialog; 21 22 import javax.swing.JMenuItem; 22 23 import javax.swing.JOptionPane; … … 25 26 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 26 27 import org.openstreetmap.josm.data.projection.Lambert; 28 import org.openstreetmap.josm.data.projection.LambertCC9Zones; 27 29 import org.openstreetmap.josm.data.Bounds; 28 30 import org.openstreetmap.josm.gui.MapView; … … 42 44 Component[] component = null; 43 45 44 p ublicint lambertZone = -1;46 private int lambertZone = -1; 45 47 46 48 protected static final Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage( … … 77 79 this.location = location; 78 80 this.codeCommune = codeCommune; 79 this.lambertZone = Lambert.layoutZone;81 this.lambertZone = lambertZone; 80 82 // enable auto-sourcing option 81 83 CadastrePlugin.pluginUsed = true; … … 380 382 } 381 383 this.communeBBox = (EastNorthBound) ois.readObject(); 382 if (this.lambertZone != currentLambertZone) { 384 if (this.lambertZone != currentLambertZone && currentLambertZone != -1) { 383 385 JOptionPane.showMessageDialog(Main.parent, tr("Lambert zone {0} in cache "+ 384 386 "incompatible with current Lambert zone {1}", … … 484 486 public void setCommuneBBox(EastNorthBound entireCommune) { 485 487 this.communeBBox = entireCommune; 488 if (Main.proj instanceof LambertCC9Zones) 489 setLambertCC9Zone(communeBBox.min.north()); 486 490 } 487 491 … … 493 497 } 494 498 499 public int getLambertZone() { 500 return lambertZone; 501 } 502 503 public void setLambertCC9Zone(double north) { 504 int lambertZone = LambertCC9Zones.north2ZoneNumber(north); 505 this.lambertZone = lambertZone; 506 if (LambertCC9Zones.layoutZone != lambertZone) { 507 String currentZone = MenuActionLambertZone.lambert9zones[LambertCC9Zones.layoutZone+1]; 508 String destZone = MenuActionLambertZone.lambert9zones[lambertZone+1]; 509 if (Main.map.mapView.getAllLayers().size() == 1) { 510 /* Enable this code below when JOSM will have a proper support of dynamic projection change 511 * 512 System.out.println("close all layers and change current Lambert zone from "+LambertCC9Zones.layoutZone+" to "+lambertZone); 513 Bounds b = null; 514 if (Main.map != null && Main.map.mapView != null) 515 b = Main.map.mapView.getRealBounds(); 516 LambertCC9Zones.layoutZone = lambertZone; 517 Main.map.mapView.zoomTo(b); 518 */ 519 } else { 520 JOptionPane.showMessageDialog(Main.parent, tr("Current layer is in Lambert CC9 Zone \"{0}\"\n"+ 521 "where the commune is in Lambert CC9 Zone \"{1}\".\n"+ 522 "Upload your changes, close all layers and change\n"+ 523 "manually the Lambert zone from the Cadastre menu" 524 , currentZone, destZone)); 525 } 526 } 527 } 528 495 529 }
Note:
See TracChangeset
for help on using the changeset viewer.
