Merge remote-tracking branch 'remotes/origin/master' into story28
-anchors now fills stage -added time label # Conflicts: # pom.xml # src/main/java/seng302/Controllers/RaceController.java # src/main/resources/scenes/racepane.fxml #pair[fwy13, hba56] #story[761]
This commit is contained in:
@@ -2,6 +2,7 @@ package seng302.Controllers;
|
|||||||
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.control.SplitPane;
|
import javafx.scene.control.SplitPane;
|
||||||
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import seng302.RaceXMLReader;
|
import seng302.RaceXMLReader;
|
||||||
|
|
||||||
@@ -15,7 +16,6 @@ public class MainController extends Controller {
|
|||||||
@FXML StartController startController;
|
@FXML StartController startController;
|
||||||
@FXML RaceController raceController;
|
@FXML RaceController raceController;
|
||||||
|
|
||||||
|
|
||||||
public void beginRace(int scaleFactor) {
|
public void beginRace(int scaleFactor) {
|
||||||
raceController.startRace(scaleFactor);
|
raceController.startRace(scaleFactor);
|
||||||
}
|
}
|
||||||
@@ -33,5 +33,9 @@ public class MainController extends Controller {
|
|||||||
public void initialize(URL location, ResourceBundle resources) {
|
public void initialize(URL location, ResourceBundle resources) {
|
||||||
startController.setParent(this);
|
startController.setParent(this);
|
||||||
raceController.setParent(this);
|
raceController.setParent(this);
|
||||||
|
AnchorPane.setTopAnchor(startController.startWrapper(), 0.0);
|
||||||
|
AnchorPane.setBottomAnchor(startController.startWrapper(), 0.0);
|
||||||
|
AnchorPane.setLeftAnchor(startController.startWrapper(), 0.0);
|
||||||
|
AnchorPane.setRightAnchor(startController.startWrapper(), 0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class RaceController extends Controller {
|
|||||||
//Initialize save annotation array, fps listener, and annotation listeners
|
//Initialize save annotation array, fps listener, and annotation listeners
|
||||||
//timezone
|
//timezone
|
||||||
RaceClock raceClock = new RaceClock(raceXMLReader.getMark());
|
RaceClock raceClock = new RaceClock(raceXMLReader.getMark());
|
||||||
timeZone.textProperty().bind(raceClock.timeProperty());
|
timeZone.setText(raceClock.getTimeZone());
|
||||||
|
|
||||||
initializeFPS();
|
initializeFPS();
|
||||||
initializeAnnotations();
|
initializeAnnotations();
|
||||||
|
|||||||
@@ -3,12 +3,16 @@ package seng302.Controllers;
|
|||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.TableColumn;
|
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.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
import seng302.Model.BoatInRace;
|
import seng302.Model.BoatInRace;
|
||||||
|
import seng302.Model.Race;
|
||||||
|
import seng302.Model.RaceClock;
|
||||||
import seng302.RaceXMLReader;
|
import seng302.RaceXMLReader;
|
||||||
|
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
@@ -22,10 +26,14 @@ import java.util.ResourceBundle;
|
|||||||
public class StartController extends Controller {
|
public class StartController extends Controller {
|
||||||
|
|
||||||
@FXML private GridPane start;
|
@FXML private GridPane start;
|
||||||
|
@FXML private AnchorPane startWrapper;
|
||||||
|
|
||||||
@FXML private TableView<BoatInRace> boatNameTable;
|
@FXML private TableView<BoatInRace> boatNameTable;
|
||||||
@FXML private TableColumn<BoatInRace, String> boatNameColumn;
|
@FXML private TableColumn<BoatInRace, String> boatNameColumn;
|
||||||
@FXML private TableColumn<BoatInRace, String> boatCodeColumn;
|
@FXML private TableColumn<BoatInRace, String> boatCodeColumn;
|
||||||
|
@FXML private Label timeZoneTime;
|
||||||
|
|
||||||
|
private RaceClock raceClock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Begins the race with a scale factor of 15
|
* Begins the race with a scale factor of 15
|
||||||
@@ -58,7 +66,10 @@ public class StartController extends Controller {
|
|||||||
public void initialize(URL location, ResourceBundle resources){
|
public void initialize(URL location, ResourceBundle resources){
|
||||||
initialiseTables();
|
initialiseTables();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnchorPane startWrapper(){
|
||||||
|
return startWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialiseTables() {
|
private void initialiseTables() {
|
||||||
@@ -80,6 +91,10 @@ public class StartController extends Controller {
|
|||||||
boatNameTable.setItems(observableBoats);
|
boatNameTable.setItems(observableBoats);
|
||||||
boatNameColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
|
boatNameColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
|
||||||
boatCodeColumn.setCellValueFactory(new PropertyValueFactory<>("abbrev"));
|
boatCodeColumn.setCellValueFactory(new PropertyValueFactory<>("abbrev"));
|
||||||
|
//timezone
|
||||||
|
raceClock = new RaceClock(raceXMLReader.getMark());
|
||||||
|
timeZoneTime.textProperty().bind(raceClock.timeProperty());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import java.time.format.DateTimeFormatter;
|
|||||||
public class RaceClock {
|
public class RaceClock {
|
||||||
private StringProperty time;
|
private StringProperty time;
|
||||||
private DateTimeFormatter dateTimeFormatter;
|
private DateTimeFormatter dateTimeFormatter;
|
||||||
|
private String timeZone;
|
||||||
private ZoneId zoneId;
|
private ZoneId zoneId;
|
||||||
|
|
||||||
public RaceClock(GPSCoordinate gpsCoordinate){
|
public RaceClock(GPSCoordinate gpsCoordinate){
|
||||||
@@ -28,6 +29,8 @@ public class RaceClock {
|
|||||||
dateTimeFormatter = DateTimeFormatter.ofPattern("dd-MM HH:mm:ss z");
|
dateTimeFormatter = DateTimeFormatter.ofPattern("dd-MM HH:mm:ss z");
|
||||||
// System.out.println(dateTimeFormatter.format(zonedDateTime));
|
// System.out.println(dateTimeFormatter.format(zonedDateTime));
|
||||||
time = new SimpleStringProperty(dateTimeFormatter.format(zonedDateTime));
|
time = new SimpleStringProperty(dateTimeFormatter.format(zonedDateTime));
|
||||||
|
DateTimeFormatter timeZoneFormatter = DateTimeFormatter.ofPattern("z");
|
||||||
|
timeZone = timeZoneFormatter.format(zonedDateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateTime(){
|
public void updateTime(){
|
||||||
@@ -43,4 +46,8 @@ public class RaceClock {
|
|||||||
public StringProperty timeProperty() {
|
public StringProperty timeProperty() {
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTimeZone() {
|
||||||
|
return timeZone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<?import javafx.scene.text.*?>
|
<?import javafx.scene.text.*?>
|
||||||
|
|
||||||
|
|
||||||
<SplitPane fx:id="race" dividerPositions="0.7" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.Controllers.RaceController">
|
<SplitPane fx:id="race" dividerPositions="0.7" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.Controllers.RaceController">
|
||||||
<items>
|
<items>
|
||||||
<GridPane fx:id="canvasBase">
|
<GridPane fx:id="canvasBase">
|
||||||
@@ -49,7 +48,7 @@
|
|||||||
</Accordion>
|
</Accordion>
|
||||||
</children>
|
</children>
|
||||||
</Pane>
|
</Pane>
|
||||||
<Label fx:id="timer" layoutX="45.0" layoutY="146.0" text="0:0" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0" GridPane.halignment="RIGHT" GridPane.valignment="BOTTOM">
|
<Label fx:id="timer" layoutX="45.0" layoutY="146.0" maxHeight="20.0" text="0:0" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0" GridPane.halignment="RIGHT" GridPane.valignment="BOTTOM">
|
||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="15.0" />
|
<Font name="System Bold" size="15.0" />
|
||||||
</font>
|
</font>
|
||||||
@@ -59,6 +58,14 @@
|
|||||||
<Font name="System Bold" size="15.0" />
|
<Font name="System Bold" size="15.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
|
<Label fx:id="timeZone" text="Label" GridPane.halignment="RIGHT" GridPane.valignment="BOTTOM">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<AnchorPane layoutX="450.0" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="200.0" GridPane.columnIndex="1">
|
<AnchorPane layoutX="450.0" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="200.0" GridPane.columnIndex="1">
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import java.lang.*?>
|
||||||
|
<?import javafx.geometry.*?>
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
<?import javafx.scene.text.*?>
|
||||||
<?import javafx.geometry.Insets?>
|
<?import javafx.geometry.Insets?>
|
||||||
<?import javafx.scene.control.Button?>
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.control.Label?>
|
<?import javafx.scene.control.Label?>
|
||||||
@@ -11,13 +16,16 @@
|
|||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
<?import javafx.scene.text.Text?>
|
<?import javafx.scene.text.Text?>
|
||||||
|
|
||||||
<GridPane fx:id="start" prefHeight="600.0" prefWidth="780.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.Controllers.StartController">
|
|
||||||
|
<AnchorPane fx:id="startWrapper" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.Controllers.StartController">
|
||||||
|
<children>
|
||||||
|
<GridPane fx:id="start" prefHeight="600.0" prefWidth="780.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="189.0" minWidth="10.0" prefWidth="200.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" prefWidth="200.0" />
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="372.0" minWidth="10.0" prefWidth="200.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="372.0" minWidth="10.0" prefWidth="200.0" />
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="394.0" minWidth="10.0" prefWidth="250.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="394.0" minWidth="10.0" prefWidth="250.0" />
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="416.0" minWidth="10.0" prefWidth="200.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="416.0" minWidth="10.0" prefWidth="200.0" />
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="416.0" minWidth="10.0" prefWidth="200.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" prefWidth="200.0" />
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints maxHeight="241.0" minHeight="10.0" prefHeight="116.5" vgrow="SOMETIMES" />
|
<RowConstraints maxHeight="241.0" minHeight="10.0" prefHeight="116.5" vgrow="SOMETIMES" />
|
||||||
@@ -36,7 +44,8 @@
|
|||||||
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRace1Min" prefWidth="100.0" text="1 Minute" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="4">
|
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRace1Min" prefWidth="100.0" text="1 Minute" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="4">
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets />
|
<Insets />
|
||||||
</GridPane.margin></Button>
|
</GridPane.margin>
|
||||||
|
</Button>
|
||||||
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRaceNoScaling" prefWidth="100.0" text="15 Minutes" GridPane.columnIndex="3" GridPane.halignment="LEFT" GridPane.rowIndex="4" />
|
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRaceNoScaling" prefWidth="100.0" text="15 Minutes" GridPane.columnIndex="3" GridPane.halignment="LEFT" GridPane.rowIndex="4" />
|
||||||
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRace5Min" prefWidth="100.0" text="5 Minutes" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="4" />
|
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRace5Min" prefWidth="100.0" text="5 Minutes" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="4" />
|
||||||
<Label text="Select Race Duration:" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="3" />
|
<Label text="Select Race Duration:" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="3" />
|
||||||
@@ -46,5 +55,8 @@
|
|||||||
<TableColumn fx:id="boatCodeColumn" prefWidth="133.0" style="-fx-font-size: 16;" text="Code" />
|
<TableColumn fx:id="boatCodeColumn" prefWidth="133.0" style="-fx-font-size: 16;" text="Code" />
|
||||||
</columns>
|
</columns>
|
||||||
</TableView>
|
</TableView>
|
||||||
|
<Label fx:id="timeZoneTime" contentDisplay="CENTER" text="timeZoneTime" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
|||||||
Reference in New Issue
Block a user