fixed bug from merge where est time to next mark was null on some boats #story[923]

This commit is contained in:
Peter Galloway
2017-05-22 15:01:04 +12:00
parent e0750f5341
commit 0367805f0f
2 changed files with 9 additions and 6 deletions
@@ -58,10 +58,10 @@ public class StartScreenController implements Initializable {
contentPane.getChildren().addAll((Pane) FXMLLoader.load(getClass().getResource(jfxUrl))); contentPane.getChildren().addAll((Pane) FXMLLoader.load(getClass().getResource(jfxUrl)));
} }
catch(javafx.fxml.LoadException e){ catch(javafx.fxml.LoadException e){
System.err.println(e.getCause()); e.printStackTrace();
} }
catch(IOException e){ catch(IOException e){
System.err.println(e); e.printStackTrace();
} }
} }
+7 -4
View File
@@ -217,11 +217,14 @@ public class BoatGroup extends Group{
if (estTimeToNextMarkObject == null){ if (estTimeToNextMarkObject == null){
estTimeToNextMarkObject = getTextObject("", textColor); estTimeToNextMarkObject = getTextObject("", textColor);
} }
if (boat.getEstimateTimeAtNextMark() != null){
DateFormat format = new SimpleDateFormat("mm:ss"); DateFormat format = new SimpleDateFormat("mm:ss");
String timeToNextMark = format String timeToNextMark = format
.format(boat.getEstimateTimeAtNextMark() - StreamParser.getCurrentTimeLong()); .format(boat.getEstimateTimeAtNextMark() - StreamParser.getCurrentTimeLong());
estTimeToNextMarkObject.setText("Next mark: " + timeToNextMark); estTimeToNextMarkObject.setText("Next mark: " + timeToNextMark);
} else {
estTimeToNextMarkObject.setText("Next mark: -");
}
} }
/** /**