public class ImageryInfo extends TileSourceInfo implements java.lang.Comparable<ImageryInfo>, Attributed
Modifier and Type | Class and Description |
---|---|
static class |
ImageryInfo.ImageryBounds
Multi-polygon bounds for imagery backgrounds.
|
static class |
ImageryInfo.ImageryPreferenceEntry
Auxiliary class to save an
ImageryInfo object in the preferences. |
static class |
ImageryInfo.ImageryType
Type of imagery entry.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
attributionImage
Image of a graphical attribution displayed when using the imagery
|
private java.lang.String |
attributionImageURL
Link behind the graphical attribution displayed when using the imagery
|
private java.lang.String |
attributionLinkURL
Link behing the text attribution displayed when using the imagery
|
private java.lang.String |
attributionText
Text of a text attribution displayed when using the imagery
|
private ImageryInfo.ImageryBounds |
bounds
display bounds of imagery, displayed in prefs and used for automatic imagery selection
|
private java.lang.String |
cookies
The data part of HTTP cookies header in case the service requires cookies to work
|
private java.lang.String |
countryCode
country code of the imagery (for country specific imagery)
|
private boolean |
defaultEntry
whether this is a entry activated by default or not
|
private int |
defaultMaxZoom
maximum zoom level for TMS imagery
|
private int |
defaultMinZoom
minimum zoom level for TMS imagery
|
private java.lang.String |
description
description of the imagery entry, should contain notes what type of data it is
|
private java.lang.String |
eulaAcceptanceRequired
Whether this service requires a explicit EULA acceptance before it can be activated
|
private java.lang.String |
icon
icon used in menu
|
private ImageryInfo.ImageryType |
imageryType
type of the imagery servics - WMS, TMS, ...
|
private boolean |
isEpsg4326To3857Supported |
private boolean |
isGeoreferenceValid |
private java.lang.String |
langDescription
language of the description entry
|
private java.lang.String |
langName
(original) language of the translated name entry
|
private java.util.List<ImageryInfo> |
mirrors
mirrors of different type for this entry
|
private java.lang.String |
origName
original name of the imagery entry in case of translation call, for multiple languages English when possible
|
private double |
pixelPerDegree |
private java.util.List<java.lang.String> |
serverProjections
projections supported by WMS servers
|
private java.lang.String |
termsOfUseText
Text with usage terms displayed when using the imagery
|
private java.lang.String |
termsOfUseURL
Link behind the text with usage terms displayed when using the imagery
|
id, maxZoom, metadataHeaders, minZoom, name, noTileChecksums, noTileHeaders, url
Constructor and Description |
---|
ImageryInfo()
Constructs a new WMS
ImageryInfo . |
ImageryInfo(ImageryInfo.ImageryPreferenceEntry e)
Constructs a new
ImageryInfo from an imagery preference entry. |
ImageryInfo(ImageryInfo i)
Constructs a new
ImageryInfo from an existing one. |
ImageryInfo(java.lang.String name)
Constructs a new WMS
ImageryInfo with a given name. |
ImageryInfo(java.lang.String name,
java.lang.String url)
Constructs a new WMS
ImageryInfo with given name and extended URL. |
ImageryInfo(java.lang.String name,
java.lang.String url,
java.lang.String eulaAcceptanceRequired)
Constructs a new WMS
ImageryInfo with given name, extended and EULA URLs. |
ImageryInfo(java.lang.String name,
java.lang.String url,
java.lang.String type,
java.lang.String eulaAcceptanceRequired,
java.lang.String cookies)
Constructs a new
ImageryInfo with given name, url, extended and EULA URLs. |
ImageryInfo(java.lang.String name,
java.lang.String url,
java.lang.String type,
java.lang.String eulaAcceptanceRequired,
java.lang.String cookies,
java.lang.String id) |
Modifier and Type | Method and Description |
---|---|
void |
addMirror(ImageryInfo entry)
Adds a mirror entry.
|
void |
clearId() |
int |
compareTo(ImageryInfo in) |
void |
copyAttribution(ImageryInfo i)
Copies attribution from another
ImageryInfo . |
boolean |
equals(java.lang.Object o) |
boolean |
equalsBaseValues(ImageryInfo in) |
boolean |
equalsPref(ImageryInfo other)
Check if this object equals another ImageryInfo with respect to the properties
that get written to the preference file.
|
java.awt.Image |
getAttributionImage() |
java.lang.String |
getAttributionImageURL() |
java.lang.String |
getAttributionLinkURL() |
java.lang.String |
getAttributionText(int zoom,
ICoordinate topLeft,
ICoordinate botRight) |
ImageryInfo.ImageryBounds |
getBounds()
Returns the imagery polygonial bounds.
|
java.lang.String |
getCookies()
Return the data part of HTTP cookies header in case the service requires cookies to work
|
java.lang.String |
getCountryCode()
Returns the ISO 3166-1-alpha-2 country code.
|
java.lang.String |
getDescription()
Returns the description text when existing.
|
java.lang.String |
getEulaAcceptanceRequired()
Returns the EULA acceptance URL, if any.
|
java.lang.String |
getExtendedUrl()
Returns the extended URL, containing in addition of service URL, its type and min/max zoom info.
|
java.lang.String |
getIcon()
Returns the entry icon.
|
ImageryInfo.ImageryType |
getImageryType()
Returns the imagery type.
|
int |
getMaxZoom()
Returns the maximum zoom level.
|
java.lang.String |
getMenuName() |
int |
getMinZoom()
Returns the minimum zoom level.
|
java.util.List<ImageryInfo> |
getMirrors()
Returns the mirror entries.
|
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getNoTileChecksums()
Checkusm for empty tiles for servers delivering such tile types
|
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getNoTileHeaders()
Request header information for empty tiles for servers delivering such tile types
|
java.lang.String |
getOriginalName()
Returns the entry name.
|
double |
getPixelPerDegree() |
java.util.List<java.lang.String> |
getServerProjections()
Get the projections supported by the server.
|
java.lang.String |
getTermsOfUseText() |
java.lang.String |
getTermsOfUseURL() |
java.lang.String |
getToolbarName() |
java.lang.String |
getToolTipText()
Returns a tool tip text for display.
|
boolean |
hasAttribution()
Determines if this entry requires attribution.
|
int |
hashCode() |
boolean |
isBlacklisted()
Returns true if this layer's URL is matched by one of the regular
expressions kept by the current OsmApi instance.
|
boolean |
isDefaultEntry()
Determines if this entry is enabled by default.
|
boolean |
isEpsg4326To3857Supported() |
boolean |
isGeoreferenceValid() |
boolean |
requiresAttribution() |
void |
setAttribution(AbstractTileSource s)
Applies the attribution from this object to a tile source.
|
void |
setAttributionImage(java.lang.String text) |
void |
setAttributionImageURL(java.lang.String text) |
void |
setAttributionLinkURL(java.lang.String text) |
void |
setAttributionText(java.lang.String text) |
void |
setBounds(ImageryInfo.ImageryBounds b)
Sets the imagery polygonial bounds.
|
void |
setCountryCode(java.lang.String countryCode)
Sets the ISO 3166-1-alpha-2 country code.
|
void |
setDefaultEntry(boolean defaultEntry)
Sets the default state of this entry.
|
void |
setDefaultMaxZoom(int defaultMaxZoom)
Sets the maximum zoom level.
|
void |
setDefaultMinZoom(int defaultMinZoom)
Sets the minimum zoom level.
|
void |
setDescription(java.lang.String language,
java.lang.String description)
Sets the description text when existing.
|
void |
setEpsg4326To3857Supported(boolean isEpsg4326To3857Supported) |
void |
setEulaAcceptanceRequired(java.lang.String eulaAcceptanceRequired)
Sets the EULA acceptance URL.
|
void |
setExtendedUrl(java.lang.String url)
Sets the extended URL of this entry.
|
void |
setGeoreferenceValid(boolean isGeoreferenceValid) |
void |
setIcon(java.lang.String icon)
Sets the entry icon.
|
void |
setImageryType(ImageryInfo.ImageryType imageryType)
Sets the imagery type.
|
void |
setMetadataHeaders(java.util.Map<java.lang.String,java.lang.String> metadataHeaders)
Returns the map of <header name, metadata key> indicating, which HTTP headers should
be moved to metadata
|
void |
setName(java.lang.String language,
java.lang.String name)
Sets the entry name and handle translation.
|
void |
setNoTileChecksums(MultiMap<java.lang.String,java.lang.String> noTileChecksums)
Sets the map of <checksum type, checksum value> that if any tile with that checksum
will be returned, then this tile will be treated as "no tile at this zoom level"
|
void |
setNoTileHeaders(MultiMap<java.lang.String,java.lang.String> noTileHeaders)
Sets the map of <header name, header value> that if any of this header
will be returned, then this tile will be treated as "no tile at this zoom level"
|
void |
setPixelPerDegree(double ppd) |
void |
setServerProjections(java.util.Collection<java.lang.String> serverProjections) |
void |
setTermsOfUseText(java.lang.String text) |
void |
setTermsOfUseURL(java.lang.String text) |
java.lang.String |
toString() |
getId, getMetadataHeaders, getName, getTileSize, getUrl, setId, setName, setTileSize, setUrl
private java.lang.String origName
private java.lang.String langName
private boolean defaultEntry
private java.lang.String cookies
private java.lang.String eulaAcceptanceRequired
private ImageryInfo.ImageryType imageryType
private double pixelPerDegree
private int defaultMaxZoom
private int defaultMinZoom
private ImageryInfo.ImageryBounds bounds
private java.util.List<java.lang.String> serverProjections
private java.lang.String description
private java.lang.String langDescription
private java.lang.String attributionText
private java.lang.String attributionLinkURL
private java.lang.String attributionImage
private java.lang.String attributionImageURL
private java.lang.String termsOfUseText
private java.lang.String termsOfUseURL
private java.lang.String countryCode
private java.util.List<ImageryInfo> mirrors
private java.lang.String icon
private boolean isGeoreferenceValid
private boolean isEpsg4326To3857Supported
public ImageryInfo()
ImageryInfo
.public ImageryInfo(java.lang.String name)
ImageryInfo
with a given name.name
- The entry namepublic ImageryInfo(java.lang.String name, java.lang.String url)
ImageryInfo
with given name and extended URL.name
- The entry nameurl
- The entry extended URLpublic ImageryInfo(java.lang.String name, java.lang.String url, java.lang.String eulaAcceptanceRequired)
ImageryInfo
with given name, extended and EULA URLs.name
- The entry nameurl
- The entry URLeulaAcceptanceRequired
- The EULA URLpublic ImageryInfo(java.lang.String name, java.lang.String url, java.lang.String type, java.lang.String eulaAcceptanceRequired, java.lang.String cookies)
ImageryInfo
with given name, url, extended and EULA URLs.name
- The entry nameurl
- The entry URLtype
- The entry imagery type. If null, WMS will be used as defaulteulaAcceptanceRequired
- The EULA URLcookies
- The data part of HTTP cookies header in case the service requires cookies to workjava.lang.IllegalArgumentException
- if type refers to an unknown imagery typepublic ImageryInfo(java.lang.String name, java.lang.String url, java.lang.String type, java.lang.String eulaAcceptanceRequired, java.lang.String cookies, java.lang.String id)
public ImageryInfo(ImageryInfo.ImageryPreferenceEntry e)
ImageryInfo
from an imagery preference entry.e
- The imagery preference entrypublic ImageryInfo(ImageryInfo i)
ImageryInfo
from an existing one.i
- The other imagery infopublic int hashCode()
hashCode
in class java.lang.Object
public boolean equalsPref(ImageryInfo other)
pixelPerDegree
is ignored.other
- the ImageryInfo object to compare topublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(ImageryInfo in)
compareTo
in interface java.lang.Comparable<ImageryInfo>
public boolean equalsBaseValues(ImageryInfo in)
public void setPixelPerDegree(double ppd)
public void setDefaultMaxZoom(int defaultMaxZoom)
defaultMaxZoom
- The maximum zoom levelpublic void setDefaultMinZoom(int defaultMinZoom)
defaultMinZoom
- The minimum zoom levelpublic void setBounds(ImageryInfo.ImageryBounds b)
b
- The imagery bounds (non-rectangular)public ImageryInfo.ImageryBounds getBounds()
public boolean requiresAttribution()
requiresAttribution
in interface Attributed
public java.lang.String getAttributionText(int zoom, ICoordinate topLeft, ICoordinate botRight)
getAttributionText
in interface Attributed
zoom
- The optional zoom level for the view.topLeft
- The top left of the bounding box for attribution.botRight
- The bottom right of the bounding box for attribution.public java.lang.String getAttributionLinkURL()
getAttributionLinkURL
in interface Attributed
public java.awt.Image getAttributionImage()
getAttributionImage
in interface Attributed
public java.lang.String getAttributionImageURL()
getAttributionImageURL
in interface Attributed
public java.lang.String getTermsOfUseText()
getTermsOfUseText
in interface Attributed
public java.lang.String getTermsOfUseURL()
getTermsOfUseURL
in interface Attributed
public void setAttributionText(java.lang.String text)
public void setAttributionImageURL(java.lang.String text)
public void setAttributionImage(java.lang.String text)
public void setAttributionLinkURL(java.lang.String text)
public void setTermsOfUseText(java.lang.String text)
public void setTermsOfUseURL(java.lang.String text)
public void setExtendedUrl(java.lang.String url)
url
- Entry extended URL containing in addition of service URL, its type and min/max zoom infopublic java.lang.String getOriginalName()
public void setName(java.lang.String language, java.lang.String name)
language
- The used languagename
- The entry namepublic void clearId()
public boolean isDefaultEntry()
true
if this entry is enabled by default, false
otherwisepublic void setDefaultEntry(boolean defaultEntry)
defaultEntry
- true
if this entry has to be enabled by default, false
otherwisepublic java.lang.String getCookies()
getCookies
in class TileSourceInfo
public double getPixelPerDegree()
public int getMaxZoom()
getMaxZoom
in class TileSourceInfo
public int getMinZoom()
getMinZoom
in class TileSourceInfo
public java.lang.String getDescription()
public void setDescription(java.lang.String language, java.lang.String description)
language
- The used languagedescription
- the imagery description textpublic java.lang.String getToolTipText()
public java.lang.String getEulaAcceptanceRequired()
null
public void setEulaAcceptanceRequired(java.lang.String eulaAcceptanceRequired)
eulaAcceptanceRequired
- The URL to an EULA text that has to be accepted before usepublic java.lang.String getCountryCode()
public void setCountryCode(java.lang.String countryCode)
countryCode
- The country code (2 letters)public java.lang.String getIcon()
public void setIcon(java.lang.String icon)
icon
- The entry iconpublic java.util.List<java.lang.String> getServerProjections()
public void setServerProjections(java.util.Collection<java.lang.String> serverProjections)
public java.lang.String getExtendedUrl()
public java.lang.String getToolbarName()
public java.lang.String getMenuName()
public boolean hasAttribution()
true
if some attribution text has to be displayed, false
otherwisepublic void copyAttribution(ImageryInfo i)
ImageryInfo
.i
- The other imagery info to get attribution frompublic void setAttribution(AbstractTileSource s)
s
- The tile sourcepublic ImageryInfo.ImageryType getImageryType()
public void setImageryType(ImageryInfo.ImageryType imageryType)
imageryType
- The imagery typepublic boolean isBlacklisted()
true
is this entry is blacklisted, false
otherwisepublic void setNoTileHeaders(MultiMap<java.lang.String,java.lang.String> noTileHeaders)
noTileHeaders
- Map of <header name, header value> which will be treated as "no tile at this zoom level"public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getNoTileHeaders()
TileSourceInfo
getNoTileHeaders
in class TileSourceInfo
public void setNoTileChecksums(MultiMap<java.lang.String,java.lang.String> noTileChecksums)
noTileChecksums
- Map of <checksum type, checksum value> which will be treated as "no tile at this zoom level"public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getNoTileChecksums()
TileSourceInfo
getNoTileChecksums
in class TileSourceInfo
public void setMetadataHeaders(java.util.Map<java.lang.String,java.lang.String> metadataHeaders)
metadataHeaders
- map of <header name, metadata key> indicating, which HTTP headers should be moved to metadatapublic boolean isEpsg4326To3857Supported()
public void setEpsg4326To3857Supported(boolean isEpsg4326To3857Supported)
public boolean isGeoreferenceValid()
public void setGeoreferenceValid(boolean isGeoreferenceValid)
public void addMirror(ImageryInfo entry)
entry
- the mirror to be addedpublic java.util.List<ImageryInfo> getMirrors()