Changeset 15007 in josm


Ignore:
Timestamp:
2019-04-21T02:49:30+02:00 (7 months ago)
Author:
Don-vip
Message:

remove deprecated API

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r14985 r15007  
    1010import java.awt.geom.Area;
    1111import java.util.ArrayList;
    12 import java.util.Arrays;
    1312import java.util.Collection;
    14 import java.util.Collections;
    1513import java.util.HashSet;
    1614import java.util.List;
     
    111109
    112110    /**
    113      * A list of things we can zoom to. The zoom target is given depending on the mode.
    114      * @deprecated Use {@link AutoScaleMode} enum instead
    115      */
    116     @Deprecated
    117     public static final Collection<String> MODES = Collections.unmodifiableList(Arrays.asList(
    118         marktr(/* ICON(dialogs/autoscale/) */ "data"),
    119         marktr(/* ICON(dialogs/autoscale/) */ "layer"),
    120         marktr(/* ICON(dialogs/autoscale/) */ "selection"),
    121         marktr(/* ICON(dialogs/autoscale/) */ "conflict"),
    122         marktr(/* ICON(dialogs/autoscale/) */ "download"),
    123         marktr(/* ICON(dialogs/autoscale/) */ "problem"),
    124         marktr(/* ICON(dialogs/autoscale/) */ "previous"),
    125         marktr(/* ICON(dialogs/autoscale/) */ "next")));
    126 
    127     /**
    128111     * One of {@link AutoScaleMode}. Defines what we are zooming to.
    129112     */
     
    171154    /**
    172155     * Performs the auto scale operation of the given mode without the need to create a new action.
    173      * @param mode One of {@link #MODES}.
     156     * @param mode One of {@link AutoScaleMode}.
    174157     * @since 14221
    175158     */
    176159    public static void autoScale(AutoScaleMode mode) {
    177160        new AutoScaleAction(mode, false).autoScale();
    178     }
    179 
    180     /**
    181      * Performs the auto scale operation of the given mode without the need to create a new action.
    182      * @param mode One of {@link #MODES}.
    183      * @deprecated Use {@link #autoScale(AutoScaleMode)} instead
    184      */
    185     @Deprecated
    186     public static void autoScale(String mode) {
    187         autoScale(AutoScaleMode.of(mode));
    188161    }
    189162
     
    221194    /**
    222195     * Constructs a new {@code AutoScaleAction}.
    223      * @param mode The autoscale mode (one of {@link AutoScaleAction#MODES})
    224      * @deprecated Use {@link #AutoScaleAction(AutoScaleMode)} instead
    225      */
    226     @Deprecated
    227     public AutoScaleAction(final String mode) {
    228         this(AutoScaleMode.of(mode));
    229     }
    230 
    231     /**
    232      * Constructs a new {@code AutoScaleAction}.
    233      * @param mode The autoscale mode (one of {@link AutoScaleAction#MODES})
     196     * @param mode The autoscale mode (one of {@link AutoScaleMode})
    234197     * @since 14221
    235198     */
  • trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java

    r14483 r15007  
    178178
    179179    /**
    180      * Convert the time stamp of the waypoint into seconds from the epoch.
    181      *
    182      * @deprecated Use {@link #setTime(Date)}, {@link #setTime(long)}, {@link #setTimeInMillis(long)}
    183      */
    184     @Deprecated
    185     public void setTime() {
    186         setTimeFromAttribute();
    187     }
    188 
    189     /**
    190180     * Sets the {@link #PT_TIME} attribute to the specified time.
    191181     *
     
    205195    public void setTimeInMillis(long ts) {
    206196        attr.put(PT_TIME, new Date(ts));
    207     }
    208 
    209     /**
    210      * Convert the time stamp of the waypoint into seconds from the epoch.
    211      * @return The parsed time if successful, or {@code null}
    212      * @since 9383
    213      * @deprecated Use {@link #setTime(Date)}, {@link #setTime(long)}, {@link #setTimeInMillis(long)}
    214      */
    215     @Deprecated
    216     public Date setTimeFromAttribute() {
    217         Logging.warn("WayPoint.setTimeFromAttribute() is deprecated, please fix calling code");
    218         return getDate();
    219197    }
    220198
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r14905 r15007  
    1010import java.util.Collections;
    1111import java.util.Date;
    12 import java.util.LinkedHashSet;
    1312import java.util.List;
    1413import java.util.Locale;
     
    8382
    8483    /**
    85      * Replies the sub-collection of {@link OsmPrimitive}s of type <code>type</code> present in
    86      * another collection of {@link OsmPrimitive}s. The result collection is a list.
    87      *
    88      * If <code>list</code> is null, replies an empty list.
    89      *
    90      * @param <T> type of data (must be one of the {@link OsmPrimitive} types
    91      * @param list  the original list
    92      * @param type the type to filter for
    93      * @return the sub-list of OSM primitives of type <code>type</code>
    94      * @deprecated Use {@link Stream} or {@link Utils#filteredCollection(Collection, Class)} instead.
    95      */
    96     @Deprecated
    97     public static <T extends OsmPrimitive> List<T> getFilteredList(Collection<OsmPrimitive> list, Class<T> type) {
    98         return (list != null ? list.stream() : Stream.empty())
    99                 .filter(type::isInstance)
    100                 .map(type::cast)
    101                 .collect(Collectors.toList());
    102     }
    103 
    104     /**
    105      * Replies the sub-collection of {@link OsmPrimitive}s of type <code>type</code> present in
    106      * another collection of {@link OsmPrimitive}s. The result collection is a set.
    107      *
    108      * If <code>list</code> is null, replies an empty set.
    109      *
    110      * @param <T> type of data (must be one of the {@link OsmPrimitive} types
    111      * @param set  the original collection
    112      * @param type the type to filter for
    113      * @return the sub-set of OSM primitives of type <code>type</code>
    114      * @deprecated Use {@link Stream} instead
    115      */
    116     @Deprecated
    117     public static <T extends OsmPrimitive> Set<T> getFilteredSet(Collection<OsmPrimitive> set, Class<T> type) {
    118         return (set != null ? set.stream() : Stream.empty())
    119                 .filter(type::isInstance)
    120                 .map(type::cast)
    121                 .collect(Collectors.toCollection(LinkedHashSet::new));
    122     }
    123 
    124     /**
    12584     * Replies the collection of referring primitives for the primitives in <code>primitives</code>.
    12685     *
  • trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java

    r14518 r15007  
    216216     * @param tag The tag
    217217     * @return The number of times this tag is used in this collection.
    218      * @since 10736
    219      * @deprecated use {@link #getTagOccurrence}
    220      */
    221     @Deprecated
    222     public int getTagOccurence(Tag tag) {
    223         return getTagOccurrence(tag);
    224     }
    225 
    226     /**
    227      * Gets the number of times this tag was added to the collection.
    228      * @param tag The tag
    229      * @return The number of times this tag is used in this collection.
    230218     * @since 14302
    231219     */
  • trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java

    r14373 r15007  
    111111
    112112    /**
    113      * Compute Levenshtein distance
    114      *
    115      * @param s First word
    116      * @param t Second word
    117      * @return The distance between words
    118      * @deprecated Use {@link Utils#getLevenshteinDistance} instead
    119      */
    120     @Deprecated
    121     public static int getLevenshteinDistance(String s, String t) {
    122         return Utils.getLevenshteinDistance(s, t);
    123     }
    124 
    125     /**
    126113     * Add a regular expression rule.
    127114     * @param regExpr the regular expression to search for
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r14977 r15007  
    217217    private static final MainLayerManager layerManager = new MainLayerManager();
    218218
    219     /**
    220      * The commands undo/redo handler.
    221      * @since 12641
    222      * @deprecated Use {@link UndoRedoHandler#getInstance}
    223      */
    224     @Deprecated
    225     public static final UndoRedoHandler undoRedo = UndoRedoHandler.getInstance();
    226 
    227219    private static final LayerChangeListener undoRedoCleaner = new LayerChangeListener() {
    228220        @Override
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialog.java

    r14465 r15007  
    124124    }
    125125
    126     /**
    127      * Removes this history browser model as listener for data change and layer change events.
    128      * @deprecated not needeed anymore, job is done in {@link #dispose}
    129      */
    130     @Deprecated
    131     public void unlinkAsListener() {
    132         getHistoryBrowser().getModel().unlinkAsListener();
    133     }
    134 
    135126    /* ---------------------------------------------------------------------------------- */
    136127    /* interface HistoryDataSetListener                                                   */
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r14802 r15007  
    696696
    697697    /**
    698      * Clears the currentPhoto, i.e. remove select marker, and optionally repaint.
    699      * @param repaint Repaint flag
    700      * @deprecated Use {@link ImageData#clearSelectedImage}
    701      * @since 6392
    702      */
    703     @Deprecated
    704     public void clearCurrentPhoto(boolean repaint) {
    705         data.clearSelectedImage();
    706         if (repaint) {
    707             updateBufferAndRepaint();
    708         }
    709     }
    710 
    711     /**
    712698     * Clears the currentPhoto of the other GeoImageLayer's. Otherwise there could be multiple selected photos.
    713699     */
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r14436 r15007  
    3636import org.openstreetmap.josm.io.auth.CredentialsManager;
    3737import org.openstreetmap.josm.spi.preferences.Config;
    38 import org.openstreetmap.josm.spi.preferences.IUrls;
    3938import org.openstreetmap.josm.tools.CheckParameterUtil;
    4039import org.openstreetmap.josm.tools.HttpClient;
     
    7069     */
    7170    public static final int MAX_DOWNLOAD_THREADS = 2;
    72 
    73     /**
    74      * Default URL of the standard OSM API.
    75      * @deprecated Use {@link IUrls#getDefaultOsmApiUrl}
    76      * @since 5422
    77      */
    78     @Deprecated
    79     public static final String DEFAULT_API_URL = "https://api.openstreetmap.org/api";
    8071
    8172    // The collection of instantiated OSM APIs
  • trunk/src/org/openstreetmap/josm/tools/PlatformHook.java

    r14689 r15007  
    124124
    125125    /**
    126       * The makeTooltip hook will be called whenever a tooltip for
    127       * a menu or button is created.
    128       *
    129       * Tooltips are usually not system dependent, unless the
    130       * JVM is too dumb to provide correct names for all the keys.
    131       *
    132       * Some LAFs don't understand HTML, such as the OSX LAFs.
    133       *
    134      * @param name Tooltip text to display
    135      * @param sc Shortcut associated (to display accelerator between parenthesis)
    136      * @return Full tooltip text (name + accelerator)
    137      * @since 1084
    138      * @deprecated Use {@link Shortcut#makeTooltip} instead.
    139       */
    140     @Deprecated
    141     default String makeTooltip(String name, Shortcut sc) {
    142         return Shortcut.makeTooltip(name, sc != null ? sc.getKeyStroke() : null);
    143     }
    144 
    145     /**
    146126     * Returns the default LAF to be used on this platform to look almost as a native application.
    147127     * @return The default native LAF for this platform
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r14977 r15007  
    1717import java.io.InputStream;
    1818import java.io.UnsupportedEncodingException;
    19 import java.lang.reflect.AccessibleObject;
    2019import java.net.MalformedURLException;
    2120import java.net.URL;
     
    15541553
    15551554    /**
    1556      * Sets {@code AccessibleObject}(s) accessible.
    1557      * @param objects objects
    1558      * @see AccessibleObject#setAccessible
    1559      * @deprecated Use {@link ReflectionUtils#setObjectsAccessible(AccessibleObject...)}
    1560      * @since 10223
    1561      */
    1562     @Deprecated
    1563     public static void setObjectsAccessible(final AccessibleObject... objects) {
    1564         ReflectionUtils.setObjectsAccessible(objects);
    1565     }
    1566 
    1567     /**
    15681555     * Clamp a value to the given range
    15691556     * @param val The value
Note: See TracChangeset for help on using the changeset viewer.