added the ability to toggle the race guide line on and off

#story[1087]
This commit is contained in:
hba56
2017-08-10 12:17:19 +12:00
parent 74f04a13f8
commit 4da3734804
3 changed files with 36 additions and 9 deletions
@@ -40,6 +40,7 @@ public class Annotations {
private static String pathCheckAnno = "showBoatPath";
private static String timeCheckAnno = "showTime";
private static String estTimeCheckAnno = "showEstTime";
private static String guideLineAnno = "showGuideline";
// string values match the fx:id value of radio buttons
private static String noBtn = "noBtn";
@@ -160,6 +161,16 @@ public class Annotations {
raceMap.draw();
}
});
//listener to show estimated time for annotation
checkBoxes.get(guideLineAnno).selectedProperty()
.addListener((ov, old_val, new_val) -> {
if (old_val != new_val) {
raceMap.toggleGuideLine();
storeCurrentAnnotationState(guideLineAnno, new_val);
raceMap.draw();
}
});
}
/**
@@ -49,6 +49,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
private boolean annoPath = true;
private boolean annoEstTime = true;
private boolean annoTimeSinceLastMark = true;
private boolean annoGuideLine = false;
@@ -116,6 +117,13 @@ public class ResizableRaceCanvas extends ResizableCanvas {
annoSpeed = !annoSpeed;
}
/**
* Toggle the guideline annotation
*/
public void toggleGuideLine() {
annoGuideLine = !annoGuideLine;
}
@@ -470,7 +478,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
drawBoundary();
//Guiding Line
drawRaceLine();
if (annoGuideLine){
drawRaceLine();
}
//Boats.
drawBoats();