Changeset 31981 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-01-13T01:18:14+01:00 (9 years ago)
Author:
donvip
Message:

[josm_nanolog] update to JOSM 9383 + fix Eclipse warnings + fix NPE if nanolog layer is created first

Location:
applications/editors/josm/plugins/NanoLog
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/NanoLog/.settings/org.eclipse.jdt.core.prefs

    r30736 r31981  
    77org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
    88org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
     9org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
    910org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
     11org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
    1012org.eclipse.jdt.core.compiler.compliance=1.7
     13org.eclipse.jdt.core.compiler.debug.lineNumber=generate
     14org.eclipse.jdt.core.compiler.debug.localVariable=generate
     15org.eclipse.jdt.core.compiler.debug.sourceFile=generate
    1116org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    1217org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
     
    4045org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
    4146org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
    42 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
     47org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
    4348org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
    4449org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
     
    8186org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
    8287org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
     88org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
    8389org.eclipse.jdt.core.compiler.problem.unusedImport=warning
    8490org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
  • applications/editors/josm/plugins/NanoLog/build.xml

    r31923 r31981  
    55    <property name="commit.message" value="NanoLog"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="7299"/>
     7    <property name="plugin.main.version" value="9383"/>
    88    <property name="plugin.author" value="Ilya Zverev"/>
    99    <property name="plugin.class" value="nanolog.NanoLogPlugin"/>
  • applications/editors/josm/plugins/NanoLog/src/nanolog/Correlator.java

    r30836 r31981  
    33import static org.openstreetmap.josm.tools.I18n.tr;
    44
    5 import java.text.ParseException;
    65import java.util.ArrayList;
    76import java.util.Collections;
     
    1716import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
    1817import org.openstreetmap.josm.data.gpx.WayPoint;
    19 import org.openstreetmap.josm.tools.Geometry;
    20 import org.openstreetmap.josm.tools.date.PrimaryDateParser;
     18import org.openstreetmap.josm.tools.UncheckedParseException;
     19import org.openstreetmap.josm.tools.date.DateUtils;
    2120
    2221/**
     
    3332    public static long crudeMatch( List<NanoLogEntry> entries, GpxData data ) {
    3433        List<NanoLogEntry> sortedEntries = new ArrayList<>(entries);
    35         PrimaryDateParser dateParser = new PrimaryDateParser();
    3634        Collections.sort(sortedEntries);
    3735        long firstExifDate = sortedEntries.get(0).getTime().getTime();
     
    4745
    4846                    try {
    49                         firstGPXDate = dateParser.parse(curDateWpStr).getTime();
     47                        firstGPXDate = DateUtils.fromString(curDateWpStr).getTime();
    5048                        break outer;
    5149                    } catch( Exception e ) {
     
    8280        List<NanoLogEntry> sortedEntries = new ArrayList<>(entries);
    8381        //int ret = 0;
    84         PrimaryDateParser dateParser = new PrimaryDateParser();
    8582        Collections.sort(sortedEntries);
    8683        for( GpxTrack track : data.tracks ) {
     
    9491                    if( curWpTimeStr != null ) {
    9592                        try {
    96                             long curWpTime = dateParser.parse(curWpTimeStr).getTime() + offset;
     93                            long curWpTime = DateUtils.fromString(curWpTimeStr).getTime() + offset;
    9794                            /*ret +=*/ matchPoints(sortedEntries, prevWp, prevWpTime, curWp, curWpTime, offset);
    9895
     
    10097                            prevWpTime = curWpTime;
    10198
    102                         } catch( ParseException e ) {
     99                        } catch( UncheckedParseException e ) {
    103100                            Main.error("Error while parsing date \"" + curWpTimeStr + '"');
    104101                            Main.error(e);
     
    220217    public static long getGpxDate( GpxData data, LatLon pos ) {
    221218        EastNorth en = Main.getProjection().latlon2eastNorth(pos);
    222         PrimaryDateParser dateParser = new PrimaryDateParser();
    223219        for( GpxTrack track : data.tracks ) {
    224220            for( GpxTrackSegment segment : track.getSegments() ) {
     
    229225                    if( curWpTimeStr != null ) {
    230226                        try {
    231                             long curWpTime = dateParser.parse(curWpTimeStr).getTime();
     227                            long curWpTime = DateUtils.fromString(curWpTimeStr).getTime();
    232228                            if( prevWp != null ) {
    233229                                EastNorth c1 = Main.getProjection().latlon2eastNorth(prevWp.getCoor());
     
    249245                            prevWp = curWp;
    250246                            prevWpTime = curWpTime;
    251                         } catch( ParseException e ) {
     247                        } catch( UncheckedParseException e ) {
    252248                            Main.error("Error while parsing date \"" + curWpTimeStr + '"');
    253249                            Main.error(e);
  • applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogEntry.java

    r30701 r31981  
    2525        this.time = time;
    2626        this.message = message;
    27         this.direction = direction;
    2827    }
    2928
  • applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogLayer.java

    r30738 r31981  
    6262        selectedEntry = -1;
    6363        mouseListener = new NLLMouseAdapter();
     64    }
     65
     66    public void setupListeners() {
    6467        Main.map.mapView.addMouseListener(mouseListener);
    6568        Main.map.mapView.addMouseMotionListener(mouseListener);
  • applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogPlugin.java

    r30491 r31981  
    4848                        NanoLogLayer layer = new NanoLogLayer(entries);
    4949                        Main.main.addLayer(layer);
     50                        layer.setupListeners();
    5051                    }
    5152                } catch( IOException ex ) {
Note: See TracChangeset for help on using the changeset viewer.