Changeset 29922 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Timestamp:
- 2013-09-10T21:04:07+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
r29732 r29922 146 146 fis = new FileInputStream(file); 147 147 ois = new ObjectInputStream(fis); 148 successfulRead = wmsLayer.read( ois, currentLambertZone);148 successfulRead = wmsLayer.read(file, ois, currentLambertZone); 149 149 } catch (Exception ex) { 150 150 ex.printStackTrace(System.out); … … 195 195 ObjectOutputStream oos = new ObjectOutputStream( 196 196 new BufferedOutputStream(new FileOutputStream(file))); 197 wmsLayer.write( oos);197 wmsLayer.write(file, oos); 198 198 for (int i=0; i < size; i++) { 199 199 oos.writeObject(imagesToSave.get(i)); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r29829 r29922 5 5 import static org.openstreetmap.josm.tools.I18n.marktr; 6 6 import static org.openstreetmap.josm.tools.I18n.tr; 7 import static org.openstreetmap.josm.io.session.SessionWriter.registerSessionLayerExporter; 8 import static org.openstreetmap.josm.io.session.SessionReader.registerSessionLayerImporter; 7 9 8 10 import java.awt.event.ActionEvent; … … 138 140 * - workaround on address help tool when switching to full screen 139 141 * - improvement when clicking on existing node address street in mode relation 140 * - option to simplify raster images in 2 bits colors (like images served in the past). 142 * - option to simplify raster images in 2 bits colors (like images served in the past). 143 * 2.6 10-Sep-2013 - add JOSM "sessions" feature support (list of layers stored in a file) 141 144 */ 142 145 public class CadastrePlugin extends Plugin { … … 208 211 209 212 UploadAction.registerUploadHook(new CheckSourceUploadHook()); 213 214 registerSessionLayerExporter(WMSLayer.class , CadastreSessionExporter.class); 215 registerSessionLayerImporter("cadastre-fr", CadastreSessionImporter.class); 210 216 211 217 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r29828 r29922 15 15 import java.awt.image.ImageObserver; 16 16 import java.io.EOFException; 17 import java.io.File; 17 18 import java.io.IOException; 18 19 import java.io.ObjectInputStream; … … 131 132 public void destroy() { 132 133 // if the layer is currently saving the images in the cache, wait until it's finished 133 grabThread.cancel(); 134 if(grabThread != null) 135 grabThread.cancel(); 134 136 grabThread = null; 135 137 super.destroy(); … … 439 441 * @throws IOException 440 442 */ 441 public void write( ObjectOutputStream oos) throws IOException {443 public void write(File associatedFile, ObjectOutputStream oos) throws IOException { 442 444 currentFormat = this.serializeFormatVersion; 445 setAssociatedFile(associatedFile); 443 446 oos.writeInt(this.serializeFormatVersion); 444 447 oos.writeObject(this.location); // String … … 467 470 * @throws ClassNotFoundException 468 471 */ 469 public boolean read( ObjectInputStream ois, int currentLambertZone) throws IOException, ClassNotFoundException {472 public boolean read(File associatedFile, ObjectInputStream ois, int currentLambertZone) throws IOException, ClassNotFoundException { 470 473 currentFormat = ois.readInt();; 471 474 if (currentFormat < 2) { … … 478 481 this.lambertZone = ois.readInt(); 479 482 this.setRaster(ois.readBoolean()); 483 setAssociatedFile(associatedFile); 480 484 if (currentFormat >= 4) 481 485 ois.readBoolean();
Note:
See TracChangeset
for help on using the changeset viewer.