Changeset 18312 in osm for applications/editors/josm/plugins/cadastre-fr
- Timestamp:
- 2009-10-27T19:42:44+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java
r17215 r18312 129 129 } 130 130 131 /* 132 * Method required by BufferedImage serialization 131 /** 132 * Method required by BufferedImage serialization. 133 * Save only primitives to keep cache independent of software changes. 133 134 */ 134 135 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { 135 max = new EastNorth( (Double)in.readObject(), (Double)in.readObject());136 min = new EastNorth( (Double)in.readObject(), (Double)in.readObject());136 max = new EastNorth(in.readDouble(), in.readDouble()); 137 min = new EastNorth(in.readDouble(), in.readDouble()); 137 138 image = (BufferedImage) ImageIO.read(ImageIO.createImageInputStream(in)); 138 139 updatePixelPer(); 139 140 } 140 141 141 /* 142 * Method required by BufferedImage serialization 142 /** 143 * Method required by BufferedImage serialization. 144 * Cache uses only primitives to stay independent of software changes. 143 145 */ 144 146 private void writeObject(ObjectOutputStream out) throws IOException { 145 out.write Object(max.getX());146 out.write Object(max.getY());147 out.write Object(min.getX());148 out.write Object(min.getY());147 out.writeDouble(max.getX()); 148 out.writeDouble(max.getY()); 149 out.writeDouble(min.getX()); 150 out.writeDouble(min.getY()); 149 151 ImageIO.write(image, "png", ImageIO.createImageOutputStream(out)); 150 152 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r18289 r18312 356 356 357 357 /** 358 * Called by CacheControl when a new cache file is created on disk 358 * Called by CacheControl when a new cache file is created on disk. 359 * Save only primitives to keep cache independent of software changes. 359 360 * @param oos 360 361 * @throws IOException … … 362 363 public void write(ObjectOutputStream oos) throws IOException { 363 364 oos.writeInt(this.serializeFormatVersion); 364 oos.writeObject(this.location); 365 oos.writeObject(this.codeCommune); 365 oos.writeObject(this.location); // String 366 oos.writeObject(this.codeCommune); // String 366 367 oos.writeInt(this.lambertZone); 367 368 oos.writeBoolean(this.isRaster); 368 369 if (this.isRaster) { 369 oos.writeObject(this.rasterMin); 370 oos.writeObject(this.rasterMax); 370 oos.writeDouble(this.rasterMin.getX()); 371 oos.writeDouble(this.rasterMin.getY()); 372 oos.writeDouble(this.rasterMax.getX()); 373 oos.writeDouble(this.rasterMax.getY()); 371 374 oos.writeDouble(this.rasterRatio); 372 375 } 373 oos.writeObject(this.communeBBox); 374 } 375 376 /** 377 * Called by CacheControl when a cache file is read from disk 376 oos.writeObject(this.communeBBox.min.getX()); 377 oos.writeObject(this.communeBBox.min.getY()); 378 oos.writeObject(this.communeBBox.max.getX()); 379 oos.writeObject(this.communeBBox.max.getY()); 380 } 381 382 /** 383 * Called by CacheControl when a cache file is read from disk. 384 * Cache uses only primitives to stay independent of software changes. 378 385 * @param ois 379 386 * @throws IOException … … 392 399 this.setRaster(ois.readBoolean()); 393 400 if (this.isRaster) { 394 this.rasterMin = (EastNorth) ois.readObject(); 395 this.rasterMax = (EastNorth) ois.readObject(); 401 double X = ois.readDouble(); 402 double Y = ois.readDouble(); 403 this.rasterMin = new EastNorth(X, Y); 404 X = ois.readDouble(); 405 Y = ois.readDouble(); 406 this.rasterMax = new EastNorth(X, Y); 396 407 this.rasterRatio = ois.readDouble(); 397 408 } 398 this.communeBBox = (EastNorthBound) ois.readObject(); 409 double minX = ois.readDouble(); 410 double minY = ois.readDouble(); 411 double maxX = ois.readDouble(); 412 double maxY = ois.readDouble(); 413 this.communeBBox = new EastNorthBound(new EastNorth(minX, minY), new EastNorth(maxX, maxY)); 399 414 if (this.lambertZone != currentLambertZone && currentLambertZone != -1) { 400 415 JOptionPane.showMessageDialog(Main.parent, tr("Lambert zone {0} in cache "+
Note:
See TracChangeset
for help on using the changeset viewer.