Merge pull request #5513 from kellykelly3/5885-geolocation-suck-drag-cursor

5899 Fixing scrolling behavior on window reopen
This commit is contained in:
Richard Cordovano 2019-12-18 09:26:25 -05:00 committed by GitHub
commit b0f51c8ded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,8 @@ public final class GeolocationTopComponent extends TopComponent {
// This is the hardcoded report name from KMLReport.java // This is the hardcoded report name from KMLReport.java
private static final String REPORT_KML = "ReportKML.kml"; private static final String REPORT_KML = "ReportKML.kml";
private boolean mapInitalized = false;
@Messages({ @Messages({
"GLTopComponent_name=Geolocation", "GLTopComponent_name=Geolocation",
"GLTopComponent_initilzation_error=An error occurred during waypoint initilization. Geolocation data maybe incomplete." "GLTopComponent_initilzation_error=An error occurred during waypoint initilization. Geolocation data maybe incomplete."
@ -197,8 +199,12 @@ public final class GeolocationTopComponent extends TopComponent {
mapPanel.clearWaypoints(); mapPanel.clearWaypoints();
geoFilterPanel.clearDataSourceList(); geoFilterPanel.clearDataSourceList();
geoFilterPanel.updateDataSourceList(); geoFilterPanel.updateDataSourceList();
// Let's make sure we only do this on the first open
if (!mapInitalized) {
try { try {
mapPanel.initMap(); mapPanel.initMap();
mapInitalized = true;
} catch (GeoLocationDataException ex) { } catch (GeoLocationDataException ex) {
JOptionPane.showMessageDialog(this, JOptionPane.showMessageDialog(this,
Bundle.GeolocationTC_connection_failure_message(), Bundle.GeolocationTC_connection_failure_message(),
@ -210,6 +216,7 @@ public final class GeolocationTopComponent extends TopComponent {
logger.log(Level.SEVERE, ex.getMessage(), ex); logger.log(Level.SEVERE, ex.getMessage(), ex);
return; // Doen't set the waypoints. return; // Doen't set the waypoints.
} }
}
mapPanel.setWaypoints(new ArrayList<>()); mapPanel.setWaypoints(new ArrayList<>());
updateWaypoints(); updateWaypoints();
} }