org.openstreetmap.gui.jmapviewer.tilesources
Class AbstractTileSource

java.lang.Object
  extended by org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource
All Implemented Interfaces:
Attributed, TileSource
Direct Known Subclasses:
AbstractTMSTileSource

public abstract class AbstractTileSource
extends java.lang.Object
implements TileSource


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
TileSource.TileUpdate
 
Field Summary
protected  java.awt.Image attributionImage
           
protected  java.lang.String attributionImageURL
           
protected  java.lang.String attributionLinkURL
           
protected  java.lang.String attributionText
           
protected  java.lang.String termsOfUseText
           
protected  java.lang.String termsOfUseURL
           
 
Constructor Summary
AbstractTileSource()
           
 
Method Summary
 java.awt.Image getAttributionImage()
           
 java.lang.String getAttributionImageURL()
           
 java.lang.String getAttributionLinkURL()
           
 java.lang.String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight)
           
 java.lang.String getTermsOfUseText()
           
 java.lang.String getTermsOfUseURL()
           
 boolean requiresAttribution()
           
 void setAttributionImage(java.awt.Image attributionImage)
           
 void setAttributionImageURL(java.lang.String attributionImageURL)
           
 void setAttributionLinkURL(java.lang.String attributionLinkURL)
           
 void setAttributionText(java.lang.String attributionText)
           
 void setTermsOfUseText(java.lang.String termsOfUseText)
           
 void setTermsOfUseURL(java.lang.String termsOfUseURL)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
getMaxZoom, getMinZoom, getName, getTileSize, getTileType, getTileUpdate, getTileUrl, latToTileY, lonToTileX, tileXToLon, tileYToLat
 

Field Detail

attributionText

protected java.lang.String attributionText

attributionLinkURL

protected java.lang.String attributionLinkURL

attributionImage

protected java.awt.Image attributionImage

attributionImageURL

protected java.lang.String attributionImageURL

termsOfUseText

protected java.lang.String termsOfUseText

termsOfUseURL

protected java.lang.String termsOfUseURL
Constructor Detail

AbstractTileSource

public AbstractTileSource()
Method Detail

requiresAttribution

public boolean requiresAttribution()
Specified by:
requiresAttribution in interface Attributed
Returns:
True if the tile source requires attribution in text or image form.

getAttributionText

public java.lang.String getAttributionText(int zoom,
                                           Coordinate topLeft,
                                           Coordinate botRight)
Specified by:
getAttributionText in interface Attributed
Parameters:
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.
Returns:
Attribution text for the image source.

getAttributionLinkURL

public java.lang.String getAttributionLinkURL()
Specified by:
getAttributionLinkURL in interface Attributed
Returns:
The URL to open when the user clicks the attribution text.

getAttributionImage

public java.awt.Image getAttributionImage()
Specified by:
getAttributionImage in interface Attributed
Returns:
The URL for the attribution image. Null if no image should be displayed.

getAttributionImageURL

public java.lang.String getAttributionImageURL()
Specified by:
getAttributionImageURL in interface Attributed
Returns:
The URL to open when the user clicks the attribution image. When return value is null, the image is still displayed (provided getAttributionImage() returns a value other than null), but the image does not link to a website.

getTermsOfUseText

public java.lang.String getTermsOfUseText()
Specified by:
getTermsOfUseText in interface Attributed
Returns:
The attribution "Terms of Use" text. In case it returns null, but getTermsOfUseURL() is not null, a default terms of use text is used.

getTermsOfUseURL

public java.lang.String getTermsOfUseURL()
Specified by:
getTermsOfUseURL in interface Attributed
Returns:
The URL to open when the user clicks the attribution "Terms of Use" text.

setAttributionText

public void setAttributionText(java.lang.String attributionText)

setAttributionLinkURL

public void setAttributionLinkURL(java.lang.String attributionLinkURL)

setAttributionImage

public void setAttributionImage(java.awt.Image attributionImage)

setAttributionImageURL

public void setAttributionImageURL(java.lang.String attributionImageURL)

setTermsOfUseText

public void setTermsOfUseText(java.lang.String termsOfUseText)

setTermsOfUseURL

public void setTermsOfUseURL(java.lang.String termsOfUseURL)


JOSM