- Timestamp:
- 2013-09-21T01:16:55+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r6084 r6242 15 15 import java.awt.event.MouseEvent; 16 16 import java.io.File; 17 import java.net.URL; 17 import java.net.URI; 18 import java.net.URISyntaxException; 18 19 import java.util.ArrayList; 19 20 import java.util.Collection; … … 274 275 double adjustment = AudioPlayer.position() - startMarker.offset; // in seconds 275 276 boolean seenStart = false; 276 URL url = startMarker.url(); 277 for (Marker m : data) { 278 if (m == startMarker) { 279 seenStart = true; 280 } 281 if (seenStart) { 282 AudioMarker ma = (AudioMarker) m; // it must be an AudioMarker 283 if (ma.url().equals(url)) { 284 ma.adjustOffset(adjustment); 285 } 286 } 277 try { 278 URI uri = startMarker.url().toURI(); 279 for (Marker m : data) { 280 if (m == startMarker) { 281 seenStart = true; 282 } 283 if (seenStart && m instanceof AudioMarker) { 284 AudioMarker ma = (AudioMarker) m; 285 // Do not ever call URL.equals but use URI.equals instead to avoid Internet connection 286 // See http://michaelscharf.blogspot.fr/2006/11/javaneturlequals-and-hashcode-make.html for details 287 if (ma.url().toURI().equals(uri)) { 288 ma.adjustOffset(adjustment); 289 } 290 } 291 } 292 } catch (URISyntaxException e) { 293 Main.warn("URISyntaxException: "+e.getMessage()); 287 294 } 288 295 return true;
Note:
See TracChangeset
for help on using the changeset viewer.