Merge remote-tracking branch 'remotes/origin/master' into story77
# Conflicts: # racevisionGame/src/main/java/visualiser/Controllers/HostController.java # racevisionGame/src/main/java/visualiser/layout/Subject3D.java # racevisionGame/src/main/java/visualiser/layout/View3D.java # racevisionGame/src/main/resources/visualiser/scenes/hostlobby.fxml
This commit is contained in:
@@ -183,7 +183,7 @@ public class Event {
|
|||||||
public static String setRaceXMLAtCurrentTimeToNow(String raceXML) {
|
public static String setRaceXMLAtCurrentTimeToNow(String raceXML) {
|
||||||
|
|
||||||
//The start time is current time + 4 minutes. prestart is 3 minutes, and we add another minute.
|
//The start time is current time + 4 minutes. prestart is 3 minutes, and we add another minute.
|
||||||
long millisecondsToAdd = Constants.RacePreStartTime + (1 * 60 * 1000);
|
long millisecondsToAdd = Constants.RacePreStartTime + Constants.RacePreparatoryTime;
|
||||||
long secondsToAdd = millisecondsToAdd / 1000;
|
long secondsToAdd = millisecondsToAdd / 1000;
|
||||||
//Scale the time using our time scalar.
|
//Scale the time using our time scalar.
|
||||||
secondsToAdd = secondsToAdd / Constants.RaceTimeScale;
|
secondsToAdd = secondsToAdd / Constants.RaceTimeScale;
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ public class RaceXMLCreator {
|
|||||||
public static void setRaceXMLAtCurrentTimeToNow(XMLRace raceXML) {
|
public static void setRaceXMLAtCurrentTimeToNow(XMLRace raceXML) {
|
||||||
|
|
||||||
//The start time is current time + 4 minutes. prestart is 3 minutes, and we add another minute.
|
//The start time is current time + 4 minutes. prestart is 3 minutes, and we add another minute.
|
||||||
long millisecondsToAdd = Constants.RacePreStartTime + (1 * 60 * 1000);
|
long millisecondsToAdd = Constants.RacePreStartTime + Constants.RacePreparatoryTime;
|
||||||
long secondsToAdd = millisecondsToAdd / 1000;
|
long secondsToAdd = millisecondsToAdd / 1000;
|
||||||
//Scale the time using our time scalar.
|
//Scale the time using our time scalar.
|
||||||
secondsToAdd = secondsToAdd / Constants.RaceTimeScale;
|
secondsToAdd = secondsToAdd / Constants.RaceTimeScale;
|
||||||
|
|||||||
@@ -36,15 +36,18 @@ public class Constants {
|
|||||||
public static final int RaceTimeScale = 2;//10;
|
public static final int RaceTimeScale = 2;//10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The race pre-start time, in milliseconds. 3 minutes.
|
* The race pre-start time, in milliseconds. 3 minutes (30 seconds for development).
|
||||||
*/
|
*/
|
||||||
public static final long RacePreStartTime = 3 * 60 * 1000;
|
// public static final long RacePreStartTime = 30 * 1000;
|
||||||
|
public static final long RacePreStartTime = 1000;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The race preparatory time, in milliseconds. 1 minute.
|
* The race preparatory time, in milliseconds. 1 minute.
|
||||||
*/
|
*/
|
||||||
public static final long RacePreparatoryTime = 1 * 60 * 1000;
|
// public static final long RacePreparatoryTime = 60 * 1000;
|
||||||
|
public static final long RacePreparatoryTime = 3 * 1000;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package visualiser.Controllers;
|
package visualiser.Controllers;
|
||||||
|
|
||||||
|
import com.interactivemesh.jfx.importer.stl.StlMeshImporter;
|
||||||
import javafx.animation.AnimationTimer;
|
import javafx.animation.AnimationTimer;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
@@ -12,17 +12,25 @@ import javafx.scene.chart.LineChart;
|
|||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
import javafx.scene.input.KeyCode;
|
import javafx.scene.input.KeyCode;
|
||||||
import javafx.scene.input.KeyEvent;
|
import javafx.scene.input.KeyEvent;
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.input.ScrollEvent;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.scene.layout.Pane;
|
|
||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
|
import javafx.scene.shape.MeshView;
|
||||||
|
import javafx.scene.shape.Sphere;
|
||||||
|
import javafx.scene.transform.Translate;
|
||||||
import javafx.util.Callback;
|
import javafx.util.Callback;
|
||||||
import network.Messages.Enums.RaceStatusEnum;
|
import network.Messages.Enums.RaceStatusEnum;
|
||||||
|
import shared.dataInput.RaceDataSource;
|
||||||
import shared.model.Leg;
|
import shared.model.Leg;
|
||||||
|
import shared.model.Mark;
|
||||||
import visualiser.app.App;
|
import visualiser.app.App;
|
||||||
import visualiser.gameController.ControllerClient;
|
import visualiser.gameController.ControllerClient;
|
||||||
import visualiser.gameController.Keys.ControlKey;
|
import visualiser.gameController.Keys.ControlKey;
|
||||||
|
import visualiser.gameController.Keys.KeyFactory;
|
||||||
|
import visualiser.layout.Subject3D;
|
||||||
|
import visualiser.layout.View3D;
|
||||||
import visualiser.model.*;
|
import visualiser.model.*;
|
||||||
|
import visualiser.utils.GPSConverter;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@@ -38,53 +46,34 @@ import static visualiser.app.App.keyFactory;
|
|||||||
* Controller used to display a running race.
|
* Controller used to display a running race.
|
||||||
*/
|
*/
|
||||||
public class RaceController extends Controller {
|
public class RaceController extends Controller {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The race object which describes the currently occurring race.
|
* The race object which describes the currently occurring race.
|
||||||
*/
|
*/
|
||||||
private VisualiserRaceEvent visualiserRace;
|
private VisualiserRaceEvent visualiserRace;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service for sending keystrokes to server
|
* Service for sending keystrokes to server
|
||||||
*/
|
*/
|
||||||
private ControllerClient controllerClient;
|
private ControllerClient controllerClient;
|
||||||
|
|
||||||
|
|
||||||
private boolean isHost;
|
private boolean isHost;
|
||||||
|
|
||||||
/**
|
|
||||||
* The canvas that draws the race.
|
|
||||||
*/
|
|
||||||
private ResizableRaceCanvas raceCanvas;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The sparkline graph.
|
|
||||||
*/
|
|
||||||
private Sparkline sparkline;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* state of the info table
|
* state of the info table
|
||||||
*/
|
*/
|
||||||
private boolean infoTableShow;
|
private boolean infoTableShow;
|
||||||
|
|
||||||
|
private View3D view3D;
|
||||||
|
private ObservableList<Subject3D> viewSubjects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The arrow controller.
|
* The arrow controller.
|
||||||
*/
|
*/
|
||||||
@FXML private ArrowController arrowController;
|
@FXML private ArrowController arrowController;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@FXML private GridPane canvasBase;
|
@FXML private GridPane canvasBase;
|
||||||
|
|
||||||
|
@FXML private SplitPane racePane;
|
||||||
@FXML private SplitPane race;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the root node of the arrow control.
|
|
||||||
*/
|
|
||||||
@FXML private Pane arrow;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the pane we place the actual arrow control inside of.
|
* This is the pane we place the actual arrow control inside of.
|
||||||
@@ -100,9 +89,6 @@ public class RaceController extends Controller {
|
|||||||
@FXML private TableColumn<VisualiserBoat, Leg> boatMarkColumn;
|
@FXML private TableColumn<VisualiserBoat, Leg> boatMarkColumn;
|
||||||
@FXML private TableColumn<VisualiserBoat, Number> boatSpeedColumn;
|
@FXML private TableColumn<VisualiserBoat, Number> boatSpeedColumn;
|
||||||
@FXML private LineChart<Number, Number> sparklineChart;
|
@FXML private LineChart<Number, Number> sparklineChart;
|
||||||
@FXML private AnchorPane annotationPane;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ctor.
|
* Ctor.
|
||||||
@@ -112,11 +98,10 @@ public class RaceController extends Controller {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL location, ResourceBundle resources) {
|
public void initialize(URL location, ResourceBundle resources) {
|
||||||
// KeyFactory keyFactory = KeyFactory.getFactory();
|
|
||||||
infoTableShow = true;
|
infoTableShow = true;
|
||||||
|
|
||||||
// Initialise keyboard handler
|
// Initialise keyboard handler
|
||||||
race.addEventFilter(KeyEvent.KEY_PRESSED, event -> {
|
racePane.addEventFilter(KeyEvent.KEY_PRESSED, event -> {
|
||||||
String codeString = event.getCode().toString();
|
String codeString = event.getCode().toString();
|
||||||
|
|
||||||
if (codeString.equals("TAB")){toggleTable();}
|
if (codeString.equals("TAB")){toggleTable();}
|
||||||
@@ -142,7 +127,7 @@ public class RaceController extends Controller {
|
|||||||
Optional<ButtonType> result = alert.showAndWait();
|
Optional<ButtonType> result = alert.showAndWait();
|
||||||
if (result.get() == ButtonType.OK) {
|
if (result.get() == ButtonType.OK) {
|
||||||
parent.endEvent();
|
parent.endEvent();
|
||||||
race.setVisible(false);
|
racePane.setVisible(false);
|
||||||
App.app.showMainStage(App.getStage());
|
App.app.showMainStage(App.getStage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -151,7 +136,7 @@ public class RaceController extends Controller {
|
|||||||
alert.setContentText("Do you wish to quit the race?");
|
alert.setContentText("Do you wish to quit the race?");
|
||||||
Optional<ButtonType> result = alert.showAndWait();
|
Optional<ButtonType> result = alert.showAndWait();
|
||||||
if (result.get() == ButtonType.OK) {
|
if (result.get() == ButtonType.OK) {
|
||||||
race.setVisible(false);
|
racePane.setVisible(false);
|
||||||
App.app.showMainStage(App.getStage());
|
App.app.showMainStage(App.getStage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,14 +160,10 @@ public class RaceController extends Controller {
|
|||||||
//Information table.
|
//Information table.
|
||||||
initialiseInfoTable(this.visualiserRace);
|
initialiseInfoTable(this.visualiserRace);
|
||||||
|
|
||||||
//Sparkline.
|
|
||||||
initialiseSparkline(this.visualiserRace);
|
|
||||||
|
|
||||||
//Arrow.
|
//Arrow.
|
||||||
initialiseArrow(this.visualiserRace);
|
initialiseArrow(this.visualiserRace);
|
||||||
|
|
||||||
//Race canvas.
|
initialiseView3D(this.visualiserRace);
|
||||||
initialiseRaceCanvas(this.visualiserRace);
|
|
||||||
|
|
||||||
//Race timezone label.
|
//Race timezone label.
|
||||||
initialiseRaceTimezoneLabel(this.visualiserRace);
|
initialiseRaceTimezoneLabel(this.visualiserRace);
|
||||||
@@ -190,11 +171,79 @@ public class RaceController extends Controller {
|
|||||||
//Race clock.
|
//Race clock.
|
||||||
initialiseRaceClock(this.visualiserRace);
|
initialiseRaceClock(this.visualiserRace);
|
||||||
|
|
||||||
|
|
||||||
//Start the race animation timer.
|
//Start the race animation timer.
|
||||||
raceTimer();
|
raceTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initialiseView3D(VisualiserRaceEvent race) {
|
||||||
|
viewSubjects = FXCollections.observableArrayList();
|
||||||
|
|
||||||
|
// Import boat mesh
|
||||||
|
URL asset = HostController.class.getClassLoader().getResource("assets/V1.2 Complete Boat.stl");
|
||||||
|
StlMeshImporter importer = new StlMeshImporter();
|
||||||
|
importer.read(asset);
|
||||||
|
|
||||||
|
// Configure camera angles and control
|
||||||
|
view3D = new View3D();
|
||||||
|
view3D.setDistance(1050);
|
||||||
|
view3D.setYaw(0);
|
||||||
|
view3D.setPitch(60);
|
||||||
|
view3D.enableTracking();
|
||||||
|
canvasBase.add(view3D, 0, 0);
|
||||||
|
|
||||||
|
// Set up projection from GPS to view
|
||||||
|
RaceDataSource raceData = visualiserRace.getVisualiserRaceState().getRaceDataSource();
|
||||||
|
final GPSConverter gpsConverter = new GPSConverter(raceData, 450, 450);
|
||||||
|
|
||||||
|
view3D.setItems(viewSubjects);
|
||||||
|
// Position and add each mark to view
|
||||||
|
for(Mark mark: race.getVisualiserRaceState().getMarks()) {
|
||||||
|
Subject3D subject = new Subject3D(new Sphere(2));
|
||||||
|
subject.setX(gpsConverter.convertGPS(mark.getPosition()).getX());
|
||||||
|
subject.setZ(gpsConverter.convertGPS(mark.getPosition()).getY());
|
||||||
|
|
||||||
|
viewSubjects.add(subject);
|
||||||
|
}
|
||||||
|
// Position and add each boat to view
|
||||||
|
for(VisualiserBoat boat: race.getVisualiserRaceState().getBoats()) {
|
||||||
|
MeshView mesh = new MeshView(importer.getImport());
|
||||||
|
Subject3D subject = new Subject3D(mesh);
|
||||||
|
viewSubjects.add(subject);
|
||||||
|
|
||||||
|
// Track this boat's movement with the new subject
|
||||||
|
AnimationTimer trackBoat = new AnimationTimer() {
|
||||||
|
@Override
|
||||||
|
public void handle(long now) {
|
||||||
|
subject.setHeading(boat.getBearing().degrees());
|
||||||
|
subject.setX(gpsConverter.convertGPS(boat.getPosition()).getX());
|
||||||
|
subject.setZ(gpsConverter.convertGPS(boat.getPosition()).getY());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
trackBoat.start();
|
||||||
|
}
|
||||||
|
// Fix initial bird's-eye position
|
||||||
|
view3D.updatePivot(new Translate(250, 0, 210));
|
||||||
|
|
||||||
|
// Bind zooming to scrolling
|
||||||
|
view3D.setOnScroll(e -> {
|
||||||
|
view3D.updateDistance(e.getDeltaY());
|
||||||
|
});
|
||||||
|
|
||||||
|
// Bind zooming to keypress (Z/X default)
|
||||||
|
racePane.addEventFilter(KeyEvent.KEY_PRESSED, e -> {
|
||||||
|
ControlKey key = keyFactory.getKey(e.getCode().toString());
|
||||||
|
if(key != null) {
|
||||||
|
switch (key.toString()) {
|
||||||
|
case "Zoom In":
|
||||||
|
view3D.updateDistance(-10);
|
||||||
|
break;
|
||||||
|
case "Zoom Out":
|
||||||
|
view3D.updateDistance(10);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -337,42 +386,8 @@ public class RaceController extends Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialises the {@link Sparkline}, and listens to a specified {@link VisualiserRaceEvent}.
|
* Initialises the race time zone label with the race's time zone.
|
||||||
* @param race The race to listen to.
|
|
||||||
*/
|
|
||||||
private void initialiseSparkline(VisualiserRaceEvent race) {
|
|
||||||
//The race.getBoats() we are passing in is sorted by position in race inside the race class.
|
|
||||||
this.sparkline = new Sparkline(this.visualiserRace.getVisualiserRaceState(), this.sparklineChart);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialises the {@link ResizableRaceCanvas}, provides the race to read data from.
|
|
||||||
* @param race Race to read data from.
|
|
||||||
*/
|
|
||||||
private void initialiseRaceCanvas(VisualiserRaceEvent race) {
|
|
||||||
|
|
||||||
//Create canvas.
|
|
||||||
raceCanvas = new ResizableRaceCanvas(race.getVisualiserRaceState());
|
|
||||||
|
|
||||||
//Set properties.
|
|
||||||
raceCanvas.setMouseTransparent(true);
|
|
||||||
raceCanvas.widthProperty().bind(canvasBase.widthProperty());
|
|
||||||
raceCanvas.heightProperty().bind(canvasBase.heightProperty());
|
|
||||||
|
|
||||||
//Draw it and show it.
|
|
||||||
raceCanvas.draw();
|
|
||||||
raceCanvas.setVisible(true);
|
|
||||||
|
|
||||||
//Add to scene.
|
|
||||||
canvasBase.getChildren().add(0, raceCanvas);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Intialises the race time zone label with the race's time zone.
|
|
||||||
* @param race The race to get time zone from.
|
* @param race The race to get time zone from.
|
||||||
*/
|
*/
|
||||||
private void initialiseRaceTimezoneLabel(VisualiserRaceEvent race) {
|
private void initialiseRaceTimezoneLabel(VisualiserRaceEvent race) {
|
||||||
@@ -410,11 +425,7 @@ public class RaceController extends Controller {
|
|||||||
initialiseRace();
|
initialiseRace();
|
||||||
|
|
||||||
//Display this controller.
|
//Display this controller.
|
||||||
race.setVisible(true);
|
racePane.setVisible(true);
|
||||||
|
|
||||||
|
|
||||||
// set up annotation displays
|
|
||||||
new Annotations(annotationPane, raceCanvas);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -422,7 +433,7 @@ public class RaceController extends Controller {
|
|||||||
* @param boats boats there are in the race.
|
* @param boats boats there are in the race.
|
||||||
*/
|
*/
|
||||||
public void finishRace(ObservableList<VisualiserBoat> boats) {
|
public void finishRace(ObservableList<VisualiserBoat> boats) {
|
||||||
race.setVisible(false);
|
racePane.setVisible(false);
|
||||||
parent.enterFinish(boats);
|
parent.enterFinish(boats);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -457,18 +468,13 @@ public class RaceController extends Controller {
|
|||||||
finishRace(visualiserRace.getVisualiserRaceState().getBoats());
|
finishRace(visualiserRace.getVisualiserRaceState().getBoats());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//Otherwise, render the canvas.
|
|
||||||
raceCanvas.drawRace();
|
|
||||||
|
|
||||||
|
|
||||||
//Sort the tableview. Doesn't automatically work for all columns.
|
//Sort the tableview. Doesn't automatically work for all columns.
|
||||||
boatInfoTable.sort();
|
boatInfoTable.sort();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Return to main screen if we lose connection.
|
//Return to main screen if we lose connection.
|
||||||
if (!visualiserRace.getServerConnection().isAlive()) {
|
if (!visualiserRace.getServerConnection().isAlive()) {
|
||||||
race.setVisible(false);
|
racePane.setVisible(false);
|
||||||
//parent.enterTitle();
|
//parent.enterTitle();
|
||||||
try {
|
try {
|
||||||
App.app.showMainStage(App.getStage());
|
App.app.showMainStage(App.getStage());
|
||||||
@@ -490,10 +496,10 @@ public class RaceController extends Controller {
|
|||||||
* toggles if the info table is shown
|
* toggles if the info table is shown
|
||||||
*/
|
*/
|
||||||
private void toggleTable() {
|
private void toggleTable() {
|
||||||
double tablePercent = 1 - (boatPlacingColumn.getPrefWidth() + boatTeamColumn.getPrefWidth() + boatMarkColumn.getPrefWidth() + boatSpeedColumn.getPrefWidth())/race.getWidth();
|
double tablePercent = 1 - (boatPlacingColumn.getPrefWidth() + boatTeamColumn.getPrefWidth() + boatMarkColumn.getPrefWidth() + boatSpeedColumn.getPrefWidth())/racePane.getWidth();
|
||||||
|
|
||||||
if (infoTableShow){
|
if (infoTableShow){
|
||||||
race.setDividerPositions(tablePercent);
|
racePane.setDividerPositions(tablePercent);
|
||||||
|
|
||||||
arrowPane.setScaleX(0.5);
|
arrowPane.setScaleX(0.5);
|
||||||
arrowPane.setScaleY(0.5);
|
arrowPane.setScaleY(0.5);
|
||||||
@@ -501,7 +507,7 @@ public class RaceController extends Controller {
|
|||||||
arrowPane.setTranslateY(0 - arrowPane.getScene().getHeight()/4);
|
arrowPane.setTranslateY(0 - arrowPane.getScene().getHeight()/4);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
race.setDividerPositions(1);
|
racePane.setDividerPositions(1);
|
||||||
|
|
||||||
arrowPane.setScaleX(1);
|
arrowPane.setScaleX(1);
|
||||||
arrowPane.setScaleY(1);
|
arrowPane.setScaleY(1);
|
||||||
|
|||||||
@@ -225,12 +225,10 @@ public class StartController extends Controller {
|
|||||||
//Get the current race status.
|
//Get the current race status.
|
||||||
RaceStatusEnum raceStatus = visualiserRaceEvent.getVisualiserRaceState().getRaceStatusEnum();
|
RaceStatusEnum raceStatus = visualiserRaceEvent.getVisualiserRaceState().getRaceStatusEnum();
|
||||||
|
|
||||||
//Display it.
|
|
||||||
raceStatusLabel.setText("Race Status: " + raceStatus.name());
|
|
||||||
|
|
||||||
|
|
||||||
//If the race has reached the preparatory phase, or has started...
|
//If the race has reached the preparatory phase, or has started...
|
||||||
if (raceStatus == RaceStatusEnum.PREPARATORY || raceStatus == RaceStatusEnum.STARTED) {
|
if (raceStatus == RaceStatusEnum.WARNING
|
||||||
|
|| raceStatus == RaceStatusEnum.PREPARATORY
|
||||||
|
|| raceStatus == RaceStatusEnum.STARTED) {
|
||||||
//Stop this timer.
|
//Stop this timer.
|
||||||
stop();
|
stop();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package visualiser.gameController.Keys;
|
package visualiser.gameController.Keys;
|
||||||
|
|
||||||
import javafx.scene.input.KeyCode;
|
|
||||||
import network.Messages.Enums.BoatActionEnum;
|
import network.Messages.Enums.BoatActionEnum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,7 +44,7 @@ public abstract class ControlKey {
|
|||||||
/**
|
/**
|
||||||
* What this key should do when the command is issued for it to do its job.
|
* What this key should do when the command is issued for it to do its job.
|
||||||
*/
|
*/
|
||||||
public abstract void onAction();//may want to make it take in a visualiser and stuff in the future.
|
public abstract void onAction();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* What to do when the key is held
|
* What to do when the key is held
|
||||||
|
|||||||
@@ -33,9 +33,6 @@ public class Subject3D {
|
|||||||
this.heading = new Rotate(0, Rotate.Y_AXIS);
|
this.heading = new Rotate(0, Rotate.Y_AXIS);
|
||||||
|
|
||||||
this.mesh.getTransforms().addAll(position, heading, new Rotate(90, Rotate.X_AXIS), new Rotate(180, Rotate.Y_AXIS));
|
this.mesh.getTransforms().addAll(position, heading, new Rotate(90, Rotate.X_AXIS), new Rotate(180, Rotate.Y_AXIS));
|
||||||
this.position.xProperty().addListener(((observable, oldValue, newValue) -> System.out.println("Boat x: " + newValue)));
|
|
||||||
this.position.yProperty().addListener(((observable, oldValue, newValue) -> System.out.println("Boat y: " + newValue)));
|
|
||||||
this.position.zProperty().addListener(((observable, oldValue, newValue) -> System.out.println("Boat z: " + newValue)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Shape3D getMesh() {
|
public Shape3D getMesh() {
|
||||||
@@ -46,6 +43,10 @@ public class Subject3D {
|
|||||||
return this.position;
|
return this.position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Rotate getHeading() {
|
||||||
|
return heading;
|
||||||
|
}
|
||||||
|
|
||||||
public void setX(double x) {
|
public void setX(double x) {
|
||||||
position.setX(x);
|
position.setX(x);
|
||||||
}
|
}
|
||||||
@@ -58,11 +59,7 @@ public class Subject3D {
|
|||||||
position.setZ(z);
|
position.setZ(z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getHeading() {
|
|
||||||
return heading.getAngle();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeading(double angle) {
|
public void setHeading(double angle) {
|
||||||
heading.setAngle(angle);
|
heading.setAngle(angle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,161 +1,7 @@
|
|||||||
package visualiser.layout;
|
package visualiser.layout;
|
||||||
|
|
||||||
import javafx.collections.ListChangeListener;
|
|
||||||
import javafx.collections.ObservableList;
|
|
||||||
import javafx.geometry.Point3D;
|
|
||||||
import javafx.scene.Group;
|
|
||||||
import javafx.scene.PerspectiveCamera;
|
|
||||||
import javafx.scene.SubScene;
|
|
||||||
import javafx.scene.layout.Pane;
|
|
||||||
import javafx.scene.paint.Color;
|
|
||||||
import javafx.scene.shape.Shape3D;
|
|
||||||
import javafx.scene.transform.Rotate;
|
|
||||||
import javafx.scene.transform.Translate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Control for rendering 3D objects visible through a PerspectiveCamera. Implements Adapter Pattern to
|
* Created by hba56 on 9/09/17.
|
||||||
* interface with camera, and allows clients to add shapes to the scene. All scenes contain sea plane and
|
|
||||||
* sky box, whose textures are set with special methods.
|
|
||||||
*/
|
*/
|
||||||
public class View3D extends Pane {
|
public class View3D {
|
||||||
/**
|
}
|
||||||
* Observable list of renderable items
|
|
||||||
*/
|
|
||||||
private ObservableList<Subject3D> items;
|
|
||||||
/**
|
|
||||||
* Rendering container for shapes
|
|
||||||
*/
|
|
||||||
private Group world;
|
|
||||||
/**
|
|
||||||
* Near limit of view frustum
|
|
||||||
*/
|
|
||||||
private double nearClip;
|
|
||||||
/**
|
|
||||||
* Far limit of view frustum
|
|
||||||
*/
|
|
||||||
private double farClip;
|
|
||||||
/**
|
|
||||||
* Camera origin
|
|
||||||
*/
|
|
||||||
private Translate pivot;
|
|
||||||
/**
|
|
||||||
* Distance of camera from pivot point
|
|
||||||
*/
|
|
||||||
private Translate distance;
|
|
||||||
/**
|
|
||||||
* Angle along ground between z-axis and camera
|
|
||||||
*/
|
|
||||||
private Rotate yaw;
|
|
||||||
/**
|
|
||||||
* Angle between ground plane and camera direction
|
|
||||||
*/
|
|
||||||
private Rotate pitch;
|
|
||||||
|
|
||||||
private PerspectiveCamera camera;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor for View3D. Sets up Scene and PerspectiveCamera.
|
|
||||||
*/
|
|
||||||
public View3D() {
|
|
||||||
world = new Group();
|
|
||||||
|
|
||||||
SubScene scene = new SubScene(world, 300, 300);
|
|
||||||
scene.widthProperty().bind(this.widthProperty());
|
|
||||||
scene.heightProperty().bind(this.heightProperty());
|
|
||||||
scene.setFill(new Color(0.2, 0.6, 1, 1));
|
|
||||||
|
|
||||||
scene.setCamera(buildCamera());
|
|
||||||
|
|
||||||
this.getChildren().add(scene);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets up camera view frustum and binds transformations
|
|
||||||
* @return perspective camera
|
|
||||||
*/
|
|
||||||
private PerspectiveCamera buildCamera() {
|
|
||||||
PerspectiveCamera camera = new PerspectiveCamera(true);
|
|
||||||
|
|
||||||
// Set up view frustum
|
|
||||||
nearClip = 0.1;
|
|
||||||
farClip = 3000.0;
|
|
||||||
camera.setNearClip(nearClip);
|
|
||||||
camera.setFarClip(farClip);
|
|
||||||
|
|
||||||
// Set up transformations
|
|
||||||
pivot = new Translate();
|
|
||||||
distance = new Translate();
|
|
||||||
yaw = new Rotate(0, Rotate.Y_AXIS);
|
|
||||||
pitch = new Rotate(0, Rotate.X_AXIS);
|
|
||||||
camera.getTransforms().addAll(pivot, yaw, pitch, distance);
|
|
||||||
centerCamera();
|
|
||||||
|
|
||||||
this.camera = camera;
|
|
||||||
return camera;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setItems(ObservableList<Subject3D> items) {
|
|
||||||
this.items = items;
|
|
||||||
this.items.addListener((ListChangeListener<? super Subject3D>) c -> {
|
|
||||||
while(c.next()) {
|
|
||||||
if (c.wasRemoved() || c.wasAdded()) {
|
|
||||||
for (Subject3D shape : c.getRemoved()) world.getChildren().remove(shape.getMesh());
|
|
||||||
for (Subject3D shape : c.getAddedSubList()) world.getChildren().add(shape.getMesh());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNearClip(double nearClip) {
|
|
||||||
this.nearClip = nearClip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFarClip(double farClip) {
|
|
||||||
this.farClip = farClip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updatePivot(Translate pivot) {
|
|
||||||
this.pivot.setX(pivot.getX());
|
|
||||||
this.pivot.setY(pivot.getY());
|
|
||||||
this.pivot.setZ(pivot.getZ());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updatePosition(double x, double y, double z) {
|
|
||||||
this.distance.setX(x);
|
|
||||||
this.distance.setY(y);
|
|
||||||
this.distance.setZ(z);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set distance of camera from pivot
|
|
||||||
* @param distance in units
|
|
||||||
*/
|
|
||||||
public void setDistance(double distance) {
|
|
||||||
this.distance.setZ(-distance);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set angle of camera from z-axis along ground
|
|
||||||
* @param yaw in degrees
|
|
||||||
*/
|
|
||||||
public void setYaw(double yaw) {
|
|
||||||
this.yaw.setAngle(yaw);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set elevation of camera
|
|
||||||
* @param pitch in degrees
|
|
||||||
*/
|
|
||||||
public void setPitch(double pitch) {
|
|
||||||
this.pitch.setAngle(-pitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void centerCamera(){
|
|
||||||
}
|
|
||||||
|
|
||||||
public void rotateCamera(double angle, double x, double y, double z){
|
|
||||||
camera.setRotationAxis(new Point3D(x, y, z));
|
|
||||||
camera.setRotate(-90);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
package visualiser.model;
|
package visualiser.model;
|
||||||
|
|
||||||
|
import javafx.beans.property.ObjectProperty;
|
||||||
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
import network.Messages.Enums.BoatStatusEnum;
|
import network.Messages.Enums.BoatStatusEnum;
|
||||||
import shared.model.Azimuth;
|
import shared.model.*;
|
||||||
import shared.model.Boat;
|
|
||||||
import shared.model.Constants;
|
|
||||||
import shared.model.GPSCoordinate;
|
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
@@ -61,7 +60,8 @@ public class VisualiserBoat extends Boat {
|
|||||||
private boolean isClientBoat = false;
|
private boolean isClientBoat = false;
|
||||||
|
|
||||||
|
|
||||||
|
private ObjectProperty<GPSCoordinate> positionProperty;
|
||||||
|
private ObjectProperty<Bearing> bearingProperty;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -239,4 +239,38 @@ public class VisualiserBoat extends Boat {
|
|||||||
public void setClientBoat(boolean clientBoat) {
|
public void setClientBoat(boolean clientBoat) {
|
||||||
isClientBoat = clientBoat;
|
isClientBoat = clientBoat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GPSCoordinate getPosition() {
|
||||||
|
return positionProperty.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPosition(GPSCoordinate position) {
|
||||||
|
if(this.positionProperty == null) {
|
||||||
|
this.positionProperty = new SimpleObjectProperty<>();
|
||||||
|
}
|
||||||
|
this.positionProperty.set(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObjectProperty<GPSCoordinate> positionProperty() {
|
||||||
|
return positionProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Bearing getBearing() {
|
||||||
|
return bearingProperty.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBearing(Bearing bearing) {
|
||||||
|
if(this.bearingProperty == null) {
|
||||||
|
this.bearingProperty = new SimpleObjectProperty<>();
|
||||||
|
}
|
||||||
|
this.bearingProperty.set(bearing);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObjectProperty<Bearing> bearingProperty() {
|
||||||
|
return bearingProperty;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package visualiser.utils;
|
||||||
|
|
||||||
|
import shared.dataInput.RaceDataSource;
|
||||||
|
import shared.model.GPSCoordinate;
|
||||||
|
import visualiser.model.GraphCoordinate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts GPS coordinates to view volume coordinates. Longitudes are equally spaced at all latitudes,
|
||||||
|
* which leads to inaccurate distance measurements close to the poles. This is acceptable as races are
|
||||||
|
* not likely to be set there.
|
||||||
|
*/
|
||||||
|
public class GPSConverter {
|
||||||
|
private double longRight;
|
||||||
|
private double longLeft;
|
||||||
|
private double latBottom;
|
||||||
|
private double latTop;
|
||||||
|
/**
|
||||||
|
* Conversion factor from longitude to view units
|
||||||
|
*/
|
||||||
|
private double longitudeFactor;
|
||||||
|
/**
|
||||||
|
* Conversion factor from latitude to view units
|
||||||
|
*/
|
||||||
|
private double latitudeFactor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up projection with default view boundaries from RaceDataSource
|
||||||
|
* @param source for view boundaries
|
||||||
|
* @param longitudeFactor separation of a degree of longitude in view units
|
||||||
|
* @param latitudeFactor separation of a degree of latitude in view units
|
||||||
|
*/
|
||||||
|
public GPSConverter(RaceDataSource source, double longitudeFactor, double latitudeFactor) {
|
||||||
|
this.latTop = source.getMapTopLeft().getLatitude();
|
||||||
|
this.longLeft = source.getMapTopLeft().getLongitude();
|
||||||
|
this.latBottom = source.getMapBottomRight().getLatitude();
|
||||||
|
this.longRight = source.getMapBottomRight().getLongitude();
|
||||||
|
this.longitudeFactor = longitudeFactor;
|
||||||
|
this.latitudeFactor = latitudeFactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts GPS coordinates to coordinates for container.
|
||||||
|
* It is assumed that the provided GPSCoordinate will always be within the GPSCoordinate boundaries of the RaceMap.
|
||||||
|
*
|
||||||
|
* @param lat GPS latitude
|
||||||
|
* @param lon GPS longitude
|
||||||
|
* @return GraphCoordinate (pair of doubles)
|
||||||
|
* @see GraphCoordinate
|
||||||
|
*/
|
||||||
|
private GraphCoordinate convertGPS(double lat, double lon) {
|
||||||
|
|
||||||
|
//Calculate the width/height, in gps coordinates, of the map.
|
||||||
|
double longWidth = longRight - longLeft;
|
||||||
|
double latHeight = latBottom - latTop;
|
||||||
|
|
||||||
|
//Calculate the distance between the specified coordinate and the edge of the map.
|
||||||
|
double longDelta = lon - longLeft;
|
||||||
|
double latDelta = lat - latTop;
|
||||||
|
|
||||||
|
//Calculate the proportion along horizontally, from the left, the coordinate should be.
|
||||||
|
double longProportion = longDelta / longWidth;
|
||||||
|
//Calculate the proportion along vertically, from the top, the coordinate should be.
|
||||||
|
double latProportion = latDelta / latHeight;
|
||||||
|
|
||||||
|
//Check which metric dimension of our map is smaller. We use this to ensure that any rendered stuff retains its correct aspect ratio, and that everything is visible on screen.
|
||||||
|
double smallerDimension = Math.min(longitudeFactor, latitudeFactor);
|
||||||
|
|
||||||
|
//Calculate the x and y pixel coordinates.
|
||||||
|
//We take the complement of latProportion to flip it.
|
||||||
|
int x = (int) (longProportion * smallerDimension);
|
||||||
|
int y = (int) (latProportion * smallerDimension);
|
||||||
|
|
||||||
|
//Because we try to maintain the correct aspect ratio, we will end up with "spare" pixels along the larger dimension (e.g., width 800, height 600, 200 extra pixels along width).
|
||||||
|
double extraDistance = Math.abs(longitudeFactor - latitudeFactor);
|
||||||
|
//We therefore "center" the coordinates along this larger dimension, by adding half of the extra pixels.
|
||||||
|
if (longitudeFactor > latitudeFactor) {
|
||||||
|
x += extraDistance / 2;
|
||||||
|
} else {
|
||||||
|
y += extraDistance / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Finally, create the GraphCoordinate.
|
||||||
|
GraphCoordinate graphCoordinate = new GraphCoordinate(x, y);
|
||||||
|
|
||||||
|
|
||||||
|
return graphCoordinate;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts the GPS Coordinate to GraphCoordinate.
|
||||||
|
* It is assumed that the provided GPSCoordinate will always be within the GPSCoordinate boundaries of the RaceMap.
|
||||||
|
*
|
||||||
|
* @param coordinate GPSCoordinate representation of Latitude and Longitude.
|
||||||
|
* @return GraphCoordinate that the GPS is coordinates are to be displayed on the map.
|
||||||
|
* @see GraphCoordinate
|
||||||
|
* @see GPSCoordinate
|
||||||
|
*/
|
||||||
|
public GraphCoordinate convertGPS(GPSCoordinate coordinate) {
|
||||||
|
return convertGPS(coordinate.getLatitude(), coordinate.getLongitude());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.SplitPane?>
|
||||||
|
<?import javafx.scene.control.TableColumn?>
|
||||||
|
<?import javafx.scene.control.TableView?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
|
<?import javafx.scene.layout.GridPane?>
|
||||||
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
<AnchorPane fx:id="hostWrapper" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="780.0" visible="false" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.HostController">
|
||||||
|
<children>
|
||||||
|
<SplitPane fx:id="splitPane" dividerPositions="0.7724935732647815" layoutX="580.0" layoutY="129.0" prefHeight="160.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<items>
|
||||||
|
<AnchorPane fx:id="imagePane" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
|
||||||
|
<children>
|
||||||
|
<ImageView fx:id="imageView" fitHeight="376.0" fitWidth="597.0" nodeOrientation="INHERIT" pickOnBounds="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<image>
|
||||||
|
<Image url="@../images/lobby.gif" />
|
||||||
|
</image></ImageView>
|
||||||
|
<GridPane style="-fx-background-color: rgba(0, 0, 0, 0.5);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints maxHeight="50.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="10.0" prefHeight="173.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints maxHeight="50.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<Button mnemonicParsing="false" onAction="#menuBtnPressed" text="Quit" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Button>
|
||||||
|
<Button alignment="CENTER_RIGHT" contentDisplay="RIGHT" mnemonicParsing="false" onAction="#startBtnPressed" text="Start Game" GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Button>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" text="Map: MapNameHere" textFill="WHITE" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||||
|
<font>
|
||||||
|
<Font size="16.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
<GridPane fx:id="playerContainer" GridPane.columnSpan="3" GridPane.rowIndex="1">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<Label alignment="TOP_CENTER" text="Get Ready For The Next Race" textFill="#fffdfd" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="20.0">
|
||||||
|
<font>
|
||||||
|
<Font size="22.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<AnchorPane fx:id="specPane" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
|
||||||
|
<children>
|
||||||
|
<TableView prefHeight="200.0" prefWidth="200.0" style="-fx-background-color: rgba(60, 60, 60, 1);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<columns>
|
||||||
|
<TableColumn prefWidth="173.0" text="Spectators" />
|
||||||
|
</columns>
|
||||||
|
<columnResizePolicy>
|
||||||
|
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||||
|
</columnResizePolicy>
|
||||||
|
</TableView>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</items>
|
||||||
|
</SplitPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<?import javafx.scene.layout.StackPane?>
|
<?import javafx.scene.layout.StackPane?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
<SplitPane fx:id="race" dividerPositions="1.0" prefHeight="431.0" prefWidth="610.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.RaceController">
|
<SplitPane fx:id="racePane" dividerPositions="1.0" prefHeight="431.0" prefWidth="610.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.RaceController">
|
||||||
<items>
|
<items>
|
||||||
<GridPane fx:id="canvasBase">
|
<GridPane fx:id="canvasBase">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
|
|||||||
Reference in New Issue
Block a user