boats have an annotation beside them that shows time since last mark passed
#story[878]
This commit is contained in:
@@ -165,6 +165,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
* @param abbrev abbreviation of the boat name
|
||||
* @param speed speed of the boat
|
||||
* @param coordinate coordinate the text appears
|
||||
* @param timeSinceLastMark time since the last mark was passed
|
||||
*/
|
||||
private void displayText(String name, String abbrev, double speed, GraphCoordinate coordinate, ZonedDateTime timeSinceLastMark) {
|
||||
String text = "";
|
||||
@@ -178,7 +179,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
}
|
||||
//Check speed toggle value
|
||||
if (annoSpeed){
|
||||
text += String.format("%.2fkn", speed);
|
||||
text += String.format("%.2fkn ", speed);
|
||||
}
|
||||
//Check time since last mark toggle value
|
||||
if(annoTimeSinceLastMark){
|
||||
@@ -304,6 +305,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
}
|
||||
|
||||
if (raceAnno)
|
||||
if (Duration.between(boat.getTimeSinceLastMark(), raceClock.getTime()).getSeconds() < 0){
|
||||
boat.setTimeSinceLastMark(raceClock.getTime());
|
||||
}
|
||||
displayText(boat.toString(), boat.getAbbrev(), boat.getVelocity(), this.map.convertGPS(boat.getCurrentPosition()), boat.getTimeSinceLastMark());
|
||||
//TODO this needs to be fixed.
|
||||
drawTrack(boat, colours.get(currentColour));
|
||||
|
||||
Reference in New Issue
Block a user