Changeset 4506 in josm for trunk/src/org/openstreetmap/josm/data/imagery
- Timestamp:
- 2011-10-08T13:04:58+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r4492 r4506 2 2 package org.openstreetmap.josm.data.imagery; 3 3 4 import java.awt.Image; 4 5 import java.util.Arrays; 5 6 import java.util.ArrayList; … … 18 19 import org.openstreetmap.josm.tools.CheckParameterUtil; 19 20 import org.openstreetmap.josm.tools.ImageProvider; 21 import org.openstreetmap.gui.jmapviewer.Coordinate; 22 import org.openstreetmap.gui.jmapviewer.interfaces.Attributed; 20 23 import org.openstreetmap.gui.jmapviewer.tilesources.OsmTileSource.Mapnik; 21 import org.openstreetmap.gui.jmapviewer.tilesources. TMSTileSource;24 import org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource; 22 25 23 26 /** … … 26 29 * @author Frederik Ramm <frederik@remote.org> 27 30 */ 28 public class ImageryInfo implements Comparable<ImageryInfo> {31 public class ImageryInfo implements Comparable<ImageryInfo>, Attributed { 29 32 30 33 public enum ImageryType { … … 325 328 } 326 329 327 public String getAttributionText() { 330 @Override 331 public boolean requiresAttribution() { 332 return attributionText != null || attributionImage != null || termsOfUseText != null || termsOfUseURL != null; 333 } 334 335 @Override 336 public String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight) { 328 337 return attributionText; 338 } 339 340 @Override 341 public String getAttributionLinkURL() { 342 return attributionLinkURL; 343 } 344 345 @Override 346 public Image getAttributionImage() { 347 ImageIcon i = ImageProvider.getIfAvailable(attributionImage); 348 if (i != null) { 349 return i.getImage(); 350 } 351 return null; 352 } 353 354 @Override 355 public String getAttributionImageURL() { 356 return attributionImageURL; 357 } 358 359 @Override 360 public String getTermsOfUseText() { 361 return termsOfUseText; 362 } 363 364 @Override 365 public String getTermsOfUseURL() { 366 return termsOfUseURL; 329 367 } 330 368 … … 333 371 } 334 372 373 public void setAttributionImageURL(String text) { 374 attributionImageURL = text; 375 } 376 335 377 public void setAttributionImage(String text) { 336 378 attributionImage = text; 337 379 } 338 380 339 public void setAttributionImageURL(String text) {340 attributionImageURL = text;341 }342 343 public String getAttributionLinkURL() {344 return attributionLinkURL;345 }346 347 381 public void setAttributionLinkURL(String text) { 348 382 attributionLinkURL = text; … … 351 385 public void setTermsOfUseText(String text) { 352 386 termsOfUseText = text; 353 }354 355 public String getTermsOfUseURL() {356 return termsOfUseURL;357 387 } 358 388 … … 542 572 * Applies the attribution from this object to a TMSTileSource. 543 573 */ 544 public void setAttribution( TMSTileSource s) {574 public void setAttribution(AbstractTileSource s) { 545 575 if (attributionText != null) { 546 576 if (attributionText.equals("osm")) {
Note:
See TracChangeset
for help on using the changeset viewer.