Changeset 24555 in osm for applications/editors/josm/plugins
- Timestamp:
- 2010-12-03T14:17:09+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryLayer.java
r24541 r24555 17 17 protected static final Icon icon = 18 18 new ImageIcon(Toolkit.getDefaultToolkit().createImage(ImageryPlugin.class.getResource("/images/imagery_small.png"))); 19 20 protected ImageryInfo info; 19 21 protected MapView mv; 20 22 … … 22 24 protected double dy = 0.0; 23 25 24 public ImageryLayer(String name) { 25 super(name); 26 mv = Main.map.mapView; 26 public ImageryLayer(ImageryInfo info) { 27 super(info.getName()); 28 this.info = info; 29 this.mv = Main.map.mapView; 27 30 } 28 31 … … 44 47 public double getDy() { 45 48 return dy; 49 } 50 51 public ImageryInfo getInfo() { 52 return info; 46 53 } 47 54 -
applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/tms/TMSLayer.java
r24548 r24555 178 178 @SuppressWarnings("serial") 179 179 public TMSLayer(ImageryInfo info) { 180 super(info .getName());180 super(info); 181 181 182 182 setBackgroundLayer(true); … … 191 191 } else if (info.getImageryType() == ImageryType.BING) { 192 192 initTileSource(new BingAerialTileSource()); 193 } else throw new AssertionError();193 } else throw new IllegalStateException("cannot create TMSLayer with non-TMS ImageryInfo"); 194 194 195 195 tileOptionMenu = new JPopupMenu(); … … 380 380 int getMaxZoomLvl() 381 381 { 382 return TMSPreferences.getMaxZoomLvl(tileSource); 382 if (info.getMaxZoom() != 0) { 383 return TMSPreferences.checkMaxZoomLvl(info.getMaxZoom(), tileSource); 384 } else { 385 return TMSPreferences.getMaxZoomLvl(tileSource); 386 } 383 387 } 384 388 -
applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/wms/WMSAdapter.java
r24501 r24555 31 31 32 32 public Grabber getGrabber(MapView mv, WMSLayer layer){ 33 if(layer. info.getImageryType() == ImageryType.HTML)33 if(layer.getInfo().getImageryType() == ImageryType.HTML) 34 34 return new HTMLGrabber(mv, layer, cache); 35 else if(layer. info.getImageryType() == ImageryType.WMS)35 else if(layer.getInfo().getImageryType() == ImageryType.WMS) 36 36 return new WMSGrabber(mv, layer, cache); 37 else throw new AssertionError();37 else throw new IllegalStateException("WMSAdapter.getGrabber() called for non-WMS layer type"); 38 38 } 39 39 -
applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/wms/WMSGrabber.java
r24501 r24555 44 44 WMSGrabber(MapView mv, WMSLayer layer, CacheFiles cache) { 45 45 super(mv, layer, cache); 46 this.baseURL = layer. info.getURL();46 this.baseURL = layer.getInfo().getURL(); 47 47 /* URL containing placeholders? */ 48 48 urlWithPatterns = isUrlWithPatterns(baseURL); … … 168 168 169 169 HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 170 if(layer. info.getCookies() != null && !layer.info.getCookies().equals(""))171 conn.setRequestProperty("Cookie", layer. info.getCookies());170 if(layer.getInfo().getCookies() != null && !layer.getInfo().getCookies().equals("")) 171 conn.setRequestProperty("Cookie", layer.getInfo().getCookies()); 172 172 conn.setRequestProperty("User-Agent", Main.pref.get("wmsplugin.user_agent", Version.getInstance().getAgentString())); 173 173 conn.setConnectTimeout(Main.pref.getInteger("wmsplugin.timeout.connect", 30) * 1000); -
applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/wms/WMSLayer.java
r24541 r24555 69 69 protected boolean autoDownloadEnabled = true; 70 70 protected boolean settingsChanged; 71 protected ImageryInfo info;72 71 73 72 // Image index boundary for current view … … 101 100 102 101 public WMSLayer(ImageryInfo info) { 103 super(info .getName());102 super(info); 104 103 setBackgroundLayer(true); /* set global background variable */ 105 104 initializeImages();
Note:
See TracChangeset
for help on using the changeset viewer.