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.ImageryCategory
Category of imagery entry.
|
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 behind the text attribution displayed when using the imagery
|
private java.lang.String |
attributionText
Text of a text attribution displayed when using the imagery
|
private boolean |
bestMarked
marked as best in other editors
|
private ImageryInfo.ImageryBounds |
bounds
display bounds of imagery, displayed in prefs and used for automatic imagery selection
|
private ImageryInfo.ImageryCategory |
category
category of the imagery
|
private java.lang.String |
categoryOriginalString
category of the imagery (input string, not saved, copied or used otherwise except for error checks)
|
private java.lang.String |
countryCode
country code of the imagery (for country specific imagery)
|
private java.util.Map<java.lang.String,java.lang.String> |
customHttpHeaders
HTTP headers
|
private java.lang.String |
date
creation date of the imagery (in the form YYYY-MM-DD;YYYY-MM-DD, where
DD and MM as well as a second date are optional)
|
private boolean |
defaultEntry
whether this is a entry activated by default or not
|
private java.util.List<DefaultLayer> |
defaultLayers
which layers should be activated by default on layer addition.
|
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 |
isGeoreferenceValid
is the geo reference correct - don't offer offset handling
|
private java.lang.String |
langDescription
language of the description entry
|
private java.lang.String |
langName
(original) language of the translated name entry
|
private static java.util.Map<java.lang.String,java.lang.String> |
localizedCountriesCache |
private int |
minimumTileExpire |
private java.util.List<ImageryInfo> |
mirrors
mirrors of different type for this entry
|
private java.util.Collection<java.lang.String> |
oldIds
list of old IDs, only for loading, not handled anywhere else
|
private java.lang.String |
origName
original name of the imagery entry in case of translation call, for multiple languages English when possible
|
private boolean |
overlay
marked as overlay
|
private java.lang.String |
permissionReferenceURL
Link to a reference stating the permission for OSM usage
|
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
|
private boolean |
transparent
Should this map be transparent
|
cookies, id, maxZoom, metadataHeaders, minZoom, modTileFeatures, name, noTileChecksums, noTileHeaders, tileSize, 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)
Constructs a new
ImageryInfo with given name, url, id, extended and EULA URLs. |
Modifier and Type | Method and Description |
---|---|
void |
addMirror(ImageryInfo entry)
Adds a mirror entry.
|
void |
addOldId(java.lang.String id)
Adds an old Id.
|
void |
clearId()
Store the id of this info to the preferences and clear it afterwards.
|
int |
compareTo(ImageryInfo in) |
void |
copyAttribution(ImageryInfo i)
Copies attribution from another
ImageryInfo . |
boolean |
equals(java.lang.Object o) |
boolean |
equalsBaseValues(ImageryInfo in)
Determines if URL is equal to given imagery info.
|
boolean |
equalsPref(ImageryInfo other)
Check if this object equals another ImageryInfo with respect to the properties
that get written to the preference file.
|
static java.util.Collection<java.lang.String> |
getActiveIds()
Return the sorted list of activated Imagery IDs.
|
java.awt.Image |
getAttributionImage() |
java.lang.String |
getAttributionImageRaw()
Return the raw attribution logo information (an URL to the image).
|
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 |
getCountryCode()
Returns the ISO 3166-1-alpha-2 country code.
|
java.util.Map<java.lang.String,java.lang.String> |
getCustomHttpHeaders()
Returns custom HTTP headers that should be sent with request towards imagery provider
|
java.lang.String |
getDate()
Returns the date information.
|
java.util.List<DefaultLayer> |
getDefaultLayers()
Returns default layers that should be shown for this Imagery (if at all supported by imagery provider)
If no layer is set to default and there is more than one imagery available, then user will be asked to choose the layer
to work on
|
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.ImageryCategory |
getImageryCategory()
Returns the imagery category.
|
java.lang.String |
getImageryCategoryOriginalString()
Returns the imagery category original string (don't use except for error checks).
|
ImageryInfo.ImageryType |
getImageryType()
Returns the imagery type.
|
static java.lang.String |
getLocalizedCountry(java.lang.String countryCode)
Returns a localized name for the given country code, or "Worldwide" if empty.
|
int |
getMaxZoom()
Returns the maximum zoom level.
|
java.lang.String |
getMenuName()
Gets the name that should be displayed in the menu to add this imagery layer.
|
int |
getMinimumTileExpire()
Returns minimum tile expiration in seconds.
|
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()
Checksum 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.util.Collection<java.lang.String> |
getOldIds()
Get old Ids.
|
java.lang.String |
getOriginalName()
Returns the entry name.
|
java.lang.String |
getPermissionReferenceURL()
Return the permission reference URL.
|
double |
getPixelPerDegree()
Gets the pixel per degree value
|
java.util.List<java.lang.String> |
getServerProjections()
Get the projections supported by the server.
|
java.lang.String |
getSourceName()
Get a string representation of this imagery info suitable for the
source changeset tag. |
java.lang.String |
getTermsOfUseText() |
java.lang.String |
getTermsOfUseURL() |
java.lang.String |
getToolbarName()
Gets a unique toolbar key to store this layer as toolbar item
|
java.lang.String |
getToolTipText()
Returns a tool tip text for display.
|
boolean |
hasAttribution()
Determines if this entry requires attribution.
|
int |
hashCode() |
boolean |
isBestMarked()
Returns the status of "best" marked status in other editors.
|
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 |
isGeoreferenceValid()
Gets the flag if the georeference is valid.
|
boolean |
isOverlay()
Returns the overlay indication.
|
boolean |
isTransparent()
Determines if this imagery should be transparent.
|
boolean |
requiresAttribution() |
void |
setAttribution(AbstractTileSource s)
Applies the attribution from this object to a tile source.
|
void |
setAttributionImage(java.lang.String res)
Set the image for the attribution
|
void |
setAttributionImageURL(java.lang.String url)
Set the attribution image
|
void |
setAttributionLinkURL(java.lang.String url)
Sets the URL the attribution should link to.
|
void |
setAttributionText(java.lang.String text)
Set the attribution text
|
void |
setBestMarked(boolean bestMarked)
Sets an indicator that in other editors it is marked as best imagery
|
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 |
setCustomHttpHeaders(java.util.Map<java.lang.String,java.lang.String> customHttpHeaders)
Sets custom HTTP headers that should be sent with request towards imagery provider
|
void |
setDate(java.lang.String date)
Sets the date information.
|
void |
setDefaultEntry(boolean defaultEntry)
Sets the default state of this entry.
|
void |
setDefaultLayers(java.util.List<DefaultLayer> layers)
Sets the default layers that user will work with
|
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 |
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)
Sets an indicator that the georeference is valid
|
void |
setIcon(java.lang.String icon)
Sets the entry icon.
|
void |
setImageryCategory(ImageryInfo.ImageryCategory category)
Sets the imagery category.
|
void |
setImageryCategoryOriginalString(java.lang.String categoryOriginalString)
Sets the imagery category original string (don't use except for error checks).
|
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 |
setMinimumTileExpire(int minimumTileExpire)
Sets minimum tile expiration in seconds.
|
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 |
setOverlay(boolean overlay)
Sets overlay indication
|
void |
setPermissionReferenceURL(java.lang.String url)
Sets the permission reference URL.
|
void |
setPixelPerDegree(double ppd)
Sets the pixel per degree value.
|
void |
setServerProjections(java.util.Collection<java.lang.String> serverProjections)
Sets the list of collections the server supports
|
void |
setTermsOfUseText(java.lang.String text)
Sets the text to display to the user as terms of use.
|
void |
setTermsOfUseURL(java.lang.String text)
Sets a url that links to the terms of use text.
|
void |
setTransparent(boolean transparent)
Sets whether imagery should be transparent.
|
java.lang.String |
toString() |
getCookies, getId, getMetadataHeaders, getName, getTileSize, getUrl, isModTileFeatures, setCookies, setId, setModTileFeatures, setName, setTileSize, setUrl
private java.lang.String origName
private java.lang.String langName
private boolean defaultEntry
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 permissionReferenceURL
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.lang.String date
private boolean bestMarked
private boolean overlay
private java.util.Collection<java.lang.String> oldIds
private java.util.List<ImageryInfo> mirrors
private java.lang.String icon
private boolean isGeoreferenceValid
private java.util.List<DefaultLayer> defaultLayers
private java.util.Map<java.lang.String,java.lang.String> customHttpHeaders
private boolean transparent
private int minimumTileExpire
private ImageryInfo.ImageryCategory category
private java.lang.String categoryOriginalString
private static final java.util.Map<java.lang.String,java.lang.String> localizedCountriesCache
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)
ImageryInfo
with given name, url, id, 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 workid
- tile idjava.lang.IllegalArgumentException
- if type refers to an unknown imagery typepublic 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 static java.lang.String getLocalizedCountry(java.lang.String countryCode)
countryCode
- An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area codeLocale.getDisplayCountry()
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)
in
- imagery infotrue
if URL is equal to given imagery infopublic void setPixelPerDegree(double ppd)
ppd
- The ppd valuegetPixelPerDegree()
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.lang.String getPermissionReferenceURL()
setPermissionReferenceURL(java.lang.String)
public java.awt.Image getAttributionImage()
getAttributionImage
in interface Attributed
public java.lang.String getAttributionImageRaw()
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)
text
- The textgetAttributionText(int, ICoordinate, ICoordinate)
public void setAttributionImageURL(java.lang.String url)
url
- The url of the image.getAttributionImageURL()
public void setAttributionImage(java.lang.String res)
res
- The image resourcegetAttributionImage()
public void setAttributionLinkURL(java.lang.String url)
url
- The url.getAttributionLinkURL()
public void setPermissionReferenceURL(java.lang.String url)
url
- The url.getPermissionReferenceURL()
public void setTermsOfUseText(java.lang.String text)
text
- The textgetTermsOfUseText()
public void setTermsOfUseURL(java.lang.String text)
text
- The url.getTermsOfUseURL()
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 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 static java.util.Collection<java.lang.String> getActiveIds()
public 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 getDate()
public void setDate(java.lang.String date)
date
- The date informationpublic 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)
serverProjections
- The list of supported projectionspublic 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 ImageryInfo.ImageryCategory getImageryCategory()
public void setImageryCategory(ImageryInfo.ImageryCategory category)
category
- The imagery categorypublic java.lang.String getImageryCategoryOriginalString()
public void setImageryCategoryOriginalString(java.lang.String categoryOriginalString)
categoryOriginalString
- The imagery category original stringpublic 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 isGeoreferenceValid()
true
if it is valid.public void setGeoreferenceValid(boolean isGeoreferenceValid)
isGeoreferenceValid
- true
if it is marked as valid.public boolean isBestMarked()
true
if it is marked as best.public boolean isOverlay()
true
if it is an overlay.public void setBestMarked(boolean bestMarked)
bestMarked
- true
if it is marked as best in other editors.public void setOverlay(boolean overlay)
overlay
- true
if it is an overlay.public void addOldId(java.lang.String id)
id
- the Id to be addedpublic java.util.Collection<java.lang.String> getOldIds()
public void addMirror(ImageryInfo entry)
entry
- the mirror to be addedpublic java.util.List<ImageryInfo> getMirrors()
public java.util.List<DefaultLayer> getDefaultLayers()
public void setDefaultLayers(java.util.List<DefaultLayer> layers)
layers
- set the list of default layerspublic java.util.Map<java.lang.String,java.lang.String> getCustomHttpHeaders()
public void setCustomHttpHeaders(java.util.Map<java.lang.String,java.lang.String> customHttpHeaders)
customHttpHeaders
- http headerspublic boolean isTransparent()
public void setTransparent(boolean transparent)
transparent
- set to true if imagery should be transparentpublic int getMinimumTileExpire()
public void setMinimumTileExpire(int minimumTileExpire)
minimumTileExpire
- minimum tile expiration in secondspublic java.lang.String getSourceName()
source
changeset tag.