@ -2,7 +2,6 @@ package seng302.Controllers;
import javafx.beans.property.ReadOnlyObjectWrapper ;
import javafx.beans.property.ReadOnlyObjectWrapper ;
import javafx.beans.property.StringProperty ;
import javafx.beans.value.ObservableValue ;
import javafx.beans.value.ObservableValue ;
import javafx.collections.FXCollections ;
import javafx.collections.FXCollections ;
import javafx.collections.ObservableList ;
import javafx.collections.ObservableList ;
@ -40,7 +39,7 @@ public class RaceController extends Controller{
Label timer ;
Label timer ;
@FXML
@FXML
TableView boatInfoTable ;
TableView < BoatInRace > boatInfoTable ;
@FXML
@FXML
TableColumn < BoatInRace , String > boatPlacingColumn ;
TableColumn < BoatInRace , String > boatPlacingColumn ;
@FXML
@FXML
@ -65,7 +64,7 @@ public class RaceController extends Controller{
* @param race Race to listen to .
* @param race Race to listen to .
* /
* /
public void updateInfoTable ( Race race ) {
public void updateInfoTable ( Race race ) {
boatInfoTable . getItems ( ) . clear ( ) ;
//boatInfoTable.getItems().clear();
boatInfoTable . setItems ( race . getStartingBoats ( ) ) ;
boatInfoTable . setItems ( race . getStartingBoats ( ) ) ;
boatTeamColumn . setCellValueFactory ( new PropertyValueFactory < BoatInRace , String > ( "Name" ) ) ;
boatTeamColumn . setCellValueFactory ( new PropertyValueFactory < BoatInRace , String > ( "Name" ) ) ;
@ -78,6 +77,10 @@ public class RaceController extends Controller{
} ) ;
} ) ;
}
}
public void refreshTable ( ) {
boatInfoTable . refresh ( ) ;
}
@Override
@Override
public void initialize ( URL location , ResourceBundle resources ) {
public void initialize ( URL location , ResourceBundle resources ) {
@ -119,7 +122,7 @@ public class RaceController extends Controller{
boat1 . setColour ( Color . DARKVIOLET ) ;
boat1 . setColour ( Color . DARKVIOLET ) ;
boat1 . setCurrentPosition ( new GPSCoordinate ( 0 , 0 ) ) ;
boat1 . setCurrentPosition ( new GPSCoordinate ( 0 , 0 ) ) ;
BoatInRace boat2 = new BoatInRace ( "TEST" , 4 00) ;
BoatInRace boat2 = new BoatInRace ( "TEST" , 3 00) ;
boat2 . setColour ( Color . DARKRED ) ;
boat2 . setColour ( Color . DARKRED ) ;
boat2 . setCurrentPosition ( new GPSCoordinate ( 0 , 0 ) ) ;
boat2 . setCurrentPosition ( new GPSCoordinate ( 0 , 0 ) ) ;