From: activityworkshop Date: Wed, 13 Jan 2021 17:47:17 +0000 (+0100) Subject: Fix startup issues for 20.2 X-Git-Tag: v21.dev.fp1~30 X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=commitdiff_plain;h=7eed13875d7ee0495ebdef04a86c360216af3836 Fix startup issues for 20.2 --- diff --git a/src/tim/prune/copyright.txt b/src/tim/prune/copyright.txt index db7f2dd..76ebed3 100644 --- a/src/tim/prune/copyright.txt +++ b/src/tim/prune/copyright.txt @@ -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 diff --git a/src/tim/prune/function/ProjectPoint.java b/src/tim/prune/function/ProjectPoint.java index 10c0675..ccdc509 100644 --- a/src/tim/prune/function/ProjectPoint.java +++ b/src/tim/prune/function/ProjectPoint.java @@ -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), diff --git a/src/tim/prune/gui/profile/ProfileChart.java b/src/tim/prune/gui/profile/ProfileChart.java index 5d18e1e..95d8004 100644 --- a/src/tim/prune/gui/profile/ProfileChart.java +++ b/src/tim/prune/gui/profile/ProfileChart.java @@ -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());