Class ImageryInfo
- java.lang.Object
-
- org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo
-
- org.openstreetmap.josm.data.sources.SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>
-
- org.openstreetmap.josm.data.imagery.ImageryInfo
-
- All Implemented Interfaces:
java.lang.Comparable<SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>>
,org.openstreetmap.gui.jmapviewer.interfaces.Attributed
public class ImageryInfo extends SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>
Class that stores info about an image background layer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImageryInfo.ImageryBounds
Multi-polygon bounds for imagery backgrounds.static class
ImageryInfo.ImageryCategory
Category of imagery entry.static class
ImageryInfo.ImageryPreferenceEntry
The ImageryPreferenceEntry class for storing data in JOSM preferences.static class
ImageryInfo.ImageryType
Type of imagery entry.
-
Field Summary
Fields Modifier and Type Field Description private boolean
bestMarked
marked as best in other editorsprivate int
defaultMaxZoom
maximum zoom level for TMS imageryprivate int
defaultMinZoom
minimum zoom level for TMS imageryprivate static java.lang.String[]
EMPTY_STRING
private boolean
isGeoreferenceValid
is the geo reference correct - don't offer offset handlingprivate int
minimumTileExpire
protected java.util.List<ImageryInfo>
mirrors
mirrors of different type for this entryprivate boolean
overlay
marked as overlayprivate double
pixelPerDegree
private java.util.List<java.lang.String>
serverProjections
projections supported by WMS serversprivate boolean
transparent
Should this map be transparent-
Fields inherited from class org.openstreetmap.josm.data.sources.SourceInfo
attributionImage, attributionImageURL, attributionLinkURL, attributionText, bounds, category, categoryOriginalString, countryCode, customHttpHeaders, date, defaultEntry, defaultLayers, description, eulaAcceptanceRequired, icon, langDescription, langName, oldIds, origName, permissionReferenceURL, privacyPolicyURL, sourceType, termsOfUseText, termsOfUseURL
-
-
Constructor Summary
Constructors Constructor Description ImageryInfo()
Constructs a new WMSImageryInfo
.ImageryInfo(java.lang.String name)
Constructs a new WMSImageryInfo
with a given name.ImageryInfo(java.lang.String name, java.lang.String url)
Constructs a new WMSImageryInfo
with given name and extended URL.ImageryInfo(java.lang.String name, java.lang.String url, java.lang.String eulaAcceptanceRequired)
Constructs a new WMSImageryInfo
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 newImageryInfo
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 newImageryInfo
with given name, url, id, extended and EULA URLs.ImageryInfo(ImageryInfo i)
Constructs a newImageryInfo
from an existing one.ImageryInfo(ImageryInfo.ImageryPreferenceEntry e)
Constructs a newImageryInfo
from an imagery preference entry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMirror(ImageryInfo entry)
Adds a mirror entry.private static boolean
addNewLineInTooltip(java.lang.StringBuilder res, java.lang.String line, boolean htmlSupported)
int
compareTo(SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry> other)
boolean
equalsPref(SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry> 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 source IDs.ImageryInfo.ImageryBounds
getBounds()
Returns the source polygonal bounds.java.lang.String
getExtendedUrl()
Returns the extended URL, containing in addition of service URL, its type and min/max zoom info.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.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.lang.String[]
getMissingFields()
Get the missing fields for this infodouble
getPixelPerDegree()
Gets the pixel per degree valuejava.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 thesource
changeset tag.java.lang.String
getToolbarName()
Gets a unique toolbar key to store this layer as toolbar itemjava.lang.String
getToolTipText()
Returns a tool tip text for display.boolean
isBestMarked()
Returns the status of "best" marked status in other editors.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
isValid()
Check to see if this info is valid (the XSD is overly permissive due to limitations of the XSD syntax).void
setBestMarked(boolean bestMarked)
Sets an indicator that in other editors it is marked as best imageryvoid
setBounds(ImageryInfo.ImageryBounds b)
Sets the source polygonal bounds.void
setDefaultMaxZoom(int defaultMaxZoom)
Sets the maximum zoom level.void
setDefaultMinZoom(int defaultMinZoom)
Sets the minimum zoom level.void
setExtendedUrl(java.lang.String url)
Sets the extended URL of this entry.void
setGeoreferenceValid(boolean isGeoreferenceValid)
Sets an indicator that the georeference is validvoid
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
setMinimumTileExpire(int minimumTileExpire)
Sets minimum tile expiration in seconds.void
setOverlay(boolean overlay)
Sets overlay indicationvoid
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 supportsvoid
setTransparent(boolean transparent)
Sets whether imagery should be transparent.-
Methods inherited from class org.openstreetmap.josm.data.sources.SourceInfo
addOldId, clearId, copyAttribution, equals, equalsBaseValues, getActiveIds, getAttributionImage, getAttributionImageRaw, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getCountryCode, getCustomHttpHeaders, getDate, getDefaultLayers, getDescription, getEulaAcceptanceRequired, getIcon, getLocalizedCountry, getNoTileChecksums, getNoTileHeaders, getOldIds, getOriginalName, getPermissionReferenceURL, getPrivacyPolicyURL, getSourceCategory, getSourceCategoryOriginalString, getSourceType, getTermsOfUseText, getTermsOfUseURL, hasAttribution, hashCode, isBlacklisted, isDefaultEntry, requiresAttribution, setAttribution, setAttributionImage, setAttributionImageURL, setAttributionLinkURL, setAttributionText, setCountryCode, setCustomHttpHeaders, setDate, setDefaultEntry, setDefaultLayers, setDescription, setEulaAcceptanceRequired, setIcon, setMetadataHeaders, setName, setNoTileChecksums, setNoTileHeaders, setPermissionReferenceURL, setPrivacyPolicyURL, setSourceCategory, setSourceCategoryOriginalString, setSourceType, setTermsOfUseText, setTermsOfUseURL, toString
-
-
-
-
Field Detail
-
EMPTY_STRING
private static final java.lang.String[] EMPTY_STRING
-
pixelPerDegree
private double pixelPerDegree
-
defaultMaxZoom
private int defaultMaxZoom
maximum zoom level for TMS imagery
-
defaultMinZoom
private int defaultMinZoom
minimum zoom level for TMS imagery
-
serverProjections
private java.util.List<java.lang.String> serverProjections
projections supported by WMS servers
-
bestMarked
private boolean bestMarked
marked as best in other editors- Since:
- 11575
-
overlay
private boolean overlay
marked as overlay- Since:
- 13536
-
mirrors
protected java.util.List<ImageryInfo> mirrors
mirrors of different type for this entry
-
isGeoreferenceValid
private boolean isGeoreferenceValid
is the geo reference correct - don't offer offset handling
-
transparent
private boolean transparent
Should this map be transparent
-
minimumTileExpire
private int minimumTileExpire
-
-
Constructor Detail
-
ImageryInfo
public ImageryInfo()
Constructs a new WMSImageryInfo
.
-
ImageryInfo
public ImageryInfo(java.lang.String name)
Constructs a new WMSImageryInfo
with a given name.- Parameters:
name
- The entry name
-
ImageryInfo
public ImageryInfo(java.lang.String name, java.lang.String url)
Constructs a new WMSImageryInfo
with given name and extended URL.- Parameters:
name
- The entry nameurl
- The entry extended URL
-
ImageryInfo
public ImageryInfo(java.lang.String name, java.lang.String url, java.lang.String eulaAcceptanceRequired)
Constructs a new WMSImageryInfo
with given name, extended and EULA URLs.- Parameters:
name
- The entry nameurl
- The entry URLeulaAcceptanceRequired
- The EULA URL
-
ImageryInfo
public ImageryInfo(java.lang.String name, java.lang.String url, java.lang.String type, java.lang.String eulaAcceptanceRequired, java.lang.String cookies)
Constructs a newImageryInfo
with given name, url, extended and EULA URLs.- Parameters:
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 work- Throws:
java.lang.IllegalArgumentException
- if type refers to an unknown imagery type
-
ImageryInfo
public 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 newImageryInfo
with given name, url, id, extended and EULA URLs.- Parameters:
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 id- Throws:
java.lang.IllegalArgumentException
- if type refers to an unknown imagery type
-
ImageryInfo
public ImageryInfo(ImageryInfo.ImageryPreferenceEntry e)
Constructs a newImageryInfo
from an imagery preference entry.- Parameters:
e
- The imagery preference entry
-
ImageryInfo
public ImageryInfo(ImageryInfo i)
Constructs a newImageryInfo
from an existing one.- Parameters:
i
- The other imagery info
-
-
Method Detail
-
addMirror
public void addMirror(ImageryInfo entry)
Adds a mirror entry. Mirror entries are completed with the data from the master entry and only describe another method to access identical data.- Parameters:
entry
- the mirror to be added- Since:
- 9658
-
getMirrors
public java.util.List<ImageryInfo> getMirrors()
Returns the mirror entries. Entries are completed with master entry data.- Returns:
- the list of mirrors
- Since:
- 9658
-
equalsPref
public boolean equalsPref(SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry> other)
Check if this object equals another ImageryInfo with respect to the properties that get written to the preference file.The field
pixelPerDegree
is ignored.- Overrides:
equalsPref
in classSourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>
- Parameters:
other
- the ImageryInfo object to compare to- Returns:
- true if they are equal
-
compareTo
public int compareTo(SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry> other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>>
- Overrides:
compareTo
in classSourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>
-
setPixelPerDegree
public void setPixelPerDegree(double ppd)
Sets the pixel per degree value.- Parameters:
ppd
- The ppd value- See Also:
getPixelPerDegree()
-
setDefaultMaxZoom
public void setDefaultMaxZoom(int defaultMaxZoom)
Sets the maximum zoom level.- Parameters:
defaultMaxZoom
- The maximum zoom level
-
setDefaultMinZoom
public void setDefaultMinZoom(int defaultMinZoom)
Sets the minimum zoom level.- Parameters:
defaultMinZoom
- The minimum zoom level
-
setBounds
public void setBounds(ImageryInfo.ImageryBounds b)
Description copied from class:SourceInfo
Sets the source polygonal bounds.- Overrides:
setBounds
in classSourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>
- Parameters:
b
- The source bounds (non-rectangular)
-
getBounds
public ImageryInfo.ImageryBounds getBounds()
Description copied from class:SourceInfo
Returns the source polygonal bounds.- Overrides:
getBounds
in classSourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>
- Returns:
- The source bounds (non-rectangular)
-
setExtendedUrl
public void setExtendedUrl(java.lang.String url)
Sets the extended URL of this entry.- Parameters:
url
- Entry extended URL containing in addition of service URL, its type and min/max zoom info
-
getPixelPerDegree
public double getPixelPerDegree()
Gets the pixel per degree value- Returns:
- The ppd value.
-
getMaxZoom
public int getMaxZoom()
Returns the maximum zoom level.- Overrides:
getMaxZoom
in classorg.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo
- Returns:
- The maximum zoom level
-
getMinZoom
public int getMinZoom()
Returns the minimum zoom level.- Overrides:
getMinZoom
in classorg.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo
- Returns:
- The minimum zoom level
-
getToolTipText
public java.lang.String getToolTipText()
Returns a tool tip text for display.- Overrides:
getToolTipText
in classSourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>
- Returns:
- The text
- Since:
- 8065
-
addNewLineInTooltip
private static boolean addNewLineInTooltip(java.lang.StringBuilder res, java.lang.String line, boolean htmlSupported)
-
getServerProjections
public java.util.List<java.lang.String> getServerProjections()
Get the projections supported by the server. Only relevant for WMS-type ImageryInfo at the moment.- Returns:
- null, if no projections have been specified; the list of supported projections otherwise.
-
setServerProjections
public void setServerProjections(java.util.Collection<java.lang.String> serverProjections)
Sets the list of collections the server supports- Parameters:
serverProjections
- The list of supported projections
-
getExtendedUrl
public java.lang.String getExtendedUrl()
Returns the extended URL, containing in addition of service URL, its type and min/max zoom info.- Returns:
- The extended URL
-
getToolbarName
public java.lang.String getToolbarName()
Gets a unique toolbar key to store this layer as toolbar item- Returns:
- The key.
-
getMenuName
public java.lang.String getMenuName()
Gets the name that should be displayed in the menu to add this imagery layer.- Returns:
- The text.
-
getImageryType
public ImageryInfo.ImageryType getImageryType()
Returns the imagery type.- Returns:
- The imagery type
- See Also:
SourceInfo.getSourceType()
-
setImageryType
public void setImageryType(ImageryInfo.ImageryType imageryType)
Sets the imagery type.- Parameters:
imageryType
- The imagery type- See Also:
SourceInfo.setSourceType(U)
-
getImageryCategory
public ImageryInfo.ImageryCategory getImageryCategory()
Returns the imagery category.- Returns:
- The imagery category
- Since:
- 13792
- See Also:
SourceInfo.getSourceCategory()
-
setImageryCategory
public void setImageryCategory(ImageryInfo.ImageryCategory category)
Sets the imagery category.- Parameters:
category
- The imagery category- Since:
- 13792
- See Also:
SourceInfo.setSourceCategory(T)
-
getImageryCategoryOriginalString
public java.lang.String getImageryCategoryOriginalString()
Returns the imagery category original string (don't use except for error checks).- Returns:
- The imagery category original string
- Since:
- 13792
- See Also:
SourceInfo.getSourceCategoryOriginalString()
-
setImageryCategoryOriginalString
public void setImageryCategoryOriginalString(java.lang.String categoryOriginalString)
Sets the imagery category original string (don't use except for error checks).- Parameters:
categoryOriginalString
- The imagery category original string- Since:
- 13792
- See Also:
SourceInfo.setSourceCategoryOriginalString(java.lang.String)
-
isGeoreferenceValid
public boolean isGeoreferenceValid()
Gets the flag if the georeference is valid.- Returns:
true
if it is valid.
-
setGeoreferenceValid
public void setGeoreferenceValid(boolean isGeoreferenceValid)
Sets an indicator that the georeference is valid- Parameters:
isGeoreferenceValid
-true
if it is marked as valid.
-
isBestMarked
public boolean isBestMarked()
Returns the status of "best" marked status in other editors.- Returns:
true
if it is marked as best.- Since:
- 11575
-
isOverlay
public boolean isOverlay()
Returns the overlay indication.- Returns:
true
if it is an overlay.- Since:
- 13536
-
setBestMarked
public void setBestMarked(boolean bestMarked)
Sets an indicator that in other editors it is marked as best imagery- Parameters:
bestMarked
-true
if it is marked as best in other editors.- Since:
- 11575
-
setOverlay
public void setOverlay(boolean overlay)
Sets overlay indication- Parameters:
overlay
-true
if it is an overlay.- Since:
- 13536
-
isTransparent
public boolean isTransparent()
Determines if this imagery should be transparent.- Returns:
- should this imagery be transparent
-
setTransparent
public void setTransparent(boolean transparent)
Sets whether imagery should be transparent.- Parameters:
transparent
- set to true if imagery should be transparent
-
getMinimumTileExpire
public int getMinimumTileExpire()
Returns minimum tile expiration in seconds.- Returns:
- minimum tile expiration in seconds
-
setMinimumTileExpire
public void setMinimumTileExpire(int minimumTileExpire)
Sets minimum tile expiration in seconds.- Parameters:
minimumTileExpire
- minimum tile expiration in seconds
-
getSourceName
public java.lang.String getSourceName()
Get a string representation of this imagery info suitable for thesource
changeset tag.- Returns:
- English name, if known
- Since:
- 13890
-
isValid
public boolean isValid()
Check to see if this info is valid (the XSD is overly permissive due to limitations of the XSD syntax).- Returns:
true
if this info is valid- Since:
- 18989
- See Also:
getMissingFields()
-
getMissingFields
public java.lang.String[] getMissingFields()
Get the missing fields for this info- Returns:
- The missing fields, or an empty array
- Since:
- 18989
- See Also:
isValid()
-
getActiveIds
public static java.util.Collection<java.lang.String> getActiveIds()
Return the sorted list of activated source IDs.- Returns:
- sorted list of activated source IDs
- Since:
- 13536
-
-