connected up all the javafx components and got team positions displaying on the sidebar #story[426]

This commit is contained in:
Peter
2017-03-23 21:21:54 +13:00
parent bb8c681270
commit a860cc0ec1
3 changed files with 27 additions and 1 deletions
@@ -2,6 +2,7 @@ package seng302.controllers;
import javafx.fxml.FXML;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import seng302.models.Boat;
import seng302.models.Event;
@@ -30,5 +31,15 @@ public class BoatPositionController {
return b2.getMarkLastPast() - b1.getMarkLastPast();
}
});
displayBoats();
}
private void displayBoats(){
positionVbox.getChildren().clear();
positionVbox.getChildren().removeAll();
for (Boat boat: boatOrder){
positionVbox.getChildren().add(new Text(boat.getTeamName()));
}
}
}
+5 -1
View File
@@ -29,7 +29,6 @@
<Label layoutX="11.0" layoutY="88.0" text="Wind direction" />
<Button layoutX="18.0" layoutY="468.0" mnemonicParsing="false" text="Button" />
<TextArea editable="false" layoutX="11.0" layoutY="640.0" prefHeight="306.0" prefWidth="200.0" />
<TextArea editable="false" layoutX="11.0" layoutY="280.0" prefHeight="141.0" prefWidth="200.0" />
<Circle fx:id="windBackgroundCircle" blendMode="DARKEN" fill="#76baf8" layoutX="110.0" layoutY="166.0" radius="35.0" stroke="#686868" strokeType="INSIDE" strokeWidth="3.0" />
<Text fx:id="windArrowText" fill="#686868" layoutX="86.0" layoutY="186.0" strokeType="OUTSIDE" strokeWidth="0.0" text="↑">
<font>
@@ -42,6 +41,11 @@
</font>
</Text>
<Pane fx:id="raceTimer" layoutX="11.0" layoutY="30.0" prefHeight="51.0" prefWidth="193.0" />
<AnchorPane layoutX="12.0" layoutY="280.0" prefHeight="140.0" prefWidth="200.0">
<children>
<fx:include fx:id="teamPositions" source="TeamPositions.fxml" />
</children>
</AnchorPane>
</children>
</AnchorPane>
<AnchorPane fx:id="contentAnchorPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="960.0" prefWidth="1280.0" GridPane.columnIndex="1" GridPane.rowSpan="3">
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="140.0" prefWidth="200.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.controllers.BoatPositionController">
<children>
<VBox fx:id="positionVbox" layoutX="119.0" layoutY="50.0" prefHeight="200.0" prefWidth="222.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>