Changeset 4633 in josm for trunk/src/org


Ignore:
Timestamp:
2011-12-04T14:21:52+01:00 (9 years ago)
Author:
jttt
Message:

Fix #7109 WMS-cache does not cache between sessions/INDEX_FILENAME = "index.xml" does not get created

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java

    r4506 r4633  
    4444import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    4545import org.openstreetmap.josm.data.ProjectionBounds;
    46 import org.openstreetmap.josm.data.projection.Mercator;
    47 import org.openstreetmap.josm.data.projection.Projection;
    4846import org.openstreetmap.josm.data.coor.EastNorth;
    4947import org.openstreetmap.josm.data.imagery.GeorefImage;
     
    5351import org.openstreetmap.josm.data.imagery.ImageryLayerInfo;
    5452import org.openstreetmap.josm.data.imagery.WmsCache;
     53import org.openstreetmap.josm.data.imagery.types.ObjectFactory;
    5554import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    5655import org.openstreetmap.josm.data.preferences.BooleanProperty;
    5756import org.openstreetmap.josm.data.preferences.IntegerProperty;
     57import org.openstreetmap.josm.data.projection.Mercator;
     58import org.openstreetmap.josm.data.projection.Projection;
    5859import org.openstreetmap.josm.gui.MapView;
    5960import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
     
    7172 */
    7273public class WMSLayer extends ImageryLayer implements ImageObserver, PreferenceChangedListener {
     74
     75    private static final ObjectFactory OBJECT_FACTORY = null; // Fake reference to keep build scripts from removing ObjectFactory class. This class is not used directly but it's necessary for jaxb to work
     76
    7377    public static final BooleanProperty PROP_ALPHA_CHANNEL = new BooleanProperty("imagery.wms.alpha_channel", true);
    7478    public static final IntegerProperty PROP_SIMULTANEOUS_CONNECTIONS = new IntegerProperty("imagery.wms.simultaneousConnections", 3);
     
    151155        attribution.initialize(this.info);
    152156
    153         if(info.getUrl() != null)
     157        if(info.getUrl() != null) {
    154158            startGrabberThreads();
     159        }
    155160
    156161        Main.pref.addPreferenceChangeListener(this);
     
    572577                        tr("Error"),
    573578                        JOptionPane.ERROR_MESSAGE
    574                 );
     579                        );
    575580            } else {
    576581                downloadAndPaintVisible(mv.getGraphics(), mv, true);
     
    692697                    ObjectOutputStream oos = new ObjectOutputStream(
    693698                            new FileOutputStream(f)
    694                     );
     699                            );
    695700                    oos.writeInt(serializeFormatVersion);
    696701                    oos.writeInt(dax);
     
    921926        List<String> serverProjections = info.getServerProjections();
    922927        return serverProjections.contains(proj.toCode().toUpperCase())
    923         || (proj instanceof Mercator && serverProjections.contains("EPSG:4326"));
     928                || (proj instanceof Mercator && serverProjections.contains("EPSG:4326"));
    924929    }
    925930
     
    928933        String res = "";
    929934        for(String p : info.getServerProjections()) {
    930             if(!res.isEmpty())
     935            if(!res.isEmpty()) {
    931936                res += ", ";
     937            }
    932938            res += p;
    933939        }
Note: See TracChangeset for help on using the changeset viewer.