mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-29 08:56:43 +00:00
Bug 4551: extracted method to cancel the current fix position chooser +
cancel the associated notification, if it is still visible.
This commit is contained in:
+13
-8
@@ -739,10 +739,7 @@ public class EditMarkPositionPanel extends AbstractRaceChart<AbstractSettings> i
|
||||
}
|
||||
raceMap.unregisterAllCourseMarkInfoWindowClickHandlers();
|
||||
} else {
|
||||
if (currentFixPositionChooser != null) {
|
||||
currentFixPositionChooser.cancel();
|
||||
currentFixPositionChooser = null;
|
||||
}
|
||||
cancelFixPositionChooserAndNotification();
|
||||
marksPanel.deselectMark();
|
||||
selectedMark = null;
|
||||
if (sideBySideComponentViewer != null) {
|
||||
@@ -758,6 +755,17 @@ public class EditMarkPositionPanel extends AbstractRaceChart<AbstractSettings> i
|
||||
super.setVisible(visible);
|
||||
}
|
||||
|
||||
private void cancelFixPositionChooserAndNotification() {
|
||||
if (currentFixPositionChooser != null) {
|
||||
currentFixPositionChooser.cancel();
|
||||
currentFixPositionChooser = null;
|
||||
if (notificationTimer.isRunning()) {
|
||||
notificationTimer.run();
|
||||
notificationTimer.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkIfTracking(Runnable continuation) {
|
||||
if (nonTrackingWarningWasDisplayed) {
|
||||
continuation.run();
|
||||
@@ -864,10 +872,7 @@ public class EditMarkPositionPanel extends AbstractRaceChart<AbstractSettings> i
|
||||
|
||||
private void selectMark(MarkDTO mark) {
|
||||
if (selectedMark != mark) {
|
||||
if (currentFixPositionChooser != null) {
|
||||
currentFixPositionChooser.cancel();
|
||||
currentFixPositionChooser = null;
|
||||
}
|
||||
cancelFixPositionChooserAndNotification();
|
||||
}
|
||||
selectedMark = mark;
|
||||
if (selectedMark != null) {
|
||||
|
||||
Reference in New Issue
Block a user