|
|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
package seng302.Controllers;
|
|
|
|
|
|
|
|
|
|
import javafx.beans.property.StringProperty;
|
|
|
|
|
import javafx.collections.FXCollections;
|
|
|
|
|
import javafx.collections.ObservableList;
|
|
|
|
|
import javafx.fxml.FXML;
|
|
|
|
|
@ -9,7 +8,6 @@ import javafx.scene.control.TableView;
|
|
|
|
|
import javafx.scene.control.cell.PropertyValueFactory;
|
|
|
|
|
import javafx.scene.layout.GridPane;
|
|
|
|
|
import org.xml.sax.SAXException;
|
|
|
|
|
import seng302.Model.Boat;
|
|
|
|
|
import seng302.Model.BoatInRace;
|
|
|
|
|
import seng302.RaceXMLReader;
|
|
|
|
|
|
|
|
|
|
@ -25,11 +23,9 @@ public class StartController extends Controller {
|
|
|
|
|
|
|
|
|
|
@FXML private GridPane start;
|
|
|
|
|
|
|
|
|
|
@FXML TableView<BoatInRace> boatNameTable;
|
|
|
|
|
@FXML
|
|
|
|
|
TableColumn<BoatInRace, String> boatNameColumn;
|
|
|
|
|
@FXML
|
|
|
|
|
TableColumn<BoatInRace, String> boatCodeColumn;
|
|
|
|
|
@FXML private TableView<BoatInRace> boatNameTable;
|
|
|
|
|
@FXML private TableColumn<BoatInRace, String> boatNameColumn;
|
|
|
|
|
@FXML private TableColumn<BoatInRace, String> boatCodeColumn;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Begins the race with a scale factor of 15
|
|
|
|
|
@ -60,7 +56,7 @@ public class StartController extends Controller {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void initialize(URL location, ResourceBundle resources){
|
|
|
|
|
|
|
|
|
|
initialiseTables();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -81,7 +77,9 @@ public class StartController extends Controller {
|
|
|
|
|
BoatInRace[] boats = new BoatInRace[raceXMLReader.getBoats().size()];
|
|
|
|
|
boats = raceXMLReader.getBoats().toArray(boats);
|
|
|
|
|
ObservableList<BoatInRace> observableBoats = FXCollections.observableArrayList(boats);
|
|
|
|
|
|
|
|
|
|
boatNameTable.setItems(observableBoats);
|
|
|
|
|
boatNameColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
|
|
|
|
|
boatCodeColumn.setCellValueFactory(new PropertyValueFactory<>("abbrev"));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|