|
|
|
@ -12,6 +12,7 @@ import javafx.scene.control.TableColumn;
|
|
|
|
import javafx.scene.control.TableView;
|
|
|
|
import javafx.scene.control.TableView;
|
|
|
|
import javafx.scene.control.cell.PropertyValueFactory;
|
|
|
|
import javafx.scene.control.cell.PropertyValueFactory;
|
|
|
|
import javafx.scene.layout.AnchorPane;
|
|
|
|
import javafx.scene.layout.AnchorPane;
|
|
|
|
|
|
|
|
import javafx.scene.layout.GridPane;
|
|
|
|
import javafx.scene.paint.Color;
|
|
|
|
import javafx.scene.paint.Color;
|
|
|
|
import javafx.util.Callback;
|
|
|
|
import javafx.util.Callback;
|
|
|
|
import org.geotools.referencing.GeodeticCalculator;
|
|
|
|
import org.geotools.referencing.GeodeticCalculator;
|
|
|
|
@ -33,6 +34,9 @@ public class RaceController extends Controller{
|
|
|
|
@FXML
|
|
|
|
@FXML
|
|
|
|
AnchorPane canvasBase;
|
|
|
|
AnchorPane canvasBase;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
|
|
|
GridPane startScreen;
|
|
|
|
|
|
|
|
|
|
|
|
ResizableRaceCanvas raceMap;
|
|
|
|
ResizableRaceCanvas raceMap;
|
|
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
@FXML
|
|
|
|
@ -80,8 +84,9 @@ public class RaceController extends Controller{
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void initialize(URL location, ResourceBundle resources) {
|
|
|
|
@FXML
|
|
|
|
|
|
|
|
public void startRace() {
|
|
|
|
|
|
|
|
|
|
|
|
BoatInRace[] boats = generateAC35Competitors();
|
|
|
|
BoatInRace[] boats = generateAC35Competitors();
|
|
|
|
|
|
|
|
|
|
|
|
@ -92,13 +97,22 @@ public class RaceController extends Controller{
|
|
|
|
raceMap.drawRaceMap();
|
|
|
|
raceMap.drawRaceMap();
|
|
|
|
|
|
|
|
|
|
|
|
canvasBase.getChildren().add(raceMap);
|
|
|
|
canvasBase.getChildren().add(raceMap);
|
|
|
|
|
|
|
|
startScreen.setVisible(false);
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<Leg> legs = generateBermudaCourseLegs();
|
|
|
|
ArrayList<Leg> legs = generateBermudaCourseLegs();
|
|
|
|
ConstantVelocityRace race = new ConstantVelocityRace(boats, legs, this);
|
|
|
|
ConstantVelocityRace race = new ConstantVelocityRace(boats, legs, this);
|
|
|
|
|
|
|
|
raceMap.setVisible(true);
|
|
|
|
(new Thread(race)).start();
|
|
|
|
(new Thread(race)).start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void initialize(URL location, ResourceBundle resources) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Function for the Bermuda Race.
|
|
|
|
* Function for the Bermuda Race.
|
|
|
|
* @return legs in the Bermuda Race.
|
|
|
|
* @return legs in the Bermuda Race.
|
|
|
|
|