Changeset 4282 in josm for trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
- Timestamp:
- 2011-08-07T09:08:29+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r4230 r4282 32 32 import org.openstreetmap.josm.data.coor.LatLon; 33 33 import org.openstreetmap.josm.data.gpx.GpxData; 34 import org.openstreetmap.josm.data.gpx.GpxLink;35 34 import org.openstreetmap.josm.data.gpx.WayPoint; 36 35 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; … … 72 71 this.fromLayer = fromLayer; 73 72 double firstTime = -1.0; 74 String lastLinkedFile = "";75 73 76 74 for (WayPoint wpt : indata.waypoints) { 77 /* calculate time differences in waypoints */78 75 double time = wpt.time; 79 boolean wpt_has_link = wpt.attr.containsKey(GpxData.META_LINKS); 80 if (firstTime < 0 && wpt_has_link) { 76 if (firstTime < 0) { 81 77 firstTime = time; 82 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get(GpxData.META_LINKS)) {83 lastLinkedFile = oneLink.uri;84 break;85 }86 }87 if (wpt_has_link) {88 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get(GpxData.META_LINKS)) {89 if (!oneLink.uri.equals(lastLinkedFile)) {90 firstTime = time;91 }92 lastLinkedFile = oneLink.uri;93 break;94 }95 78 } 96 79 Marker m = Marker.createMarker(wpt, indata.storageFile, this, time, time - firstTime); … … 274 257 tr("Error"), 275 258 JOptionPane.ERROR_MESSAGE 276 );259 ); 277 260 return null; 278 261 } 279 262 280 263 // make our new marker 281 AudioMarker newAudioMarker = AudioMarker.create(coor,282 AudioMarker.inventName(offset), AudioPlayer.url().toString(), this, time, offset);264 AudioMarker newAudioMarker = new AudioMarker(coor, 265 null, AudioPlayer.url(), this, time, offset); 283 266 284 267 // insert it at the right place in a copy the collection … … 425 408 tr("Warning"), 426 409 JOptionPane.WARNING_MESSAGE 427 );410 ); 428 411 return; 429 412 } … … 432 415 JOptionPane.showMessageDialog( 433 416 Main.parent, 434 tr("Audio synchronized at point {0}.", recent. text),417 tr("Audio synchronized at point {0}.", recent.getText()), 435 418 tr("Information"), 436 419 JOptionPane.INFORMATION_MESSAGE 437 );420 ); 438 421 } else { 439 422 JOptionPane.showMessageDialog( … … 442 425 tr("Error"), 443 426 JOptionPane.ERROR_MESSAGE 444 );427 ); 445 428 } 446 429 } … … 462 445 tr("Warning"), 463 446 JOptionPane.WARNING_MESSAGE 464 );447 ); 465 448 return; 466 449 }
Note:
See TracChangeset
for help on using the changeset viewer.