Changeset 13250 in josm for trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
- Timestamp:
- 2017-12-28T00:53:58+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r13186 r13250 631 631 632 632 /** 633 * Determines if this icon is located on a remote location (http, https, wiki). 634 * @return {@code true} if this icon is located on a remote location (http, https, wiki) 635 * @since 13250 636 */ 637 public boolean isRemote() { 638 return name.startsWith(HTTP_PROTOCOL) || name.startsWith(HTTPS_PROTOCOL) || name.startsWith(WIKI_PROTOCOL); 639 } 640 641 /** 633 642 * Execute the image request and scale result. 634 643 * @return the requested image or null if the request failed … … 655 664 */ 656 665 public CompletableFuture<ImageIcon> getAsync() { 657 return name.startsWith(HTTP_PROTOCOL) || name.startsWith(WIKI_PROTOCOL)666 return isRemote() 658 667 ? CompletableFuture.supplyAsync(this::get, IMAGE_FETCHER) 659 668 : CompletableFuture.completedFuture(get()); … … 699 708 */ 700 709 public CompletableFuture<ImageResource> getResourceAsync() { 701 return name.startsWith(HTTP_PROTOCOL) || name.startsWith(WIKI_PROTOCOL)710 return isRemote() 702 711 ? CompletableFuture.supplyAsync(this::getResource, IMAGE_FETCHER) 703 712 : CompletableFuture.completedFuture(getResource());
Note:
See TracChangeset
for help on using the changeset viewer.