Changeset 11868 in josm


Ignore:
Timestamp:
2017-04-09T16:12:33+02:00 (4 months ago)
Author:
bastiK
Message:

see #7427 - add javadoc for getNativeProjections() + move it one class up

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r11862 r11868  
    3030import java.util.ArrayList;
    3131import java.util.Arrays;
     32import java.util.Collection;
    3233import java.util.Collections;
    3334import java.util.Comparator;
     
    227228
    228229    /**
     230     * Get projections this imagery layer supports natively.
     231     *
     232     * For example projection of tiles that are downloaded from a server. Layer
     233     * may support even more projections (by reprojecting the tiles), but with a
     234     * certain loss in image quality and performance.
     235     * @return projections this imagery layer supports natively; null if
     236     * layer is projection agnostic.
     237     */
     238    public abstract Collection<String> getNativeProjections();
     239
     240    /**
    229241     * Creates and returns a new {@link TileSource} instance depending on {@link #info} specified in the constructor.
    230242     *
     
    349361        JPanel panel = (JPanel) super.getInfoComponent();
    350362        List<List<String>> content = new ArrayList<>();
     363        Collection<String> nativeProjections = getNativeProjections();
     364        if (nativeProjections != null) {
     365            content.add(Arrays.asList(tr("Native projections"), Utils.join(", ", getNativeProjections())));
     366        }
    351367        EastNorth offset = getDisplaySettings().getDisplacement();
    352368        if (offset.distanceSq(0, 0) > 1e-10) {
  • trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java

    r11863 r11868  
    1212import java.util.ArrayList;
    1313import java.util.Arrays;
    14 import java.util.Collection;
    1514import java.util.List;
    1615import java.util.Locale;
     
    151150    }
    152151
    153     public abstract Collection<String> getNativeProjections();
    154 
    155152    @Override
    156153    public Object getInfoComponent() {
     
    172169                content.add(Arrays.asList(tr("Description"), info.getDescription()));
    173170            }
    174             content.add(Arrays.asList(tr("Native projections"), Utils.join(", ", getNativeProjections())));
    175171            for (List<String> entry: content) {
    176172                panel.add(new JLabel(entry.get(0) + ':'), GBC.std());
Note: See TracChangeset for help on using the changeset viewer.