Ignore:
Timestamp:
2013-09-10T21:04:07+02:00 (13 years ago)
Author:
pieren
Message:

#9052 add load/save sessions feature

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java

    r29828 r29922  
    1515import java.awt.image.ImageObserver;
    1616import java.io.EOFException;
     17import java.io.File;
    1718import java.io.IOException;
    1819import java.io.ObjectInputStream;
     
    131132    public void destroy() {
    132133        // 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();
    134136        grabThread = null;
    135137        super.destroy();
     
    439441     * @throws IOException
    440442     */
    441     public void write(ObjectOutputStream oos) throws IOException {
     443    public void write(File associatedFile, ObjectOutputStream oos) throws IOException {
    442444        currentFormat = this.serializeFormatVersion;
     445        setAssociatedFile(associatedFile);
    443446        oos.writeInt(this.serializeFormatVersion);
    444447        oos.writeObject(this.location);    // String
     
    467470     * @throws ClassNotFoundException
    468471     */
    469     public boolean read(ObjectInputStream ois, int currentLambertZone) throws IOException, ClassNotFoundException {
     472    public boolean read(File associatedFile, ObjectInputStream ois, int currentLambertZone) throws IOException, ClassNotFoundException {
    470473        currentFormat = ois.readInt();;
    471474        if (currentFormat < 2) {
     
    478481        this.lambertZone = ois.readInt();
    479482        this.setRaster(ois.readBoolean());
     483        setAssociatedFile(associatedFile);
    480484        if (currentFormat >= 4)
    481485            ois.readBoolean();
Note: See TracChangeset for help on using the changeset viewer.