Changeset 8344 in josm for trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
- Timestamp:
- 2015-05-10T13:27:54+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r8093 r8344 10 10 import java.util.Collections; 11 11 import java.util.List; 12 import java.util.Map; 12 13 import java.util.Objects; 13 14 import java.util.TreeSet; … … 21 22 import org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource; 22 23 import org.openstreetmap.gui.jmapviewer.tilesources.OsmTileSource.Mapnik; 24 import org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo; 23 25 import org.openstreetmap.josm.Main; 24 26 import org.openstreetmap.josm.data.Bounds; … … 35 37 * @author Frederik Ramm 36 38 */ 37 public class ImageryInfo implements Comparable<ImageryInfo>, Attributed {39 public class ImageryInfo extends TileSourceInfo implements Comparable<ImageryInfo>, Attributed { 38 40 39 41 /** … … 53 55 /** A WMS endpoint entry only stores the WMS server info, without layer, which are chosen later by the user. **/ 54 56 WMS_ENDPOINT("wms_endpoint"); 57 55 58 56 59 private final String typeString; … … 151 154 } 152 155 153 /** name of the imagery entry (gets translated by josm usually) */ 154 private String name; 156 155 157 /** original name of the imagery entry in case of translation call, for multiple languages English when possible */ 156 158 private String origName; 157 159 /** (original) language of the translated name entry */ 158 160 private String langName; 159 /** id for this imagery entry, optional at the moment */160 private String id;161 /** URL of the imagery service */162 private String url = null;163 161 /** whether this is a entry activated by default or not */ 164 162 private boolean defaultEntry = false; … … 199 197 private String icon; 200 198 // when adding a field, also adapt the ImageryInfo(ImageryInfo) constructor 199 private Map<String, String> noTileHeaders; 201 200 202 201 /** … … 225 224 @pref String icon; 226 225 @pref String description; 226 @pref Map<String, String> noTileHeaders; 227 227 228 228 /** … … 278 278 projections = val.toString(); 279 279 } 280 if (i.noTileHeaders != null && !i.noTileHeaders.isEmpty()) { 281 noTileHeaders = i.noTileHeaders; 282 } 280 283 } 281 284 … … 295 298 */ 296 299 public ImageryInfo() { 300 super(); 297 301 } 298 302 … … 302 306 */ 303 307 public ImageryInfo(String name) { 304 this.name=name;308 super(name); 305 309 } 306 310 … … 311 315 */ 312 316 public ImageryInfo(String name, String url) { 313 this .name=name;317 this(name); 314 318 setExtendedUrl(url); 315 319 } … … 322 326 */ 323 327 public ImageryInfo(String name, String url, String eulaAcceptanceRequired) { 324 this .name=name;328 this(name); 325 329 setExtendedUrl(url); 326 330 this.eulaAcceptanceRequired = eulaAcceptanceRequired; … … 337 341 */ 338 342 public ImageryInfo(String name, String url, String type, String eulaAcceptanceRequired, String cookies) { 339 this .name=name;343 this(name); 340 344 setExtendedUrl(url); 341 345 ImageryType t = ImageryType.fromString(type); … … 347 351 throw new IllegalArgumentException("unknown type: "+type); 348 352 } 353 } 354 355 public ImageryInfo(String name, String url, String type, String eulaAcceptanceRequired, String cookies, String id) { 356 this(name, url, type, eulaAcceptanceRequired, cookies); 357 setId(id); 349 358 } 350 359 … … 390 399 countryCode = e.country_code; 391 400 icon = e.icon; 401 if (e.noTileHeaders != null) { 402 noTileHeaders = e.noTileHeaders; 403 } 392 404 } 393 405 … … 688 700 * @return The entry name 689 701 */ 702 @Override 690 703 public String getName() { 691 704 return this.name; … … 759 772 * @return The entry URL 760 773 */ 774 @Override 761 775 public String getUrl() { 762 776 return this.url; … … 791 805 * @return the cookie data part 792 806 */ 807 @Override 793 808 public String getCookies() { 794 809 return this.cookies; … … 803 818 * @return The maximum zoom level 804 819 */ 820 @Override 805 821 public int getMaxZoom() { 806 822 return this.defaultMaxZoom; … … 811 827 * @return The minimum zoom level 812 828 */ 829 @Override 813 830 public int getMinZoom() { 814 831 return this.defaultMinZoom; … … 1026 1043 return capabilities != null && capabilities.isOnImageryBlacklist(this.url); 1027 1044 } 1045 1046 public void setNoTileHeaders(Map<String, String> noTileHeaders) { 1047 this.noTileHeaders = noTileHeaders; 1048 } 1049 1050 @Override 1051 public Map<String, String> getNoTileHeaders() { 1052 return noTileHeaders; 1053 } 1028 1054 }
Note:
See TracChangeset
for help on using the changeset viewer.