001    package org.openstreetmap.gui.jmapviewer.interfaces;
002    
003    import java.awt.Image;
004    
005    import org.openstreetmap.gui.jmapviewer.Coordinate;
006    
007    //License: GPL.
008    
009    public interface Attributed {
010        /**
011         * @return True if the tile source requires attribution in text or image form.
012         */
013        boolean requiresAttribution();
014    
015        /**
016         * @param zoom The optional zoom level for the view.
017         * @param botRight The bottom right of the bounding box for attribution.
018         * @param topLeft The top left of the bounding box for attribution.
019         * @return Attribution text for the image source.
020         */
021        String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight);
022    
023        /**
024         * @return The URL to open when the user clicks the attribution text.
025         */
026        String getAttributionLinkURL();
027    
028        /**
029         * @return The URL for the attribution image. Null if no image should be displayed.
030         */
031        Image getAttributionImage();
032    
033        /**
034         * @return The URL to open when the user clicks the attribution image.
035         * When return value is null, the image is still displayed (provided getAttributionImage()
036         * returns a value other than null), but the image does not link to a website.
037         */
038        String getAttributionImageURL();
039    
040        /**
041         * @return The attribution "Terms of Use" text.
042         * In case it returns null, but getTermsOfUseURL() is not null, a default
043         * terms of use text is used.
044         */
045        String getTermsOfUseText();
046    
047        /**
048         * @return The URL to open when the user clicks the attribution "Terms of Use" text.
049         */
050        String getTermsOfUseURL();
051    }