Changeset 6785 in josm for trunk/src/org


Ignore:
Timestamp:
2014-01-30T13:05:14+01:00 (11 years ago)
Author:
stoecker
Message:

fix #9643 - remove unneeded wrapper class - patch by glebius

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java

    r6643 r6785  
    4646    public interface TileSourceProvider {
    4747        List<TileSource> getTileSources();
    48     }
    49 
    50     public static class RenamedSourceDecorator implements TileSource {
    51 
    52         private final TileSource source;
    53         private final String name;
    54 
    55         public RenamedSourceDecorator(TileSource source, String name) {
    56             this.source = source;
    57             this.name = name;
    58         }
    59 
    60         @Override public String getName() {
    61             return name;
    62         }
    63 
    64         @Override public int getMaxZoom() { return source.getMaxZoom(); }
    65 
    66         @Override public int getMinZoom() { return source.getMinZoom(); }
    67 
    68         @Override public int getTileSize() { return source.getTileSize(); }
    69 
    70         @Override public String getTileType() { return source.getTileType(); }
    71 
    72         @Override public TileUpdate getTileUpdate() { return source.getTileUpdate(); }
    73 
    74         @Override public String getTileUrl(int zoom, int tilex, int tiley) throws IOException { return source.getTileUrl(zoom, tilex, tiley); }
    75 
    76         @Override public boolean requiresAttribution() { return source.requiresAttribution(); }
    77 
    78         @Override public String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight) { return source.getAttributionText(zoom, topLeft, botRight); }
    79 
    80         @Override public String getAttributionLinkURL() { return source.getAttributionLinkURL(); }
    81 
    82         @Override public Image getAttributionImage() { return source.getAttributionImage(); }
    83 
    84         @Override public String getAttributionImageURL() { return source.getAttributionImageURL(); }
    85 
    86         @Override public String getTermsOfUseText() { return source.getTermsOfUseText(); }
    87 
    88         @Override public String getTermsOfUseURL() { return source.getTermsOfUseURL(); }
    89 
    90         @Override public double latToTileY(double lat, int zoom) { return source.latToTileY(lat,zoom); }
    91 
    92         @Override public double lonToTileX(double lon, int zoom) { return source.lonToTileX(lon,zoom); }
    93 
    94         @Override public double tileYToLat(int y, int zoom) { return source.tileYToLat(y, zoom); }
    95 
    96         @Override public double tileXToLon(int x, int zoom) { return source.tileXToLon(x, zoom); }
    9748    }
    9849
     
    154105            public List<TileSource> getTileSources() {
    155106                return Arrays.<TileSource>asList(
    156                         new RenamedSourceDecorator(new OsmTileSource.Mapnik(), "Mapnik"),
    157                         new RenamedSourceDecorator(new OsmTileSource.CycleMap(), "Cyclemap"),
    158                         new RenamedSourceDecorator(new MapQuestOsmTileSource(), "MapQuest-OSM"),
    159                         new RenamedSourceDecorator(new MapQuestOpenAerialTileSource(), "MapQuest Open Aerial")
    160                         );
     107                        new OsmTileSource.Mapnik(),
     108                        new OsmTileSource.CycleMap(),
     109                        new MapQuestOsmTileSource(),
     110                        new MapQuestOpenAerialTileSource());
    161111            }
    162112        });
Note: See TracChangeset for help on using the changeset viewer.