Changeset 11575 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2017-02-18T12:34:15+01:00 (8 years ago)
Author:
stoecker
Message:

see #12313 - add best marking and show it in image preferences

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r11572 r11575  
    194194      */
    195195    private String date;
     196    /**
     197      * marked as best in other editors
     198      * @since 11575
     199      */
     200    private boolean bestMarked = false;
    196201    /** mirrors of different type for this entry */
    197202    private List<ImageryInfo> mirrors;
    198203    /** icon used in menu */
    199204    private String icon;
     205    /** is the geo reference correct - don't offer offset handling */
    200206    private boolean isGeoreferenceValid;
     207    /** does the EPSG:4326 to mercator woraround work as expected */
    201208    private boolean isEpsg4326To3857Supported;
    202209    /** which layers should be activated by default on layer addition. **/
     
    237244        @pref Map<String, String> metadataHeaders;
    238245        @pref boolean valid_georeference;
     246        @pref boolean bestMarked;
    239247        @pref boolean supports_epsg_4326_to_3857_conversion;
    240248        // TODO: disabled until change of layers is implemented
     
    262270            attribution_url = i.attributionLinkURL;
    263271            date = i.date;
     272            bestMarked = i.bestMarked;
    264273            logo_image = i.attributionImage;
    265274            logo_url = i.attributionImageURL;
     
    418427        attributionImageURL = e.logo_url;
    419428        date = e.date;
     429        bestMarked = e.bestMarked;
    420430        termsOfUseText = e.terms_of_use_text;
    421431        termsOfUseURL = e.terms_of_use_url;
     
    444454        this.origName = i.origName;
    445455        this.langName = i.langName;
     456        this.bestMarked = i.bestMarked;
    446457        this.defaultEntry = i.defaultEntry;
    447458        this.cookies = i.cookies;
     
    494505                Objects.equals(this.id, other.id) &&
    495506                Objects.equals(this.url, other.url) &&
     507                Objects.equals(this.bestMarked, other.bestMarked) &&
     508                Objects.equals(this.isEpsg4326To3857Supported, other.isEpsg4326To3857Supported) &&
     509                Objects.equals(this.isGeoreferenceValid, other.isGeoreferenceValid) &&
    496510                Objects.equals(this.cookies, other.cookies) &&
    497511                Objects.equals(this.eulaAcceptanceRequired, other.eulaAcceptanceRequired) &&
     
    852866            html = true;
    853867        }
     868        if (bestMarked) {
     869            res += "<br>" + tr("This imagery is marked as best in this region in other editors.");
     870        }
    854871        String desc = getDescription();
    855872        if (desc != null && !desc.isEmpty()) {
     
    11541171    public void setGeoreferenceValid(boolean isGeoreferenceValid) {
    11551172        this.isGeoreferenceValid = isGeoreferenceValid;
     1173    }
     1174
     1175    /**
     1176     * Returns the status of "best" marked status in other editors.
     1177     * @return <code>true</code> if it is marked as best.
     1178     * @since 11575
     1179     */
     1180    public boolean isBestMarked() {
     1181        return bestMarked;
     1182    }
     1183
     1184    /**
     1185     * Sets an indicator that in other editors it is marked as best imagery
     1186     * @param bestMarked <code>true</code> if it is marked as best in other editors.
     1187     * @since 11575
     1188     */
     1189    public void setBestMarked(boolean bestMarked) {
     1190        this.bestMarked = bestMarked;
    11561191    }
    11571192
  • trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java

    r11570 r11575  
    154154                    noTileChecksums = new MultiMap<>();
    155155                    metadataHeaders = new HashMap<>();
     156                    String best = atts.getValue("eli-best");
     157                    if ("true".equals(best)) {
     158                        entry.setBestMarked(true);
     159                    }
    156160                }
    157161                break;
Note: See TracChangeset for help on using the changeset viewer.