Changeset 31981 in osm for applications/editors/josm/plugins/NanoLog/src
- Timestamp:
- 2016-01-13T01:18:14+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/NanoLog/src/nanolog
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/NanoLog/src/nanolog/Correlator.java
r30836 r31981 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.text.ParseException;6 5 import java.util.ArrayList; 7 6 import java.util.Collections; … … 17 16 import org.openstreetmap.josm.data.gpx.GpxTrackSegment; 18 17 import org.openstreetmap.josm.data.gpx.WayPoint; 19 import org.openstreetmap.josm.tools. Geometry;20 import org.openstreetmap.josm.tools.date. PrimaryDateParser;18 import org.openstreetmap.josm.tools.UncheckedParseException; 19 import org.openstreetmap.josm.tools.date.DateUtils; 21 20 22 21 /** … … 33 32 public static long crudeMatch( List<NanoLogEntry> entries, GpxData data ) { 34 33 List<NanoLogEntry> sortedEntries = new ArrayList<>(entries); 35 PrimaryDateParser dateParser = new PrimaryDateParser();36 34 Collections.sort(sortedEntries); 37 35 long firstExifDate = sortedEntries.get(0).getTime().getTime(); … … 47 45 48 46 try { 49 firstGPXDate = dateParser.parse(curDateWpStr).getTime();47 firstGPXDate = DateUtils.fromString(curDateWpStr).getTime(); 50 48 break outer; 51 49 } catch( Exception e ) { … … 82 80 List<NanoLogEntry> sortedEntries = new ArrayList<>(entries); 83 81 //int ret = 0; 84 PrimaryDateParser dateParser = new PrimaryDateParser();85 82 Collections.sort(sortedEntries); 86 83 for( GpxTrack track : data.tracks ) { … … 94 91 if( curWpTimeStr != null ) { 95 92 try { 96 long curWpTime = dateParser.parse(curWpTimeStr).getTime() + offset;93 long curWpTime = DateUtils.fromString(curWpTimeStr).getTime() + offset; 97 94 /*ret +=*/ matchPoints(sortedEntries, prevWp, prevWpTime, curWp, curWpTime, offset); 98 95 … … 100 97 prevWpTime = curWpTime; 101 98 102 } catch( ParseException e ) { 99 } catch( UncheckedParseException e ) { 103 100 Main.error("Error while parsing date \"" + curWpTimeStr + '"'); 104 101 Main.error(e); … … 220 217 public static long getGpxDate( GpxData data, LatLon pos ) { 221 218 EastNorth en = Main.getProjection().latlon2eastNorth(pos); 222 PrimaryDateParser dateParser = new PrimaryDateParser();223 219 for( GpxTrack track : data.tracks ) { 224 220 for( GpxTrackSegment segment : track.getSegments() ) { … … 229 225 if( curWpTimeStr != null ) { 230 226 try { 231 long curWpTime = dateParser.parse(curWpTimeStr).getTime();227 long curWpTime = DateUtils.fromString(curWpTimeStr).getTime(); 232 228 if( prevWp != null ) { 233 229 EastNorth c1 = Main.getProjection().latlon2eastNorth(prevWp.getCoor()); … … 249 245 prevWp = curWp; 250 246 prevWpTime = curWpTime; 251 } catch( ParseException e ) { 247 } catch( UncheckedParseException e ) { 252 248 Main.error("Error while parsing date \"" + curWpTimeStr + '"'); 253 249 Main.error(e); -
applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogEntry.java
r30701 r31981 25 25 this.time = time; 26 26 this.message = message; 27 this.direction = direction;28 27 } 29 28 -
applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogLayer.java
r30738 r31981 62 62 selectedEntry = -1; 63 63 mouseListener = new NLLMouseAdapter(); 64 } 65 66 public void setupListeners() { 64 67 Main.map.mapView.addMouseListener(mouseListener); 65 68 Main.map.mapView.addMouseMotionListener(mouseListener); -
applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogPlugin.java
r30491 r31981 48 48 NanoLogLayer layer = new NanoLogLayer(entries); 49 49 Main.main.addLayer(layer); 50 layer.setupListeners(); 50 51 } 51 52 } catch( IOException ex ) {
Note:
See TracChangeset
for help on using the changeset viewer.