Changeset 9417 in josm


Ignore:
Timestamp:
2016-01-12T00:59:37+01:00 (9 years ago)
Author:
Don-vip
Message:

checkstyle + javadoc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r9411 r9417  
    2323import java.io.File;
    2424import java.io.IOException;
    25 import java.io.InputStream;
    26 import java.io.InputStreamReader;
    2725import java.net.MalformedURLException;
    2826import java.net.URL;
    29 import java.nio.charset.StandardCharsets;
    3027import java.util.ArrayList;
    3128import java.util.Arrays;
     
    452449    }
    453450
     451    /**
     452     * Determines whether the list of active sources has changed.
     453     * @return {@code true} if the list of active sources has changed, {@code false} otherwise
     454     */
    454455    public boolean hasActiveSourcesChanged() {
    455456        Collection<? extends SourceEntry> prev = getInitialSourcesList();
     
    468469    }
    469470
     471    /**
     472     * Returns the list of active sources.
     473     * @return the list of active sources
     474     */
    470475    public Collection<SourceEntry> getActiveSources() {
    471476        return activeSourcesModel.getSources();
     
    486491    }
    487492
     493    /**
     494     * Remove sources associated with given indexes from active list.
     495     * @param idxs indexes of sources to remove
     496     */
    488497    public void removeSources(Collection<Integer> idxs) {
    489498        activeSourcesModel.removeIdxs(idxs);
     
    696705
    697706    public static class ExtendedSourceEntry extends SourceEntry implements Comparable<ExtendedSourceEntry> {
     707        /** file name used for display */
    698708        public String simpleFileName;
     709        /** version used for display */
    699710        public String version;
     711        /** author name used for display */
    700712        public String author;
     713        /** webpage link used for display */
    701714        public String link;
     715        /** short description used for display */
    702716        public String description;
    703717        /** Style type: can only have one value: "xml". Used to filter out old XML styles. For MapCSS styles, the value is not set. */
    704718        public String styleType;
     719        /** minimum JOSM version required to enable this source entry */
    705720        public Integer minJosmVersion;
    706721
     722        /**
     723         * Constructs a new {@code ExtendedSourceEntry}.
     724         * @param simpleFileName file name used for display
     725         * @param url URL that {@link org.openstreetmap.josm.io.CachedFile} understands
     726         */
    707727        public ExtendedSourceEntry(String simpleFileName, String url) {
    708728            super(url, null, null, true);
     
    721741        }
    722742
     743        /**
     744         * Returns a tooltip containing available metadata.
     745         * @return a tooltip containing available metadata
     746         */
    723747        public String getTooltip() {
    724748            StringBuilder s = new StringBuilder();
     
    16301654        public abstract Collection<ExtendedSourceEntry> getDefault();
    16311655
     1656        /**
     1657         * Serializes the given source entry as a map.
     1658         * @param entry source entry to serialize
     1659         * @return map (key=value)
     1660         */
    16321661        public abstract Map<String, String> serialize(SourceEntry entry);
    16331662
     1663        /**
     1664         * Deserializes the given map as a source entry.
     1665         * @param entryStr map (key=value)
     1666         * @return source entry
     1667         */
    16341668        public abstract SourceEntry deserialize(Map<String, String> entryStr);
    16351669
     
    16541688        }
    16551689
     1690        /**
     1691         * Saves a list of sources to JOSM preferences.
     1692         * @param entries list of sources
     1693         * @return {@code true}, if something has changed (i.e. value is different than before)
     1694         */
    16561695        public boolean put(Collection<? extends SourceEntry> entries) {
    16571696            Collection<Map<String, String>> setting = new ArrayList<>(entries.size());
Note: See TracChangeset for help on using the changeset viewer.