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:
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 ClassesModifier and TypeClassDescriptionstatic classMulti-polygon bounds for imagery backgrounds.static enumCategory of imagery entry.static classThe ImageryPreferenceEntry class for storing data in JOSM preferences.static enumType of imagery entry. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanmarked as best in other editorsprivate intmaximum zoom level for TMS imageryprivate intminimum zoom level for TMS imageryprivate static final String[]private booleanis the geo reference correct - don't offer offset handlingprivate intprotected List<ImageryInfo>mirrors of different type for this entryprivate booleanmarked as overlayprivate doubleprojections supported by WMS serversprivate booleanShould this map be transparentFields 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, termsOfUseURLFields inherited from class org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo
cookies, id, maxZoom, metadataHeaders, minZoom, modTileFeatures, name, noTileChecksums, noTileHeaders, tileSize, url -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new WMSImageryInfo.ImageryInfo(String name) Constructs a new WMSImageryInfowith a given name.ImageryInfo(String name, String url) Constructs a new WMSImageryInfowith given name and extended URL.ImageryInfo(String name, String url, String eulaAcceptanceRequired) Constructs a new WMSImageryInfowith given name, extended and EULA URLs.Constructs a newImageryInfowith given name, url, extended and EULA URLs.ImageryInfo(String name, String url, String type, String eulaAcceptanceRequired, String cookies, String id) Constructs a newImageryInfowith given name, url, id, extended and EULA URLs.Constructs a newImageryInfofrom an existing one.Constructs a newImageryInfofrom an imagery preference entry. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMirror(ImageryInfo entry) Adds a mirror entry.private static booleanaddNewLineInTooltip(StringBuilder res, String line, boolean htmlSupported) intcompareTo(SourceInfo<ImageryInfo.ImageryCategory, ImageryInfo.ImageryType, ImageryInfo.ImageryBounds, ImageryInfo.ImageryPreferenceEntry> other) booleanequalsPref(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 Collection<String>Return the sorted list of activated source IDs.Returns the source polygonal bounds.Returns the extended URL, containing in addition of service URL, its type and min/max zoom info.Returns the imagery category.Returns the imagery category original string (don't use except for error checks).Returns the imagery type.intReturns the maximum zoom level.Gets the name that should be displayed in the menu to add this imagery layer.intReturns minimum tile expiration in seconds.intReturns the minimum zoom level.Returns the mirror entries.String[]Get the missing fields for this infodoubleGets the pixel per degree valueGet the projections supported by the server.Get a string representation of this imagery info suitable for thesourcechangeset tag.Gets a unique toolbar key to store this layer as toolbar itemReturns a tool tip text for display.booleanReturns the status of "best" marked status in other editors.booleanGets the flag if the georeference is valid.booleanReturns the overlay indication.booleanDetermines if this imagery should be transparent.booleanisValid()Check to see if this info is valid (the XSD is overly permissive due to limitations of the XSD syntax).voidsetBestMarked(boolean bestMarked) Sets an indicator that in other editors it is marked as best imageryvoidSets the source polygonal bounds.voidsetDefaultMaxZoom(int defaultMaxZoom) Sets the maximum zoom level.voidsetDefaultMinZoom(int defaultMinZoom) Sets the minimum zoom level.voidsetExtendedUrl(String url) Sets the extended URL of this entry.voidsetGeoreferenceValid(boolean isGeoreferenceValid) Sets an indicator that the georeference is validvoidSets the imagery category.voidsetImageryCategoryOriginalString(String categoryOriginalString) Sets the imagery category original string (don't use except for error checks).voidsetImageryType(ImageryInfo.ImageryType imageryType) Sets the imagery type.voidsetMinimumTileExpire(int minimumTileExpire) Sets minimum tile expiration in seconds.voidsetOverlay(boolean overlay) Sets overlay indicationvoidsetPixelPerDegree(double ppd) Sets the pixel per degree value.voidsetServerProjections(Collection<String> serverProjections) Sets the list of collections the server supportsvoidsetTransparent(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, toStringMethods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo
getCookies, getId, getMetadataHeaders, getName, getTileSize, getUrl, isModTileFeatures, setCookies, setId, setModTileFeatures, setName, setTileSize, setUrl
-
Field Details
-
EMPTY_STRING
-
pixelPerDegree
-
defaultMaxZoom
maximum zoom level for TMS imagery -
defaultMinZoom
minimum zoom level for TMS imagery -
serverProjections
projections supported by WMS servers -
bestMarked
marked as best in other editors- Since:
- 11575
-
overlay
marked as overlay- Since:
- 13536
-
mirrors
mirrors of different type for this entry -
isGeoreferenceValid
is the geo reference correct - don't offer offset handling -
transparent
Should this map be transparent -
minimumTileExpire
-
-
Constructor Details
-
ImageryInfo
public ImageryInfo()Constructs a new WMSImageryInfo. -
ImageryInfo
Constructs a new WMSImageryInfowith a given name.- Parameters:
name- The entry name
-
ImageryInfo
Constructs a new WMSImageryInfowith given name and extended URL.- Parameters:
name- The entry nameurl- The entry extended URL
-
ImageryInfo
Constructs a new WMSImageryInfowith given name, extended and EULA URLs.- Parameters:
name- The entry nameurl- The entry URLeulaAcceptanceRequired- The EULA URL
-
ImageryInfo
public ImageryInfo(String name, String url, String type, String eulaAcceptanceRequired, String cookies) Constructs a newImageryInfowith 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:
IllegalArgumentException- if type refers to an unknown imagery type
-
ImageryInfo
public ImageryInfo(String name, String url, String type, String eulaAcceptanceRequired, String cookies, String id) Constructs a newImageryInfowith 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:
IllegalArgumentException- if type refers to an unknown imagery type
-
ImageryInfo
Constructs a newImageryInfofrom an imagery preference entry.- Parameters:
e- The imagery preference entry
-
ImageryInfo
Constructs a newImageryInfofrom an existing one.- Parameters:
i- The other imagery info
-
-
Method Details
-
addMirror
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
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
pixelPerDegreeis ignored.- Overrides:
equalsPrefin 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:
compareToin interfaceComparable<SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType, ImageryInfo.ImageryBounds, ImageryInfo.ImageryPreferenceEntry>> - Overrides:
compareToin classSourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType, ImageryInfo.ImageryBounds, ImageryInfo.ImageryPreferenceEntry>
-
setPixelPerDegree
Sets the pixel per degree value.- Parameters:
ppd- The ppd value- See Also:
-
setDefaultMaxZoom
Sets the maximum zoom level.- Parameters:
defaultMaxZoom- The maximum zoom level
-
setDefaultMinZoom
Sets the minimum zoom level.- Parameters:
defaultMinZoom- The minimum zoom level
-
setBounds
Description copied from class:SourceInfoSets the source polygonal bounds.- Overrides:
setBoundsin classSourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType, ImageryInfo.ImageryBounds, ImageryInfo.ImageryPreferenceEntry> - Parameters:
b- The source bounds (non-rectangular)
-
getBounds
Description copied from class:SourceInfoReturns the source polygonal bounds.- Overrides:
getBoundsin classSourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType, ImageryInfo.ImageryBounds, ImageryInfo.ImageryPreferenceEntry> - Returns:
- The source bounds (non-rectangular)
-
setExtendedUrl
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
Gets the pixel per degree value- Returns:
- The ppd value.
-
getMaxZoom
Returns the maximum zoom level.- Overrides:
getMaxZoomin classorg.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo- Returns:
- The maximum zoom level
-
getMinZoom
Returns the minimum zoom level.- Overrides:
getMinZoomin classorg.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo- Returns:
- The minimum zoom level
-
getToolTipText
Returns a tool tip text for display.- Overrides:
getToolTipTextin classSourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType, ImageryInfo.ImageryBounds, ImageryInfo.ImageryPreferenceEntry> - Returns:
- The text
- Since:
- 8065
-
addNewLineInTooltip
-
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
Sets the list of collections the server supports- Parameters:
serverProjections- The list of supported projections
-
getExtendedUrl
Returns the extended URL, containing in addition of service URL, its type and min/max zoom info.- Returns:
- The extended URL
-
getToolbarName
Gets a unique toolbar key to store this layer as toolbar item- Returns:
- The key.
-
getMenuName
Gets the name that should be displayed in the menu to add this imagery layer.- Returns:
- The text.
-
getImageryType
Returns the imagery type.- Returns:
- The imagery type
- See Also:
-
setImageryType
Sets the imagery type.- Parameters:
imageryType- The imagery type- See Also:
-
getImageryCategory
Returns the imagery category.- Returns:
- The imagery category
- Since:
- 13792
- See Also:
-
setImageryCategory
Sets the imagery category.- Parameters:
category- The imagery category- Since:
- 13792
- See Also:
-
getImageryCategoryOriginalString
Returns the imagery category original string (don't use except for error checks).- Returns:
- The imagery category original string
- Since:
- 13792
- See Also:
-
setImageryCategoryOriginalString
Sets the imagery category original string (don't use except for error checks).- Parameters:
categoryOriginalString- The imagery category original string- Since:
- 13792
- See Also:
-
isGeoreferenceValid
Gets the flag if the georeference is valid.- Returns:
trueif it is valid.
-
setGeoreferenceValid
Sets an indicator that the georeference is valid- Parameters:
isGeoreferenceValid-trueif it is marked as valid.
-
isBestMarked
Returns the status of "best" marked status in other editors.- Returns:
trueif it is marked as best.- Since:
- 11575
-
isOverlay
Returns the overlay indication.- Returns:
trueif it is an overlay.- Since:
- 13536
-
setBestMarked
Sets an indicator that in other editors it is marked as best imagery- Parameters:
bestMarked-trueif it is marked as best in other editors.- Since:
- 11575
-
setOverlay
Sets overlay indication- Parameters:
overlay-trueif it is an overlay.- Since:
- 13536
-
isTransparent
Determines if this imagery should be transparent.- Returns:
- should this imagery be transparent
-
setTransparent
Sets whether imagery should be transparent.- Parameters:
transparent- set to true if imagery should be transparent
-
getMinimumTileExpire
Returns minimum tile expiration in seconds.- Returns:
- minimum tile expiration in seconds
-
setMinimumTileExpire
Sets minimum tile expiration in seconds.- Parameters:
minimumTileExpire- minimum tile expiration in seconds
-
getSourceName
Get a string representation of this imagery info suitable for thesourcechangeset tag.- Returns:
- English name, if known
- Since:
- 13890
-
isValid
Check to see if this info is valid (the XSD is overly permissive due to limitations of the XSD syntax).- Returns:
trueif this info is valid- Since:
- 18989
- See Also:
-
getMissingFields
Get the missing fields for this info- Returns:
- The missing fields, or an empty array
- Since:
- 18989
- See Also:
-
getActiveIds
Return the sorted list of activated source IDs.- Returns:
- sorted list of activated source IDs
- Since:
- 13536
-