|
|
|
|
@ -208,9 +208,15 @@ public class RaceController extends Controller {
|
|
|
|
|
public void initialiseInfoTable(VisualiserRaceEvent race) {
|
|
|
|
|
|
|
|
|
|
//Copy list of boats.
|
|
|
|
|
SortedList<VisualiserBoat> sortedBoats = new SortedList<>(race.getVisualiserRaceState().getBoats());
|
|
|
|
|
ObservableList<VisualiserBoat> boats = FXCollections.observableArrayList(race.getVisualiserRaceState().getBoats());
|
|
|
|
|
SortedList<VisualiserBoat> sortedBoats = new SortedList<>(boats);
|
|
|
|
|
sortedBoats.comparatorProperty().bind(boatInfoTable.comparatorProperty());
|
|
|
|
|
|
|
|
|
|
//Update copy when original changes.
|
|
|
|
|
race.getVisualiserRaceState().getBoats().addListener((ListChangeListener.Change<? extends VisualiserBoat> c) -> Platform.runLater(() -> {
|
|
|
|
|
boats.setAll(race.getVisualiserRaceState().getBoats());
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Set up table.
|
|
|
|
|
boatInfoTable.setItems(sortedBoats);
|
|
|
|
|
|