Changed it so Boat can be used as a superclass for StreamedBoat and BoatInRace properly and removed ConstantVelocityRace. Everything that used to use BoatInRace or StreamedBoat now uses it superclass (boat). #pair[jjg64, cbt24] #refactor #story[782]
This commit is contained in:
@@ -61,15 +61,15 @@ public class RaceController extends Controller {
|
||||
Button showSetAnno;
|
||||
|
||||
@FXML
|
||||
TableView<BoatInRace> boatInfoTable;
|
||||
TableView<Boat> boatInfoTable;
|
||||
@FXML
|
||||
TableColumn<BoatInRace, String> boatPlacingColumn;
|
||||
TableColumn<Boat, String> boatPlacingColumn;
|
||||
@FXML
|
||||
TableColumn<BoatInRace, String> boatTeamColumn;
|
||||
TableColumn<Boat, String> boatTeamColumn;
|
||||
@FXML
|
||||
TableColumn<BoatInRace, String> boatMarkColumn;
|
||||
TableColumn<Boat, String> boatMarkColumn;
|
||||
@FXML
|
||||
TableColumn<BoatInRace, String> boatSpeedColumn;
|
||||
TableColumn<Boat, String> boatSpeedColumn;
|
||||
|
||||
/**
|
||||
* Updates the ResizableRaceCanvas (raceMap) with most recent data
|
||||
@@ -77,7 +77,7 @@ public class RaceController extends Controller {
|
||||
* @param boats boats that are to be displayed in the race
|
||||
* @see ResizableRaceCanvas
|
||||
*/
|
||||
public void updateMap(ObservableList<BoatInRace> boats) {
|
||||
public void updateMap(ObservableList<Boat> boats) {
|
||||
raceMap.setBoats(boats);
|
||||
raceMap.update();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import org.xml.sax.SAXException;
|
||||
import seng302.Mock.*;
|
||||
import seng302.Model.BoatInRace;
|
||||
import seng302.Model.Boat;
|
||||
import seng302.Model.RaceClock;
|
||||
import seng302.RaceDataSource;
|
||||
import seng302.RaceXMLReader;
|
||||
@@ -34,9 +34,9 @@ public class StartController extends Controller {
|
||||
@FXML private GridPane start;
|
||||
@FXML private AnchorPane startWrapper;
|
||||
|
||||
@FXML private TableView<BoatInRace> boatNameTable;
|
||||
@FXML private TableColumn<BoatInRace, String> boatNameColumn;
|
||||
@FXML private TableColumn<BoatInRace, String> boatCodeColumn;
|
||||
@FXML private TableView<Boat> boatNameTable;
|
||||
@FXML private TableColumn<Boat, String> boatNameColumn;
|
||||
@FXML private TableColumn<Boat, String> boatCodeColumn;
|
||||
@FXML private Label timeZoneTime;
|
||||
@FXML private Label timer;
|
||||
@FXML private int PRERACE_TIME = 15000;
|
||||
@@ -107,8 +107,8 @@ public class StartController extends Controller {
|
||||
}
|
||||
|
||||
private void initialiseTables() {
|
||||
List<BoatInRace> boats = raceData.getBoats();
|
||||
ObservableList<BoatInRace> observableBoats = FXCollections.observableArrayList(boats);
|
||||
List<Boat> boats = raceData.getBoats();
|
||||
ObservableList<Boat> observableBoats = FXCollections.observableArrayList(boats);
|
||||
|
||||
boatNameTable.setItems(observableBoats);
|
||||
boatNameColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
|
||||
|
||||
Reference in New Issue
Block a user