- Timestamp:
- 2021-07-13T23:56:50+02:00 (3 years ago)
- 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 51 51 String toolbarId, boolean installAdapters) { 52 52 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 open58 * @return {@code true} if the user confirms, {@code false} otherwise59 * @deprecated use {@link OpenBrowserAction#confirmLaunchMultiple(int)}60 */61 @Deprecated62 public static boolean confirmLaunchMultiple(int numBrowsers) {63 return OpenBrowserAction.confirmLaunchMultiple(numBrowsers);64 53 } 65 54 -
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r17556 r18014 83 83 File[] files = fc.getSelectedFiles(); 84 84 OpenFileTask task = new OpenFileTask(Arrays.asList(files), fc.getFileFilter()); 85 task.set RecordHistory(true);85 task.setOptions(Options.RECORD_HISTORY); 86 86 MainApplication.worker.submit(task); 87 87 } … … 101 101 public static Future<?> openFiles(List<File> fileList) { 102 102 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 files108 * @param recordHistory {@code true} to save filename in history (default: false)109 * @return the future task110 * @since 11986 (return task)111 * @deprecated Since 17534, use {@link OpenFileAction#openFiles(List, Options...)} with {@link Options#RECORD_HISTORY} instead.112 */113 @Deprecated114 public static Future<?> openFiles(List<File> fileList, boolean recordHistory) {115 Options[] options = recordHistory ? new Options[] {Options.RECORD_HISTORY} : null;116 return openFiles(fileList, options);117 103 } 118 104 … … 181 167 public OpenFileTask(List<File> files, FileFilter fileFilter) { 182 168 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 @Deprecated191 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 }197 169 } 198 170 -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r17188 r18014 325 325 * @param w the way to simplify 326 326 * @return The sequence of commands to run 327 * @since 6411328 * @deprecated Replaced by {@link #createSimplifyCommand(Way)}. You can also use {@link #simplifyWays(List, double)} directly.329 */330 @Deprecated331 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 simplify339 * @param threshold the max error threshold340 * @return The sequence of commands to run341 * @since 6411342 * @deprecated Replaced by {@link #createSimplifyCommand(Way, double)}. You can also use {@link #simplifyWays(List, double)} directly.343 */344 @Deprecated345 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 simplify353 * @return The sequence of commands to run354 327 * @since 15419 355 328 */ -
trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java
r17524 r18014 138 138 139 139 /** 140 * removes the conflict registered for {@link OsmPrimitive} <code>my</code> if any141 *142 * @param my the primitive143 * @deprecated use {@link #removeForMy(OsmPrimitive)}144 */145 @Deprecated146 public void remove(OsmPrimitive my) {147 removeForMy(my);148 }149 150 /**151 140 * Replies the conflict for the {@link OsmPrimitive} <code>my</code>, null 152 141 * if no such conflict exists. -
trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
r17880 r18014 228 228 * Returns EXIF time 229 229 * @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 240 231 */ 241 232 public Instant getExifInstant() { … … 266 257 * Returns the EXIF GPS time. 267 258 * @return the EXIF GPS time 259 * @since 17715 268 260 */ 269 261 public Instant getExifGpsInstant() { … … 365 357 * Sets EXIF time. 366 358 * @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; 372 363 } 373 364 … … 375 366 * Sets the EXIF GPS time. 376 367 * @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; 383 372 } 384 373 … … 386 375 * Sets the GPS time. 387 376 * @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 414 378 */ 415 379 public void setGpsTime(Instant gpsTime) { -
trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java
r17846 r18014 245 245 colorCache = null; 246 246 } 247 248 /**249 * A listener that listens to GPX track changes.250 * @deprecated use {@link IGpxTrack.GpxTrackChangeListener} instead251 */252 @Deprecated253 @FunctionalInterface254 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} instead261 */262 @Deprecated263 static class GpxTrackChangeEvent extends IGpxTrack.GpxTrackChangeEvent {264 GpxTrackChangeEvent(IGpxTrack source) {265 super(source);266 }267 }268 269 247 } -
trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
r17715 r18014 134 134 * Sets the {@link #PT_TIME} attribute to the specified time. 135 135 * 136 * @param time the time to set137 * @since 9383138 * @deprecated Use {@link #setInstant(Instant)}139 */140 @Deprecated141 public void setTime(Date time) {142 setInstant(time.toInstant());143 }144 145 /**146 * Sets the {@link #PT_TIME} attribute to the specified time.147 *148 136 * @param ts seconds from the epoch 149 137 * @since 13210 -
trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java
r16553 r18014 7 7 import java.io.Serializable; 8 8 import java.util.Arrays; 9 import java.util.Collection;10 9 import java.util.Collections; 11 10 import java.util.List; 12 11 import java.util.Map; 13 import java.util.stream.Collectors;14 12 15 13 import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor; … … 79 77 builder.append(id).append(' ').append(Arrays.toString(keys)).append(' ').append(getFlagsAsString()); 80 78 return builder.toString(); 81 }82 83 /**84 * Returns a filtered list for a given primitive type.85 * @param <T> primitive type86 * @param list list to filter87 * @param type primitive type88 * @return a filtered list for given primitive type89 * @deprecated Use {@link Collection#stream()} instead90 */91 @Deprecated92 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());94 79 } 95 80 -
trunk/src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java
r16918 r18014 318 318 } 319 319 320 /**321 * Replies true if the user selected to download OSM data322 *323 * @return true if the user selected to download OSM data324 * @deprecated since 16503 -- use {@code getDownloadType(OsmDataDownloadType.class).getCheckBox().isSelected()}325 */326 @Deprecated327 public boolean isDownloadOsmData() {328 return getDownloadType(OsmDataDownloadType.class).getCheckBox().isSelected();329 }330 331 /**332 * Replies true if the user selected to download GPX data333 *334 * @return true if the user selected to download GPX data335 * @deprecated since 16503 -- use {@code getDownloadType(GpsDataDownloadType.class).getCheckBox().isSelected()}336 */337 @Deprecated338 public boolean isDownloadGpxData() {339 return getDownloadType(GpsDataDownloadType.class).getCheckBox().isSelected();340 }341 342 /**343 * Replies true if user selected to download notes344 *345 * @return true if user selected to download notes346 * @deprecated since 16503 -- use {@code getDownloadType(NotesDataDownloadType.class).getCheckBox().isSelected()}347 */348 @Deprecated349 public boolean isDownloadNotes() {350 return getDownloadType(NotesDataDownloadType.class).getCheckBox().isSelected();351 }352 353 320 @Override 354 321 public Icon getIcon() { -
trunk/src/org/openstreetmap/josm/io/OnlineResource.java
r17044 r18014 39 39 return locName; 40 40 } 41 41 42 42 /** 43 43 * Replies the offline icon. … … 83 83 return url.startsWith(baseUrl.substring(baseUrl.indexOf("://")), url.indexOf("://")); 84 84 } 85 86 /**87 * Ensures resource is not accessed in offline mode.88 * @param downloadString The attempted download string89 * @param ignore ignored90 * @throws OfflineAccessException if resource is accessed in offline mode, in any protocol91 * @deprecated use {@link NetworkManager#isOffline(String)}92 */93 @Deprecated94 public final void checkOfflineAccess(String downloadString, String ignore) {95 if (NetworkManager.isOffline(downloadString)) {96 throw OfflineAccessException.forResource(downloadString);97 }98 }99 85 } -
trunk/src/org/openstreetmap/josm/tools/ExifReader.java
r17715 r18014 7 7 import java.time.DateTimeException; 8 8 import java.time.Instant; 9 import java.util.Date;10 9 import java.util.List; 11 10 import java.util.concurrent.TimeUnit; … … 43 42 * @param filename The JPEG file to read 44 43 * @return The date/time read in the EXIF section, or {@code null} if not found 45 * @deprecated Use {@link #readInstant(File)}46 */47 @Deprecated48 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 read56 * @return The date/time read in the EXIF section, or {@code null} if not found57 44 */ 58 45 public static Instant readInstant(File filename) { … … 64 51 } 65 52 return null; 66 }67 68 /**69 * Returns the date/time from the given JPEG file.70 * @param metadata The EXIF metadata71 * @return The date/time read in the EXIF section, or {@code null} if not found72 * @since 1174573 * @deprecated Use {@link #readInstant(Metadata)}74 */75 @Deprecated76 public static Date readTime(Metadata metadata) {77 Instant instant = readInstant(metadata);78 return instant == null ? null : Date.from(instant);79 53 } 80 54 -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r17880 r18014 20 20 import java.awt.image.ImageFilter; 21 21 import java.awt.image.ImageProducer; 22 import java.awt.image.RGBImageFilter; 22 23 import java.awt.image.RenderedImage; 23 import java.awt.image.RGBImageFilter;24 24 import java.awt.image.WritableRaster; 25 25 import java.io.ByteArrayInputStream; … … 586 586 587 587 /** 588 * Add an additional class loader to search image for.589 * @param additionalClassLoader class loader to add to the internal set590 * @return {@code true} if the set changed as a result of the call591 * @since 12870592 * @deprecated Use ResourceProvider#addAdditionalClassLoader593 */594 @Deprecated595 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 set602 * @return {@code true} if the set changed as a result of the call603 * @since 12870604 * @deprecated Use ResourceProvider#addAdditionalClassLoaders605 */606 @Deprecated607 public static boolean addAdditionalClassLoaders(Collection<ClassLoader> additionalClassLoaders) {608 return ResourceProvider.addAdditionalClassLoaders(additionalClassLoaders);609 }610 611 /**612 588 * Set, if image must be filtered to grayscale so it will look like disabled icon. 613 589 * -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r17692 r18014 104 104 105 105 /** 106 * Checks if an item that is an instance of clazz exists in the collection107 * @param <T> The collection type.108 * @param collection The collection109 * @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 @Deprecated114 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 match124 * @return the item or <code>null</code> if there was not match.125 * @deprecated use {@link Stream#filter} and {@link Stream#findFirst}126 */127 @Deprecated128 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 @Deprecated146 @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 /**153 106 * Returns the first element from {@code items} which is non-null, or null if all elements are null. 154 107 * @param <T> type of items
Note:
See TracChangeset
for help on using the changeset viewer.