Changeset 18014 in josm


Ignore:
Timestamp:
2021-07-13T23:56:50+02:00 (3 years ago)
Author:
Don-vip
Message:

remove deprecated stuff not used by plugins

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

Legend:

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

    r16553 r18014  
    5151            String toolbarId, boolean installAdapters) {
    5252        super(name, iconName, tooltip, shortcut, register, toolbarId, installAdapters);
    53     }
    54 
    55     /**
    56      * Asks user confirmation before launching a large number of browser windows.
    57      * @param numBrowsers the number of browser windows to open
    58      * @return {@code true} if the user confirms, {@code false} otherwise
    59      * @deprecated use {@link OpenBrowserAction#confirmLaunchMultiple(int)}
    60      */
    61     @Deprecated
    62     public static boolean confirmLaunchMultiple(int numBrowsers) {
    63         return OpenBrowserAction.confirmLaunchMultiple(numBrowsers);
    6453    }
    6554
  • trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java

    r17556 r18014  
    8383        File[] files = fc.getSelectedFiles();
    8484        OpenFileTask task = new OpenFileTask(Arrays.asList(files), fc.getFileFilter());
    85         task.setRecordHistory(true);
     85        task.setOptions(Options.RECORD_HISTORY);
    8686        MainApplication.worker.submit(task);
    8787    }
     
    101101    public static Future<?> openFiles(List<File> fileList) {
    102102        return openFiles(fileList, (Options[]) null);
    103     }
    104 
    105     /**
    106      * Open a list of files. The complete list will be passed to batch importers.
    107      * @param fileList A list of files
    108      * @param recordHistory {@code true} to save filename in history (default: false)
    109      * @return the future task
    110      * @since 11986 (return task)
    111      * @deprecated Since 17534, use {@link OpenFileAction#openFiles(List, Options...)} with {@link Options#RECORD_HISTORY} instead.
    112      */
    113     @Deprecated
    114     public static Future<?> openFiles(List<File> fileList, boolean recordHistory) {
    115         Options[] options = recordHistory ? new Options[] {Options.RECORD_HISTORY} : null;
    116         return openFiles(fileList, options);
    117103    }
    118104
     
    181167        public OpenFileTask(List<File> files, FileFilter fileFilter) {
    182168            this(files, fileFilter, tr("Opening files"));
    183         }
    184 
    185         /**
    186          * Sets whether to save filename in history (for list of recently opened files).
    187          * @param recordHistory {@code true} to save filename in history (default: false)
    188          * @deprecated since 17534 (use {@link #setOptions} instead).
    189          */
    190         @Deprecated
    191         public void setRecordHistory(boolean recordHistory) {
    192             if (recordHistory) {
    193                 this.options.add(Options.RECORD_HISTORY);
    194             } else {
    195                 this.options.remove(Options.RECORD_HISTORY);
    196             }
    197169        }
    198170
  • trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java

    r17188 r18014  
    325325     * @param w the way to simplify
    326326     * @return The sequence of commands to run
    327      * @since 6411
    328      * @deprecated Replaced by {@link #createSimplifyCommand(Way)}. You can also use {@link #simplifyWays(List, double)} directly.
    329      */
    330     @Deprecated
    331     public final SequenceCommand simplifyWay(Way w) {
    332         return createSimplifyCommand(w);
    333     }
    334 
    335     /**
    336      * Creates the SequenceCommand to simplify a way with a given threshold.
    337      *
    338      * @param w the way to simplify
    339      * @param threshold the max error threshold
    340      * @return The sequence of commands to run
    341      * @since 6411
    342      * @deprecated Replaced by {@link #createSimplifyCommand(Way, double)}. You can also use {@link #simplifyWays(List, double)} directly.
    343      */
    344     @Deprecated
    345     public static SequenceCommand simplifyWay(Way w, double threshold) {
    346         return createSimplifyCommand(w, threshold);
    347     }
    348 
    349     /**
    350      * Creates the SequenceCommand to simplify a way with default threshold.
    351      *
    352      * @param w the way to simplify
    353      * @return The sequence of commands to run
    354327     * @since 15419
    355328     */
  • trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java

    r17524 r18014  
    138138
    139139    /**
    140      * removes the conflict registered for {@link OsmPrimitive} <code>my</code> if any
    141      *
    142      * @param my  the primitive
    143      * @deprecated use {@link #removeForMy(OsmPrimitive)}
    144      */
    145     @Deprecated
    146     public void remove(OsmPrimitive my) {
    147         removeForMy(my);
    148     }
    149 
    150     /**
    151140     * Replies the conflict for the {@link OsmPrimitive} <code>my</code>, null
    152141     * if no such conflict exists.
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java

    r17880 r18014  
    228228     * Returns EXIF time
    229229     * @return EXIF time
    230      * @deprecated Use {@link #getExifInstant}
    231      */
    232     @Deprecated
    233     public Date getExifTime() {
    234         return getDefensiveDate(exifTime);
    235     }
    236 
    237     /**
    238      * Returns EXIF time
    239      * @return EXIF time
     230     * @since 17715
    240231     */
    241232    public Instant getExifInstant() {
     
    266257     * Returns the EXIF GPS time.
    267258     * @return the EXIF GPS time
     259     * @since 17715
    268260     */
    269261    public Instant getExifGpsInstant() {
     
    365357     * Sets EXIF time.
    366358     * @param exifTime EXIF time
    367      * @deprecated Use {@link #setExifTime(Instant)}
    368      */
    369     @Deprecated
    370     public void setExifTime(Date exifTime) {
    371         this.exifTime = exifTime == null ? null : exifTime.toInstant();
     359     * @since 17715
     360     */
     361    public void setExifTime(Instant exifTime) {
     362        this.exifTime = exifTime;
    372363    }
    373364
     
    375366     * Sets the EXIF GPS time.
    376367     * @param exifGpsTime the EXIF GPS time
    377      * @since 6392
    378      * @deprecated Use {@link #setExifGpsTime(Instant)}
    379      */
    380     @Deprecated
    381     public void setExifGpsTime(Date exifGpsTime) {
    382         this.exifGpsTime = exifGpsTime == null ? null : exifGpsTime.toInstant();
     368     * @since 17715
     369     */
     370    public void setExifGpsTime(Instant exifGpsTime) {
     371        this.exifGpsTime = exifGpsTime;
    383372    }
    384373
     
    386375     * Sets the GPS time.
    387376     * @param gpsTime the GPS time
    388      * @deprecated Use {@link #setGpsTime(Instant)}
    389      */
    390     @Deprecated
    391     public void setGpsTime(Date gpsTime) {
    392         this.gpsTime = gpsTime == null ? null : gpsTime.toInstant();
    393     }
    394 
    395     /**
    396      * Sets EXIF time.
    397      * @param exifTime EXIF time
    398      */
    399     public void setExifTime(Instant exifTime) {
    400         this.exifTime = exifTime;
    401     }
    402 
    403     /**
    404      * Sets the EXIF GPS time.
    405      * @param exifGpsTime the EXIF GPS time
    406      */
    407     public void setExifGpsTime(Instant exifGpsTime) {
    408         this.exifGpsTime = exifGpsTime;
    409     }
    410 
    411     /**
    412      * Sets the GPS time.
    413      * @param gpsTime the GPS time
     377     * @since 17715
    414378     */
    415379    public void setGpsTime(Instant gpsTime) {
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java

    r17846 r18014  
    245245        colorCache = null;
    246246    }
    247 
    248     /**
    249      * A listener that listens to GPX track changes.
    250      * @deprecated use {@link IGpxTrack.GpxTrackChangeListener} instead
    251      */
    252     @Deprecated
    253     @FunctionalInterface
    254     interface GpxTrackChangeListener {
    255         void gpxDataChanged(GpxTrackChangeEvent e);
    256     }
    257 
    258     /**
    259      * A track change event for the current track.
    260      * @deprecated use {@link IGpxTrack.GpxTrackChangeEvent} instead
    261      */
    262     @Deprecated
    263     static class GpxTrackChangeEvent extends IGpxTrack.GpxTrackChangeEvent {
    264         GpxTrackChangeEvent(IGpxTrack source) {
    265             super(source);
    266         }
    267     }
    268 
    269247}
  • trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java

    r17715 r18014  
    134134     * Sets the {@link #PT_TIME} attribute to the specified time.
    135135     *
    136      * @param time the time to set
    137      * @since 9383
    138      * @deprecated Use {@link #setInstant(Instant)}
    139      */
    140     @Deprecated
    141     public void setTime(Date time) {
    142         setInstant(time.toInstant());
    143     }
    144 
    145     /**
    146      * Sets the {@link #PT_TIME} attribute to the specified time.
    147      *
    148136     * @param ts seconds from the epoch
    149137     * @since 13210
  • trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java

    r16553 r18014  
    77import java.io.Serializable;
    88import java.util.Arrays;
    9 import java.util.Collection;
    109import java.util.Collections;
    1110import java.util.List;
    1211import java.util.Map;
    13 import java.util.stream.Collectors;
    1412
    1513import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor;
     
    7977        builder.append(id).append(' ').append(Arrays.toString(keys)).append(' ').append(getFlagsAsString());
    8078        return builder.toString();
    81     }
    82 
    83     /**
    84      * Returns a filtered list for a given primitive type.
    85      * @param <T> primitive type
    86      * @param list list to filter
    87      * @param type primitive type
    88      * @return a filtered list for given primitive type
    89      * @deprecated Use {@link Collection#stream()} instead
    90      */
    91     @Deprecated
    92     public static <T extends PrimitiveData> List<T> getFilteredList(Collection<T> list, OsmPrimitiveType type) {
    93         return list.stream().filter(p -> type.getDataClass().isInstance(p)).collect(Collectors.toList());
    9479    }
    9580
  • trunk/src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java

    r16918 r18014  
    318318        }
    319319
    320         /**
    321          * Replies true if the user selected to download OSM data
    322          *
    323          * @return true if the user selected to download OSM data
    324          * @deprecated since 16503 -- use {@code getDownloadType(OsmDataDownloadType.class).getCheckBox().isSelected()}
    325          */
    326         @Deprecated
    327         public boolean isDownloadOsmData() {
    328             return getDownloadType(OsmDataDownloadType.class).getCheckBox().isSelected();
    329         }
    330 
    331         /**
    332          * Replies true if the user selected to download GPX data
    333          *
    334          * @return true if the user selected to download GPX data
    335          * @deprecated since 16503 -- use {@code getDownloadType(GpsDataDownloadType.class).getCheckBox().isSelected()}
    336          */
    337         @Deprecated
    338         public boolean isDownloadGpxData() {
    339             return getDownloadType(GpsDataDownloadType.class).getCheckBox().isSelected();
    340         }
    341 
    342         /**
    343          * Replies true if user selected to download notes
    344          *
    345          * @return true if user selected to download notes
    346          * @deprecated since 16503 -- use {@code getDownloadType(NotesDataDownloadType.class).getCheckBox().isSelected()}
    347          */
    348         @Deprecated
    349         public boolean isDownloadNotes() {
    350             return getDownloadType(NotesDataDownloadType.class).getCheckBox().isSelected();
    351         }
    352 
    353320        @Override
    354321        public Icon getIcon() {
  • trunk/src/org/openstreetmap/josm/io/OnlineResource.java

    r17044 r18014  
    3939        return locName;
    4040    }
    41    
     41
    4242    /**
    4343     * Replies the offline icon.
     
    8383        return url.startsWith(baseUrl.substring(baseUrl.indexOf("://")), url.indexOf("://"));
    8484    }
    85 
    86     /**
    87      * Ensures resource is not accessed in offline mode.
    88      * @param downloadString The attempted download string
    89      * @param ignore ignored
    90      * @throws OfflineAccessException if resource is accessed in offline mode, in any protocol
    91      * @deprecated use {@link NetworkManager#isOffline(String)}
    92      */
    93     @Deprecated
    94     public final void checkOfflineAccess(String downloadString, String ignore) {
    95         if (NetworkManager.isOffline(downloadString)) {
    96             throw OfflineAccessException.forResource(downloadString);
    97         }
    98     }
    9985}
  • trunk/src/org/openstreetmap/josm/tools/ExifReader.java

    r17715 r18014  
    77import java.time.DateTimeException;
    88import java.time.Instant;
    9 import java.util.Date;
    109import java.util.List;
    1110import java.util.concurrent.TimeUnit;
     
    4342     * @param filename The JPEG file to read
    4443     * @return The date/time read in the EXIF section, or {@code null} if not found
    45      * @deprecated Use {@link #readInstant(File)}
    46      */
    47     @Deprecated
    48     public static Date readTime(File filename) {
    49         Instant instant = readInstant(filename);
    50         return instant == null ? null : Date.from(instant);
    51     }
    52 
    53     /**
    54      * Returns the date/time from the given JPEG file.
    55      * @param filename The JPEG file to read
    56      * @return The date/time read in the EXIF section, or {@code null} if not found
    5744     */
    5845    public static Instant readInstant(File filename) {
     
    6451        }
    6552        return null;
    66     }
    67 
    68     /**
    69      * Returns the date/time from the given JPEG file.
    70      * @param metadata The EXIF metadata
    71      * @return The date/time read in the EXIF section, or {@code null} if not found
    72      * @since 11745
    73      * @deprecated Use {@link #readInstant(Metadata)}
    74      */
    75     @Deprecated
    76     public static Date readTime(Metadata metadata) {
    77         Instant instant = readInstant(metadata);
    78         return instant == null ? null : Date.from(instant);
    7953    }
    8054
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r17880 r18014  
    2020import java.awt.image.ImageFilter;
    2121import java.awt.image.ImageProducer;
     22import java.awt.image.RGBImageFilter;
    2223import java.awt.image.RenderedImage;
    23 import java.awt.image.RGBImageFilter;
    2424import java.awt.image.WritableRaster;
    2525import java.io.ByteArrayInputStream;
     
    586586
    587587    /**
    588      * Add an additional class loader to search image for.
    589      * @param additionalClassLoader class loader to add to the internal set
    590      * @return {@code true} if the set changed as a result of the call
    591      * @since 12870
    592      * @deprecated Use ResourceProvider#addAdditionalClassLoader
    593      */
    594     @Deprecated
    595     public static boolean addAdditionalClassLoader(ClassLoader additionalClassLoader) {
    596         return ResourceProvider.addAdditionalClassLoader(additionalClassLoader);
    597     }
    598 
    599     /**
    600      * Add a collection of additional class loaders to search image for.
    601      * @param additionalClassLoaders class loaders to add to the internal set
    602      * @return {@code true} if the set changed as a result of the call
    603      * @since 12870
    604      * @deprecated Use ResourceProvider#addAdditionalClassLoaders
    605      */
    606     @Deprecated
    607     public static boolean addAdditionalClassLoaders(Collection<ClassLoader> additionalClassLoaders) {
    608         return ResourceProvider.addAdditionalClassLoaders(additionalClassLoaders);
    609     }
    610 
    611     /**
    612588     * Set, if image must be filtered to grayscale so it will look like disabled icon.
    613589     *
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r17692 r18014  
    104104
    105105    /**
    106      * Checks if an item that is an instance of clazz exists in the collection
    107      * @param <T> The collection type.
    108      * @param collection The collection
    109      * @param clazz The class to search for.
    110      * @return <code>true</code> if that item exists in the collection.
    111      * @deprecated use {@link Stream#anyMatch}
    112      */
    113     @Deprecated
    114     public static <T> boolean exists(Iterable<T> collection, Class<? extends T> clazz) {
    115         CheckParameterUtil.ensureParameterNotNull(clazz, "clazz");
    116         return StreamUtils.toStream(collection).anyMatch(clazz::isInstance);
    117     }
    118 
    119     /**
    120      * Finds the first item in the iterable for which the predicate matches.
    121      * @param <T> The iterable type.
    122      * @param collection The iterable to search in.
    123      * @param predicate The predicate to match
    124      * @return the item or <code>null</code> if there was not match.
    125      * @deprecated use {@link Stream#filter} and {@link Stream#findFirst}
    126      */
    127     @Deprecated
    128     public static <T> T find(Iterable<? extends T> collection, Predicate<? super T> predicate) {
    129         for (T item : collection) {
    130             if (predicate.test(item)) {
    131                 return item;
    132             }
    133         }
    134         return null;
    135     }
    136 
    137     /**
    138      * Finds the first item in the iterable which is of the given type.
    139      * @param <T> The iterable type.
    140      * @param collection The iterable to search in.
    141      * @param clazz The class to search for.
    142      * @return the item or <code>null</code> if there was not match.
    143      * @deprecated use {@link Stream#filter} and {@link Stream#findFirst}
    144      */
    145     @Deprecated
    146     @SuppressWarnings("unchecked")
    147     public static <T> T find(Iterable<? extends Object> collection, Class<? extends T> clazz) {
    148         CheckParameterUtil.ensureParameterNotNull(clazz, "clazz");
    149         return (T) find(collection, clazz::isInstance);
    150     }
    151 
    152     /**
    153106     * Returns the first element from {@code items} which is non-null, or null if all elements are null.
    154107     * @param <T> type of items
Note: See TracChangeset for help on using the changeset viewer.