public class ImageryInfo extends java.lang.Object 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 |
private java.lang.String |
attributionImageURL |
private java.lang.String |
attributionLinkURL |
private java.lang.String |
attributionText |
private ImageryInfo.ImageryBounds |
bounds |
private java.lang.String |
cookies |
private java.lang.String |
countryCode |
private boolean |
defaultEntry |
private int |
defaultMaxZoom |
private int |
defaultMinZoom |
private java.lang.String |
eulaAcceptanceRequired |
private java.lang.String |
icon |
private java.lang.String |
id
id for this imagery entry, optional at the moment
|
private ImageryInfo.ImageryType |
imageryType |
private java.lang.String |
name
name of the imagery entry (gets translated by josm usually)
|
private java.lang.String |
origName
original name of the imagery entry in case of translation call
|
private double |
pixelPerDegree |
private java.util.List<java.lang.String> |
serverProjections |
private java.lang.String |
termsOfUseText |
private java.lang.String |
termsOfUseURL |
private java.lang.String |
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. |
Modifier and Type | Method and Description |
---|---|
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,
Coordinate topLeft,
Coordinate botRight) |
ImageryInfo.ImageryBounds |
getBounds()
Returns the imagery polygonial bounds.
|
java.lang.String |
getCookies() |
java.lang.String |
getCountryCode()
Returns the ISO 3166-1-alpha-2 country code.
|
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.
|
java.lang.String |
getId()
Gets the entry id.
|
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.lang.String |
getName()
Returns the entry name.
|
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 |
getUrl()
Returns the entry URL.
|
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 |
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 |
setEulaAcceptanceRequired(java.lang.String eulaAcceptanceRequired)
Sets the EULA acceptance URL.
|
void |
setExtendedUrl(java.lang.String url)
Sets the extended URL of this entry.
|
void |
setIcon(java.lang.String icon)
Sets the entry icon.
|
void |
setId(java.lang.String id)
Sets the entry id.
|
void |
setImageryType(ImageryInfo.ImageryType imageryType)
Sets the imagery type.
|
void |
setName(java.lang.String name)
Sets the entry name.
|
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) |
void |
setTranslatedName(java.lang.String name)
Sets the entry name and translates it.
|
void |
setUrl(java.lang.String url)
Sets the entry URL.
|
java.lang.String |
toString() |
private java.lang.String name
private java.lang.String origName
private java.lang.String id
private java.lang.String url
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 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.lang.String icon
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 URLjava.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 boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equalsPref(ImageryInfo other)
pixelPerDegree
is ignored.other
- the ImageryInfo object to compare topublic int hashCode()
hashCode
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, Coordinate topLeft, Coordinate 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 getName()
public java.lang.String getOriginalName()
public void setName(java.lang.String name)
name
- The entry namepublic void setTranslatedName(java.lang.String name)
name
- The entry namepublic java.lang.String getId()
ImageryLayerInfo.getUniqueId(org.openstreetmap.josm.data.imagery.ImageryInfo)
to ensure
a unique value.public void setId(java.lang.String id)
id
- the entry idpublic void clearId()
public java.lang.String getUrl()
public void setUrl(java.lang.String url)
url
- The entry URLpublic 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()
public double getPixelPerDegree()
public int getMaxZoom()
public int getMinZoom()
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
otherwise