|
|
|
|
@ -63,12 +63,12 @@ public class RaceController extends Controller{
|
|
|
|
|
* Updates the array listened by the TableView (boatInfoTable) that displays the boat information.
|
|
|
|
|
* @param race Race to listen to.
|
|
|
|
|
*/
|
|
|
|
|
public void updateInfoTable(Race race) {
|
|
|
|
|
public void setInfoTable(Race race) {
|
|
|
|
|
//boatInfoTable.getItems().clear();
|
|
|
|
|
boatInfoTable.setItems(race.getStartingBoats());
|
|
|
|
|
|
|
|
|
|
boatTeamColumn.setCellValueFactory(new PropertyValueFactory<BoatInRace,String>("Name"));
|
|
|
|
|
boatMarkColumn.setCellValueFactory(new PropertyValueFactory<BoatInRace, String>("CurrentLeg"));
|
|
|
|
|
boatTeamColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
|
|
|
|
|
boatMarkColumn.setCellValueFactory(cellData -> cellData.getValue().getCurrentLegName());
|
|
|
|
|
boatPlacingColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<BoatInRace, String>, ObservableValue<String>>() {
|
|
|
|
|
@Override
|
|
|
|
|
public ObservableValue<String> call(TableColumn.CellDataFeatures<BoatInRace, String> table) {
|
|
|
|
|
@ -77,10 +77,6 @@ public class RaceController extends Controller{
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void refreshTable(){
|
|
|
|
|
boatInfoTable.refresh();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void initialize(URL location, ResourceBundle resources) {
|
|
|
|
|
|
|
|
|
|
@ -118,18 +114,17 @@ public class RaceController extends Controller{
|
|
|
|
|
|
|
|
|
|
private BoatInRace[] generateAC35Competitors() {
|
|
|
|
|
|
|
|
|
|
BoatInRace boat1 = new BoatInRace("NZ", 500);
|
|
|
|
|
boat1.setColour(Color.DARKVIOLET);
|
|
|
|
|
boat1.setCurrentPosition(new GPSCoordinate(0, 0));
|
|
|
|
|
BoatInRace[] boats = new BoatInRace[6];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BoatInRace boat2 = new BoatInRace("TEST", 300);
|
|
|
|
|
boat2.setColour(Color.DARKRED);
|
|
|
|
|
boat2.setCurrentPosition(new GPSCoordinate(0, 0));
|
|
|
|
|
int i = 0;
|
|
|
|
|
for (BoatInRace boat : Constants.OFFICIAL_AC35_COMPETITORS) {
|
|
|
|
|
boat.setCurrentPosition(Constants.startLineMarker1);
|
|
|
|
|
boats[i] = boat;
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BoatInRace boat3 = new BoatInRace("TEST2", 350);
|
|
|
|
|
boat3.setColour(Color.FUCHSIA);
|
|
|
|
|
boat3.setCurrentPosition(new GPSCoordinate(0, 0));
|
|
|
|
|
return new BoatInRace[] {boat1, boat2, boat3};
|
|
|
|
|
return boats;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|