]> gitweb.fperrin.net Git - GpsPrune.git/commitdiff
Fix startup issues for 20.2
authoractivityworkshop <mail@activityworkshop.net>
Wed, 13 Jan 2021 17:47:17 +0000 (18:47 +0100)
committeractivityworkshop <mail@activityworkshop.net>
Wed, 13 Jan 2021 17:47:17 +0000 (18:47 +0100)
src/tim/prune/copyright.txt
src/tim/prune/function/ProjectPoint.java
src/tim/prune/gui/profile/ProfileChart.java

index db7f2dd61157be5b834af0d2cb491708e8d806f4..76ebed3b59cefe58900fc1deb84d91c471e0009c 100644 (file)
@@ -1,4 +1,4 @@
-The source code of GpsPrune is copyright 2006-2020 activityworkshop.net
+The source code of GpsPrune is copyright 2006-2021 activityworkshop.net
 and is distributed under the terms of the Gnu GPL version 2.
 
 Portions of the package jpeg.drew were taken
index 10c067514da8e5ab74fa5cdadff931513bd61684..ccdc5090669926e055593e16f490665226c3dcfa 100644 (file)
@@ -202,7 +202,6 @@ public class ProjectPoint extends GenericFunction
                final double projectRads = Distance.convertDistanceToRadians(_distanceField.getValue(), distUnit);
                final double origLatRads = Math.toRadians(currPoint.getLatitude().getDouble());
                final double origLonRads = Math.toRadians(currPoint.getLongitude().getDouble());
-               System.out.println("Project from: " + origLatRads + ", " + origLonRads);
                final double bearingRads = Math.toRadians(_bearingField.getValue());
 
                double lat2 = Math.asin(Math.sin(origLatRads) * Math.cos(projectRads)
@@ -212,7 +211,6 @@ public class ProjectPoint extends GenericFunction
 
                double finalLatDeg = Math.toDegrees(lat2);
                double finalLonDeg = Math.toDegrees(lon2);
-               System.out.println("Result is: lat=" + finalLatDeg + ", lon=" + finalLonDeg);
 
                // Create point and append to track
                DataPoint point = new DataPoint(new Latitude(finalLatDeg, Coordinate.FORMAT_DEG),
index 5d18e1e9892b5c40f0fffca9338f8ecc4aca6f0d..95d800420f9d89231e15c2045a7411eb8acbe859 100644 (file)
@@ -382,6 +382,11 @@ public class ProfileChart extends GenericDisplay implements MouseListener
         */
        private synchronized void makePopup()
        {
+               if (_track.getNumPoints() < 1)
+               {
+                       _popup = null;
+                       return;
+               }
                _popup = new JPopupMenu();
                JMenuItem altItem = new JMenuItem(I18nManager.getText("fieldname.altitude"));
                altItem.addActionListener(new ActionListener() {
@@ -527,7 +532,7 @@ public class ProfileChart extends GenericDisplay implements MouseListener
                                }
                        }
                }
-               else
+               else if (_popup != null)
                {
                        // right clicks
                        _popup.show(this, e.getX(), e.getY());