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 classImageryInfo.ImageryBoundsMulti-polygon bounds for imagery backgrounds.static classImageryInfo.ImageryCategoryCategory of imagery entry.static classImageryInfo.ImageryPreferenceEntryThe ImageryPreferenceEntry class for storing data in JOSM preferences.static classImageryInfo.ImageryTypeType of imagery entry.
-
Field Summary
Fields Modifier and Type Field Description private booleanbestMarkedmarked as best in other editorsprivate intdefaultMaxZoommaximum zoom level for TMS imageryprivate intdefaultMinZoomminimum zoom level for TMS imageryprivate static java.lang.String[]EMPTY_STRINGprivate booleanisGeoreferenceValidis the geo reference correct - don't offer offset handlingprivate intminimumTileExpireprotected java.util.List<ImageryInfo>mirrorsmirrors of different type for this entryprivate booleanoverlaymarked as overlayprivate doublepixelPerDegreeprivate java.util.List<java.lang.String>serverProjectionsprojections supported by WMS serversprivate booleantransparentShould 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 WMSImageryInfowith a given name.ImageryInfo(java.lang.String name, java.lang.String url)Constructs a new WMSImageryInfowith given name and extended URL.ImageryInfo(java.lang.String name, java.lang.String url, java.lang.String eulaAcceptanceRequired)Constructs a new WMSImageryInfowith 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 newImageryInfowith 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 newImageryInfowith given name, url, id, extended and EULA URLs.ImageryInfo(ImageryInfo i)Constructs a newImageryInfofrom an existing one.ImageryInfo(ImageryInfo.ImageryPreferenceEntry e)Constructs a newImageryInfofrom an imagery preference entry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMirror(ImageryInfo entry)Adds a mirror entry.private static booleanaddNewLineInTooltip(java.lang.StringBuilder res, java.lang.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 java.util.Collection<java.lang.String>getActiveIds()Return the sorted list of activated source IDs.ImageryInfo.ImageryBoundsgetBounds()Returns the source polygonal bounds.java.lang.StringgetExtendedUrl()Returns the extended URL, containing in addition of service URL, its type and min/max zoom info.ImageryInfo.ImageryCategorygetImageryCategory()Returns the imagery category.java.lang.StringgetImageryCategoryOriginalString()Returns the imagery category original string (don't use except for error checks).ImageryInfo.ImageryTypegetImageryType()Returns the imagery type.intgetMaxZoom()Returns the maximum zoom level.java.lang.StringgetMenuName()Gets the name that should be displayed in the menu to add this imagery layer.intgetMinimumTileExpire()Returns minimum tile expiration in seconds.intgetMinZoom()Returns the minimum zoom level.java.util.List<ImageryInfo>getMirrors()Returns the mirror entries.java.lang.String[]getMissingFields()Get the missing fields for this infodoublegetPixelPerDegree()Gets the pixel per degree valuejava.util.List<java.lang.String>getServerProjections()Get the projections supported by the server.java.lang.StringgetSourceName()Get a string representation of this imagery info suitable for thesourcechangeset tag.java.lang.StringgetToolbarName()Gets a unique toolbar key to store this layer as toolbar itemjava.lang.StringgetToolTipText()Returns a tool tip text for display.booleanisBestMarked()Returns the status of "best" marked status in other editors.booleanisGeoreferenceValid()Gets the flag if the georeference is valid.booleanisOverlay()Returns the overlay indication.booleanisTransparent()Determines 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 imageryvoidsetBounds(ImageryInfo.ImageryBounds b)Sets the source polygonal bounds.voidsetDefaultMaxZoom(int defaultMaxZoom)Sets the maximum zoom level.voidsetDefaultMinZoom(int defaultMinZoom)Sets the minimum zoom level.voidsetExtendedUrl(java.lang.String url)Sets the extended URL of this entry.voidsetGeoreferenceValid(boolean isGeoreferenceValid)Sets an indicator that the georeference is validvoidsetImageryCategory(ImageryInfo.ImageryCategory category)Sets the imagery category.voidsetImageryCategoryOriginalString(java.lang.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(java.util.Collection<java.lang.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, 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 WMSImageryInfowith a given name.- Parameters:
name- The entry name
-
ImageryInfo
public ImageryInfo(java.lang.String name, java.lang.String url)
Constructs a new WMSImageryInfowith 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 WMSImageryInfowith 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 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:
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 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:
java.lang.IllegalArgumentException- if type refers to an unknown imagery type
-
ImageryInfo
public ImageryInfo(ImageryInfo.ImageryPreferenceEntry e)
Constructs a newImageryInfofrom an imagery preference entry.- Parameters:
e- The imagery preference entry
-
ImageryInfo
public ImageryInfo(ImageryInfo i)
Constructs a newImageryInfofrom 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
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 interfacejava.lang.Comparable<SourceInfo<ImageryInfo.ImageryCategory,ImageryInfo.ImageryType,ImageryInfo.ImageryBounds,ImageryInfo.ImageryPreferenceEntry>>- Overrides:
compareToin 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:SourceInfoSets the source polygonal bounds.- Overrides:
setBoundsin 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:SourceInfoReturns the source polygonal bounds.- Overrides:
getBoundsin 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:
getMaxZoomin classorg.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo- Returns:
- The maximum zoom level
-
getMinZoom
public int getMinZoom()
Returns the minimum zoom level.- Overrides:
getMinZoomin 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:
getToolTipTextin 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:
trueif it is valid.
-
setGeoreferenceValid
public void setGeoreferenceValid(boolean isGeoreferenceValid)
Sets an indicator that the georeference is valid- Parameters:
isGeoreferenceValid-trueif it is marked as valid.
-
isBestMarked
public boolean isBestMarked()
Returns the status of "best" marked status in other editors.- Returns:
trueif it is marked as best.- Since:
- 11575
-
isOverlay
public boolean isOverlay()
Returns the overlay indication.- Returns:
trueif 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-trueif it is marked as best in other editors.- Since:
- 11575
-
setOverlay
public void setOverlay(boolean overlay)
Sets overlay indication- Parameters:
overlay-trueif 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 thesourcechangeset 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:
trueif 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
-
-