Display name of race in lobby.

- Moved Regatta properties and accessors to RegattaXMLReader
- StartController update now tolerates any permutation of types of XML messages

#story[782]
This commit is contained in:
Connor Taylor-Brown
2017-05-04 01:32:28 +12:00
parent 1723d0c27f
commit 7d81fc810c
5 changed files with 117 additions and 24 deletions
@@ -34,6 +34,7 @@ public class StartController extends Controller implements Observer {
@FXML private GridPane start;
@FXML private AnchorPane startWrapper;
@FXML private Label raceTitleLabel;
@FXML private TableView<Boat> boatNameTable;
@FXML private TableColumn<Boat, String> boatNameColumn;
@@ -140,15 +141,14 @@ public class StartController extends Controller implements Observer {
@Override
public void update(Observable o, Object arg) {
if(o instanceof StreamedCourse) {
if(((StreamedCourse) o).getBoats() != null) {
if(((StreamedCourse) o).hasReadBoats()) {
initialiseTables();
}
if (((StreamedCourse) o).getZonedDateTime() != null) {
Platform.runLater(() -> {
{
setRaceClock();
}
});
if(((StreamedCourse)o).hasReadRegatta()) {
Platform.runLater(() -> raceTitleLabel.setText(((StreamedCourse)o).getRegattaName()));
}
if (((StreamedCourse) o).hasReadCourse()) {
Platform.runLater(() -> setRaceClock());
}
}
}