Ignore:
Timestamp:
2015-02-14T22:32:42+01:00 (9 years ago)
Author:
stoecker
Message:

display imagery description in preferences dialog tooltip

File:
1 edited

Legend:

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

    r7759 r8065  
    166166    private ImageryBounds bounds = null;
    167167    private List<String> serverProjections;
     168    private String description;
    168169    private String attributionText;
    169170    private String attributionLinkURL;
     
    200201        @pref String projections;
    201202        @pref String icon;
     203        @pref String description;
    202204
    203205        /**
     
    229231            cookies = i.cookies;
    230232            icon = i.icon;
     233            description = i.description;
    231234            if (i.bounds != null) {
    232235                bounds = i.bounds.encodeAsString(",");
     
    332335        id = e.id;
    333336        url = e.url;
     337        description = e.description;
    334338        cookies = e.cookies;
    335339        eulaAcceptanceRequired = e.eula;
     
    389393        this.countryCode = i.countryCode;
    390394        this.icon = i.icon;
     395        this.description = i.description;
    391396    }
    392397
     
    472477            return false;
    473478        }
     479        if (!Objects.equals(this.description, other.description)) {
     480            return false;
     481        }
    474482        return true;
    475483    }
    476 
    477484
    478485    @Override
     
    774781
    775782    /**
     783     * Returns the description text when existing.
     784     * @return The description
     785     * @since 8064
     786     */
     787    public String getDescription() {
     788        return this.description;
     789    }
     790
     791    /**
     792     * Sets the description text when existing.
     793     * @param description the imagery description text
     794     * @since 8064
     795     */
     796    public void setDescription(String description) {
     797        this.description = description;
     798    }
     799
     800    /**
     801     * Returns a tool tip text for display.
     802     * @return The text
     803     * @since 8064
     804     */
     805    public String getToolTipText() {
     806        String desc = getDescription();
     807        if (desc != null && !desc.isEmpty()) {
     808            return "<html>" + getName() + "<br>" + desc + "</html>";
     809        }
     810        return getName();
     811    }
     812
     813    /**
    776814     * Returns the EULA acceptance URL, if any.
    777815     * @return The URL to an EULA text that has to be accepted before use, or {@code null}
Note: See TracChangeset for help on using the changeset viewer.