Changeset 14456 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2018-11-27T21:40:10+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r14434 r14456 801 801 wpt.setTimeInMillis(time); 802 802 } else if (n.hasKey(GpxConstants.PT_TIME)) { 803 wpt.setTime (DateUtils.fromString(n.get(GpxConstants.PT_TIME)));803 wpt.setTimeInMillis(DateUtils.tsFromString(n.get(GpxConstants.PT_TIME))); 804 804 } else if (!n.isTimestampEmpty()) { 805 805 wpt.setTime(Integer.toUnsignedLong(n.getRawTimestamp())); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r14212 r14456 1230 1230 for (GpxTrackSegment segment : trk.getSegments()) { 1231 1231 for (WayPoint curWp : segment.getWayPoints()) { 1232 final Date parsedTime = curWp.setTimeFromAttribute(); 1233 if (parsedTime != null) { 1234 firstGPXDate = parsedTime.getTime(); 1232 if (curWp.hasDate()) { 1233 firstGPXDate = curWp.getTimeInMillis(); 1235 1234 break outer; 1236 1235 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r14451 r14456 509 509 continue; 510 510 } 511 if (oldWp != null && trkPnt. time > oldWp.time) {511 if (oldWp != null && trkPnt.getTimeInMillis() > oldWp.getTimeInMillis()) { 512 512 double vel = trkPnt.getCoor().greatCircleDistance(oldWp.getCoor()) 513 / (trkPnt. time - oldWp.time);513 / (trkPnt.getTime() - oldWp.getTime()); 514 514 velocities.add(vel); 515 515 } … … 587 587 switch (colored) { 588 588 case VELOCITY: 589 double dtime = trkPnt. time - oldWp.time;589 double dtime = trkPnt.getTime() - oldWp.getTime(); 590 590 if (dtime > 0) { 591 591 color = velocityScale.getColor(dist / dtime); … … 599 599 break; 600 600 case TIME: 601 double t = trkPnt. time;601 double t = trkPnt.getTime(); 602 602 // skip bad timestamps and very short tracks 603 603 if (t > 0 && t <= now && maxval - minval > minTrackDurationForTimeColoring) { -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r14302 r14456 150 150 for (GpxTrackSegment seg : track.getSegments()) { 151 151 for (WayPoint w : seg.getWayPoints()) { 152 firstTime = w. time;152 firstTime = w.getTime(); 153 153 break; 154 154 } … … 175 175 if (hasWaypoints && Config.getPref().getBoolean("marker.audiofromexplicitwaypoints", true)) { 176 176 for (WayPoint w : layer.data.waypoints) { 177 if (w. time> firstTime) {177 if (w.getTime() > firstTime) { 178 178 waypoints.add(w); 179 } else if (w. time> 0.0) {179 } else if (w.getTime() > 0.0) { 180 180 timedMarkersOmitted = true; 181 181 } … … 192 192 if (wNear != null) { 193 193 WayPoint wc = new WayPoint(w.getCoor()); 194 wc. time = wNear.time;194 wc.setTimeInMillis(wNear.getTimeInMillis()); 195 195 if (w.attr.containsKey(GpxConstants.GPX_NAME)) { 196 196 wc.put(GpxConstants.GPX_NAME, w.getString(GpxConstants.GPX_NAME)); … … 230 230 for (GpxTrackSegment seg : track.getSegments()) { 231 231 for (WayPoint w : seg.getWayPoints()) { 232 if (startTime < w. time) {232 if (startTime < w.getTime()) { 233 233 w2 = w; 234 234 break; … … 246 246 } else { 247 247 wayPointFromTimeStamp = new WayPoint(w1.getCoor().interpolate(w2.getCoor(), 248 (startTime - w1. time) / (w2.time - w1.time)));249 wayPointFromTimeStamp. time = startTime;248 (startTime - w1.getTime()) / (w2.getTime() - w1.getTime()))); 249 wayPointFromTimeStamp.setTimeInMillis((long) (startTime * 1000)); 250 250 String name = audioFile.getName(); 251 251 int dot = name.lastIndexOf('.'); … … 268 268 WayPoint wStart = new WayPoint(w.getCoor()); 269 269 wStart.put(GpxConstants.GPX_NAME, "start"); 270 wStart. time = w.time;270 wStart.setTimeInMillis(w.getTimeInMillis()); 271 271 waypoints.add(wStart); 272 272 gotOne = true; … … 284 284 285 285 // we must have got at least one waypoint now 286 ((ArrayList<WayPoint>) waypoints).sort( Comparator.comparingDouble(o -> o.time));286 ((ArrayList<WayPoint>) waypoints).sort((wp, other) -> wp.compareTo(other)); 287 287 288 288 firstTime = -1.0; // this time of the first waypoint, not first trackpoint 289 289 for (WayPoint w : waypoints) { 290 290 if (firstTime < 0.0) { 291 firstTime = w. time;292 } 293 double offset = w. time- firstTime;294 AudioMarker am = new AudioMarker(w.getCoor(), w, url, ml, w. time, offset);291 firstTime = w.getTime(); 292 } 293 double offset = w.getTime() - firstTime; 294 AudioMarker am = new AudioMarker(w.getCoor(), w, url, ml, w.getTime(), offset); 295 295 // timeFromAudio intended for future use to shift markers of this type on synchronization 296 296 if (w == wayPointFromTimeStamp) { -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
r14447 r14456 256 256 public WayPoint convertToWayPoint() { 257 257 WayPoint wpt = new WayPoint(getCoor()); 258 wpt.setTime ((long) (time*1000));258 wpt.setTimeInMillis((long) (time * 1000)); 259 259 if (text != null) { 260 260 wpt.addExtension("text", text); -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r14153 r14456 97 97 for (WayPoint wpt : indata.waypoints) { 98 98 /* calculate time differences in waypoints */ 99 double time = wpt. time;99 double time = wpt.getTime(); 100 100 boolean wptHasLink = wpt.attr.containsKey(GpxConstants.META_LINKS); 101 101 if (firstTime < 0 && wptHasLink) { -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
r14153 r14456 167 167 if (m instanceof AudioMarker) { 168 168 AudioMarker a = (AudioMarker) m; 169 if (a.time > cw. time) {169 if (a.time > cw.getTime()) { 170 170 break; 171 171 } … … 188 188 if (cw != null) { 189 189 setCoor(cw.getCoor()); 190 ca.play(cw. time- ca.time);190 ca.play(cw.getTime() - ca.time); 191 191 } 192 192 endDrag(false); … … 245 245 return; 246 246 } 247 ca = recent.parentLayer.addAudioMarker(cw. time, cw.getCoor());247 ca = recent.parentLayer.addAudioMarker(cw.getTime(), cw.getCoor()); 248 248 } 249 249 … … 330 330 for (GpxTrackSegment trackseg : track.getSegments()) { 331 331 for (WayPoint w: trackseg.getWayPoints()) { 332 if (audioTime < w. time) {332 if (audioTime < w.getTime()) { 333 333 w2 = w; 334 334 break; … … 350 350 w1.getEastNorth(ProjectionRegistry.getProjection()) : 351 351 w1.getEastNorth(ProjectionRegistry.getProjection()).interpolate(w2.getEastNorth(ProjectionRegistry.getProjection()), 352 (audioTime - w1. time)/(w2.time - w1.time)));352 (audioTime - w1.getTime())/(w2.getTime() - w1.getTime()))); 353 353 time = audioTime; 354 354 MapView mapView = MainApplication.getMap().mapView;
Note:
See TracChangeset
for help on using the changeset viewer.