- Timestamp:
- 2022-04-04T22:26:00+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/street_level/IImageEntry.java
r18290 r18427 6 6 import java.io.File; 7 7 import java.io.IOException; 8 import java.net.URI; 8 9 import java.time.Instant; 9 10 import java.util.List; … … 158 159 159 160 /** 161 * Get the URI for the image 162 * @return The image URI 163 * @since 18427 164 */ 165 default URI getImageURI() { 166 return this.getFile().toURI(); 167 } 168 169 /** 160 170 * Returns the position value. The position value from the temporary copy 161 171 * is returned if that copy exists. -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r18300 r18427 484 484 public void actionPerformed(ActionEvent e) { 485 485 if (currentEntry != null) { 486 ClipboardUtils.copyString(String.valueOf(currentEntry.get File()));486 ClipboardUtils.copyString(String.valueOf(currentEntry.getImageURI())); 487 487 } 488 488 } … … 511 511 if (currentEntry != null) { 512 512 try { 513 PlatformManager.getPlatform().openUrl(currentEntry.get File().toURI().toURL().toExternalForm());513 PlatformManager.getPlatform().openUrl(currentEntry.getImageURI().toURL().toExternalForm()); 514 514 } catch (IOException ex) { 515 515 Logging.error(ex); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/WikimediaCommonsEntry.java
r18217 r18427 3 3 4 4 import java.net.MalformedURLException; 5 import java.net.URI; 6 import java.net.URISyntaxException; 5 7 import java.net.URL; 6 8 import java.util.Objects; 7 9 8 10 import org.openstreetmap.josm.data.coor.LatLon; 11 import org.openstreetmap.josm.tools.JosmRuntimeException; 9 12 import org.openstreetmap.josm.tools.Mediawiki; 10 13 … … 23 26 protected URL getImageUrl() throws MalformedURLException { 24 27 return new URL(Mediawiki.getImageUrl("https://upload.wikimedia.org/wikipedia/commons", title)); 28 } 29 30 @Override 31 public URI getImageURI() { 32 try { 33 return new URI(Mediawiki.getImageUrl("https://upload.wikimedia.org/wikipedia/commons", this.title)); 34 } catch (URISyntaxException e) { 35 // This should never happen. 36 throw new JosmRuntimeException(this.toString(), e); 37 } 25 38 } 26 39
Note:
See TracChangeset
for help on using the changeset viewer.