Reverted commits pushed to master accidentally

#story[875]
This commit is contained in:
Erika Savell
2017-05-25 01:23:44 +12:00
parent f0da2d4fee
commit e9f3467d97
7 changed files with 421 additions and 272 deletions
@@ -31,7 +31,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
private boolean annoAbbrev = true;
private boolean annoSpeed = true;
private boolean annoPath = true;
private boolean annoEstTime = true;
private boolean annoTimeSinceLastMark = true;
private List<Color> colours;
private final List<Marker> markers;
@@ -178,7 +177,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
* @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, String estTime, ZonedDateTime timeSinceLastMark) {
private void displayText(String name, String abbrev, double speed, GraphCoordinate coordinate, ZonedDateTime timeSinceLastMark) {
String text = "";
//Check name toggle value
if (annoName){
@@ -192,13 +191,10 @@ public class ResizableRaceCanvas extends ResizableCanvas {
if (annoSpeed){
text += String.format("%.2fkn ", speed);
}
if (annoEstTime) {
text += estTime;
}
//Check time since last mark toggle value
if(annoTimeSinceLastMark){
Duration timeSince = Duration.between(timeSinceLastMark, raceClock.getTime());
text += String.format(" %ds ", timeSince.getSeconds());
text += String.format("%d", timeSince.getSeconds());
}
//String text = String.format("%s, %2$.2fkn", name, speed);
long xCoord = coordinate.getX() + 20;
@@ -217,6 +213,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
*/
public void update() {
this.draw();
this.updateBoats();
}
/**
@@ -280,10 +277,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
annoPath = !annoPath;
}
public void toggleEstTime() {
annoEstTime = !annoEstTime;
}
/**
* Toggle boat time display in annotation
*/
@@ -327,7 +320,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
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.getFormattedEstTime(), boat.getTimeSinceLastMark());
displayText(boat.toString(), boat.getAbbrev(), boat.getVelocity(), this.map.convertGPS(boat.getCurrentPosition()), boat.getTimeSinceLastMark());
//TODO this needs to be fixed.
drawTrack(boat, boatColours.get(sourceID));
}