Changeset 26835 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
- Timestamp:
- 2011-10-12T00:39:26+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r26823 r26835 85 85 private double rasterRatio; 86 86 87 // offset for vector images temporarily shifted (correcting Cadastre artifacts), in pixels 88 public double deltaEast=0; 89 public double deltaNorth=0; 90 87 91 private Action saveAsPng; 88 92 … … 91 95 @SuppressWarnings("serial") 92 96 class ResetOffsetActionMenu extends JosmAction { 93 private WMSLayer wmsLayer; 94 public ResetOffsetActionMenu(WMSLayer wmsLayer) { 97 public ResetOffsetActionMenu() { 95 98 super(tr("Reset offset"), null, tr("Reset offset (only vector images)"), null, false); 96 this.wmsLayer = wmsLayer;97 99 } 98 100 @Override 99 101 public void actionPerformed(ActionEvent arg0) { 100 for (GeorefImage img:wmsLayer.images) { 101 img.deltaEast = 0; 102 img.deltaNorth = 0; 103 } 102 deltaEast = 0; 103 deltaNorth = 0; 104 104 Main.map.mapView.repaint(); 105 105 } … … 180 180 EastNorth lambertMin = Main.getProjection().latlon2eastNorth(b.getMin()); 181 181 EastNorth lambertMax = Main.getProjection().latlon2eastNorth(b.getMax()); 182 double minEast = lambertMin.east(); 183 double minNorth = lambertMin.north(); 182 double minEast = lambertMin.east()+deltaEast; 183 double minNorth = lambertMin.north()+deltaNorth; 184 184 double dEast = (lambertMax.east() - minEast) / factor; 185 185 double dNorth = (lambertMax.north() - minNorth) / factor; … … 309 309 cancelGrab = new MenuActionCancelGrab(this); 310 310 cancelGrab.setEnabled(!isRaster && grabThread.getImagesToGrabSize() > 0); 311 Action resetOffset = new ResetOffsetActionMenu( this);312 resetOffset.setEnabled(!isRaster && images.size() > 0 && ( images.get(0).deltaEast!=0.0 ||images.get(0).deltaNorth!=0.0));311 Action resetOffset = new ResetOffsetActionMenu(); 312 resetOffset.setEnabled(!isRaster && images.size() > 0 && (deltaEast!=0.0 || deltaNorth!=0.0)); 313 313 return new Action[] { 314 314 LayerListDialog.getInstance().createShowHideLayerAction(), … … 338 338 new GeorefImage(null, 339 339 Main.getProjection().latlon2eastNorth(bounds.getMin()), 340 Main.getProjection().latlon2eastNorth(bounds.getMax())); 340 Main.getProjection().latlon2eastNorth(bounds.getMax()), this); 341 341 for (GeorefImage img : images) { 342 342 if (img.overlap(georefImage)) … … 509 509 } 510 510 } 511 newImage.wmsLayer = this; 511 512 this.images.add(newImage); 512 513 } … … 550 551 synchronized(this) { 551 552 images.clear(); 552 images.add(new GeorefImage(new_img, min, max)); 553 images.add(new GeorefImage(new_img, min, max, this)); 553 554 } 554 555 } … … 626 627 images.get(0).shear(dx, dy); 627 628 } else { 628 for (GeorefImage image:images)629 image.tempShear(dx, dy);629 deltaEast+=dx; 630 deltaNorth+=dy; 630 631 } 631 632 }
Note:
See TracChangeset
for help on using the changeset viewer.