mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Merge remote-tracking branch 'origin/NewUI_merge' into NewUI_merge
# Conflicts: # src/main/java/seng302/gameServer/GameState.java
This commit is contained in:
@@ -1,35 +1,12 @@
|
||||
package seng302.gameServer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import javafx.scene.paint.Color;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
import seng302.gameServer.messages.BoatAction;
|
||||
import seng302.gameServer.messages.BoatStatus;
|
||||
import seng302.gameServer.messages.ChatterMessage;
|
||||
import seng302.gameServer.messages.CustomizeRequestType;
|
||||
import seng302.gameServer.messages.MarkRoundingMessage;
|
||||
import seng302.gameServer.messages.MarkType;
|
||||
import seng302.gameServer.messages.Message;
|
||||
import seng302.gameServer.messages.RoundingBoatStatus;
|
||||
import seng302.gameServer.messages.YachtEventCodeMessage;
|
||||
import seng302.gameServer.messages.YachtEventType;
|
||||
import seng302.model.GeoPoint;
|
||||
import seng302.model.Limit;
|
||||
import seng302.model.Player;
|
||||
import seng302.model.PolarTable;
|
||||
import seng302.model.ServerYacht;
|
||||
import seng302.gameServer.messages.*;
|
||||
import seng302.model.*;
|
||||
import seng302.model.mark.CompoundMark;
|
||||
import seng302.model.mark.Mark;
|
||||
import seng302.model.mark.MarkOrder;
|
||||
@@ -38,6 +15,10 @@ import seng302.model.token.TokenType;
|
||||
import seng302.utilities.GeoUtility;
|
||||
import seng302.utilities.XMLParser;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* A Static class to hold information about the current state of the game (model)
|
||||
* Also contains logic for updating itself on regular time intervals on its own thread
|
||||
|
||||
@@ -3,11 +3,8 @@ package seng302.model;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Observable;
|
||||
import java.util.TimeZone;
|
||||
import javafx.beans.property.ReadOnlyDoubleProperty;
|
||||
import javafx.beans.property.ReadOnlyDoubleWrapper;
|
||||
@@ -34,8 +31,9 @@ public class RaceState {
|
||||
private ReadOnlyDoubleWrapper windDirection = new ReadOnlyDoubleWrapper();
|
||||
private long serverSystemTime;
|
||||
private long expectedStartTime;
|
||||
private boolean isRaceStarted = false;
|
||||
private boolean raceRunning = false;
|
||||
private boolean gunFired = false;
|
||||
private boolean raceFinished = false;
|
||||
long timeTillStart;
|
||||
private ObservableList<ClientYacht> playerPositions;
|
||||
private List<ClientYacht> collisions = new ArrayList<>();
|
||||
@@ -50,7 +48,7 @@ public class RaceState {
|
||||
this.windDirection.set(data.getWindDirection());
|
||||
this.serverSystemTime = data.getCurrentTime();
|
||||
this.expectedStartTime = data.getExpectedStartTime();
|
||||
this.isRaceStarted = data.isRaceStarted();
|
||||
this.raceRunning = data.isRaceStarted();
|
||||
}
|
||||
|
||||
public void setTimeZone (TimeZone timeZone) {
|
||||
@@ -95,9 +93,12 @@ public class RaceState {
|
||||
}
|
||||
|
||||
public boolean isRaceStarted () {
|
||||
return isRaceStarted;
|
||||
return raceRunning;
|
||||
}
|
||||
|
||||
public void setRaceStarted(Boolean value) {
|
||||
this.raceRunning = value;
|
||||
}
|
||||
public void setBoats(Collection<ClientYacht> clientYachts) {
|
||||
playerPositions.setAll(clientYachts);
|
||||
}
|
||||
@@ -125,4 +126,12 @@ public class RaceState {
|
||||
public void removeCollisionListener(CollisionListener collisionListener) {
|
||||
collisionListeners.remove(collisionListener);
|
||||
}
|
||||
|
||||
public void setRaceFinished() {
|
||||
raceFinished = true;
|
||||
}
|
||||
|
||||
public Boolean getRaceFinished() {
|
||||
return raceFinished;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import javafx.application.Platform;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Alert.AlertType;
|
||||
import javafx.scene.input.KeyCode;
|
||||
@@ -42,7 +41,6 @@ import seng302.utilities.Sounds;
|
||||
import seng302.utilities.StreamParser;
|
||||
import seng302.utilities.XMLGenerator;
|
||||
import seng302.utilities.XMLParser;
|
||||
import seng302.visualiser.controllers.FinishScreenViewController;
|
||||
import seng302.visualiser.controllers.LobbyController;
|
||||
import seng302.visualiser.controllers.RaceViewController;
|
||||
import seng302.visualiser.controllers.ViewManager;
|
||||
@@ -64,6 +62,7 @@ public class GameClient {
|
||||
private RaceXMLData courseData;
|
||||
private RaceState raceState = new RaceState();
|
||||
private LobbyController lobbyController;
|
||||
private RaceViewController raceViewController;
|
||||
|
||||
private ArrayList<ClientYacht> finishedBoats = new ArrayList<>();
|
||||
|
||||
@@ -177,40 +176,8 @@ public class GameClient {
|
||||
socketThread.addStreamObserver(this::parsePackets);
|
||||
}
|
||||
|
||||
private void loadRaceView() {
|
||||
FXMLLoader fxmlLoader = loadFXMLToHolder("/views/RaceView.fxml");
|
||||
holderPane.getScene().setOnKeyPressed(this::keyPressed);
|
||||
holderPane.getScene().setOnKeyReleased(this::keyReleased);
|
||||
raceView = fxmlLoader.getController();
|
||||
ClientYacht player = allBoatsMap.get(socketThread.getClientId());
|
||||
raceView.loadRace(allBoatsMap, courseData, raceState, player);
|
||||
|
||||
}
|
||||
|
||||
private void loadFinishScreenView() {
|
||||
Sounds.stopMusic();
|
||||
Sounds.stopSoundEffects();
|
||||
Sounds.playFinishMusic();
|
||||
System.out.println("ITS WORKING HERE");
|
||||
FXMLLoader fxmlLoader = loadFXMLToHolder("/views/FinishScreenView.fxml");
|
||||
FinishScreenViewController controller = fxmlLoader.getController();
|
||||
controller.setFinishers(raceState.getPlayerPositions());
|
||||
}
|
||||
|
||||
private FXMLLoader loadFXMLToHolder(String fxmlLocation) {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(
|
||||
getClass().getResource(fxmlLocation)
|
||||
);
|
||||
try {
|
||||
final Node fxmlLoaderFX = fxmlLoader.load();
|
||||
Platform.runLater(() -> {
|
||||
holderPane.getChildren().clear();
|
||||
holderPane.getChildren().add(fxmlLoaderFX);
|
||||
});
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return fxmlLoader;
|
||||
public void setRaceViewController(RaceViewController controller) {
|
||||
this.raceViewController = controller;
|
||||
}
|
||||
|
||||
private void parsePackets() {
|
||||
@@ -374,10 +341,13 @@ public class GameClient {
|
||||
}
|
||||
|
||||
if (raceFinished) {
|
||||
System.out.println(raceViewController);
|
||||
raceViewController.showFinishDialog(finishedBoats);
|
||||
Sounds.playFinishSound();
|
||||
close();
|
||||
loadFinishScreenView();
|
||||
//loadFinishScreenView();
|
||||
}
|
||||
raceState.setRaceFinished();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,7 +362,6 @@ public class GameClient {
|
||||
socketThread.setSocketToClose();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle the key-pressed event from the text field.
|
||||
* @param e The key event triggering this call
|
||||
|
||||
@@ -2,12 +2,6 @@ package seng302.visualiser.controllers;
|
||||
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.controls.JFXDialog;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.application.Platform;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.fxml.FXML;
|
||||
@@ -33,6 +27,13 @@ import seng302.visualiser.GameView;
|
||||
import seng302.visualiser.controllers.cells.PlayerCell;
|
||||
import seng302.visualiser.controllers.dialogs.BoatCustomizeController;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class LobbyController implements Initializable {
|
||||
|
||||
//--------FXML BEGIN--------//
|
||||
@@ -91,7 +92,6 @@ public class LobbyController implements Initializable {
|
||||
|
||||
Platform.runLater(() -> {
|
||||
Integer playerId = ViewManager.getInstance().getGameClient().getServerThread().getClientId();
|
||||
String name = ViewManager.getInstance().getGameClient().getPlayerNames().get(playerId - 1);
|
||||
|
||||
playersColor = Colors.getColor(playerId - 1);
|
||||
customizationDialog = createCustomizeDialog();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package seng302.visualiser.controllers;
|
||||
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.controls.JFXDialog;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -55,9 +56,10 @@ import seng302.visualiser.GameView3D;
|
||||
import seng302.visualiser.controllers.annotations.ImportantAnnotationController;
|
||||
import seng302.visualiser.controllers.annotations.ImportantAnnotationDelegate;
|
||||
import seng302.visualiser.controllers.annotations.ImportantAnnotationsState;
|
||||
import seng302.visualiser.controllers.dialogs.FinishDialogController;
|
||||
import seng302.visualiser.fxObjects.ChatHistory;
|
||||
import seng302.visualiser.fxObjects.assets_3D.BoatObject;
|
||||
import seng302.visualiser.fxObjects.assets_2D.WindArrow;
|
||||
import seng302.visualiser.fxObjects.assets_3D.BoatObject;
|
||||
|
||||
/**
|
||||
* Controller class that manages the display of a race
|
||||
@@ -124,11 +126,15 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
private Polyline windArrow = new WindArrow(Color.LIGHTGRAY);
|
||||
private ObservableList<ClientYacht> selectionComboBoxList = FXCollections.observableArrayList();
|
||||
private ClientYacht player;
|
||||
private JFXDialog finishScreenDialog;
|
||||
private FinishDialogController finishDialogController;
|
||||
|
||||
public void initialize() {
|
||||
Sounds.stopMusic();
|
||||
Sounds.playRaceMusic();
|
||||
|
||||
finishScreenDialog = createFinishDialog();
|
||||
|
||||
// Load a default important annotation state
|
||||
//importantAnnotations = new ImportantAnnotationsState();
|
||||
|
||||
@@ -191,6 +197,31 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
});
|
||||
}
|
||||
|
||||
public void showFinishDialog(ArrayList<ClientYacht> finishedBoats) {
|
||||
raceState.setRaceStarted(false);
|
||||
finishDialogController.setFinishedBoats(finishedBoats);
|
||||
ViewManager.getInstance().getGameClient().stopGame();
|
||||
finishScreenDialog.show();
|
||||
}
|
||||
|
||||
private JFXDialog createFinishDialog() {
|
||||
FXMLLoader dialog = new FXMLLoader(
|
||||
getClass().getResource("/views/dialogs/RaceFinishDialog.fxml"));
|
||||
|
||||
JFXDialog finishScreenDialog = null;
|
||||
|
||||
try {
|
||||
finishScreenDialog = new JFXDialog(contentAnchorPane, dialog.load(),
|
||||
JFXDialog.DialogTransition.CENTER);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
finishDialogController = dialog.getController();
|
||||
|
||||
return finishScreenDialog;
|
||||
}
|
||||
|
||||
public void loadRace (
|
||||
Map<Integer, ClientYacht> participants, RaceXMLData raceData, RaceState raceState,
|
||||
ClientYacht player) {
|
||||
|
||||
@@ -248,14 +248,12 @@ public class ViewManager {
|
||||
|
||||
public RaceViewController loadRaceView() {
|
||||
FXMLLoader loader = loadFxml("/views/RaceView.fxml");
|
||||
|
||||
// have to create a new stage and set the race view maximized as JFoenix decorator has
|
||||
// bug causes stage cannot be fully maximised.
|
||||
Platform.runLater(() -> {
|
||||
try {
|
||||
stage.close();
|
||||
stage = new Stage();
|
||||
|
||||
JFXDecorator decorator = new JFXDecorator(stage, loader.load(), false, true, true);
|
||||
decorator.setCustomMaximize(true);
|
||||
decorator.applyCss();
|
||||
@@ -263,6 +261,8 @@ public class ViewManager {
|
||||
.add(getClass().getResource("/css/Master.css").toExternalForm());
|
||||
setDecorator(decorator);
|
||||
Scene scene = new Scene(decorator);
|
||||
RaceViewController raceViewController = loader.getController();
|
||||
gameClient.setRaceViewController(raceViewController);
|
||||
// set key press event to catch key stoke
|
||||
scene.setOnKeyPressed(gameClient::keyPressed);
|
||||
scene.setOnKeyReleased(gameClient::keyReleased);
|
||||
|
||||
@@ -3,11 +3,13 @@ package seng302.visualiser.controllers.dialogs;
|
||||
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.controls.JFXListView;
|
||||
import java.awt.Label;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Label;
|
||||
import seng302.model.ClientYacht;
|
||||
import seng302.visualiser.controllers.ViewManager;
|
||||
|
||||
public class FinishDialogController implements Initializable {
|
||||
@@ -16,7 +18,7 @@ public class FinishDialogController implements Initializable {
|
||||
@FXML
|
||||
private Label raceFinishLabel;
|
||||
@FXML
|
||||
private JFXListView finishersList;
|
||||
private JFXListView<Label> finishersList;
|
||||
@FXML
|
||||
private JFXButton playAgain;
|
||||
//---------FXML END---------//
|
||||
@@ -25,4 +27,11 @@ public class FinishDialogController implements Initializable {
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
playAgain.setOnAction(event -> ViewManager.getInstance().goToStartView());
|
||||
}
|
||||
|
||||
public void setFinishedBoats(ArrayList<ClientYacht> finishedBoats) {
|
||||
finishersList.getItems().clear();
|
||||
for (ClientYacht yacht : finishedBoats) {
|
||||
finishersList.getItems().add(new Label(yacht.getBoatName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import com.jfoenix.controls.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import com.jfoenix.controls.JFXButton?>
|
||||
<?import com.jfoenix.controls.JFXTextField?>
|
||||
<?import java.lang.String?>
|
||||
@@ -21,31 +14,42 @@
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.layout.StackPane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<AnchorPane fx:id="rvAnchorPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1200.0" style="-fx-background-color: skyblue;" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.visualiser.controllers.RaceViewController">
|
||||
<AnchorPane fx:id="rvAnchorPane" maxHeight="1.7976931348623157E308"
|
||||
maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0"
|
||||
prefWidth="1200.0" style="-fx-background-color: skyblue;" xmlns="http://javafx.com/javafx/8"
|
||||
xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="seng302.visualiser.controllers.RaceViewController">
|
||||
<children>
|
||||
<StackPane fx:id="contentAnchorPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="800.0" prefWidth="1200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
|
||||
</StackPane>
|
||||
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="800.0" prefWidth="1200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
|
||||
prefHeight="800.0" prefWidth="1200.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="300.0" minWidth="300.0" prefWidth="300.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="250.0" minWidth="250.0"
|
||||
prefWidth="250.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="400.0" prefWidth="400.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="400.0"
|
||||
prefWidth="400.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="70.0" minHeight="70.0" prefHeight="70.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="70.0" minHeight="70.0" prefHeight="70.0"
|
||||
vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="1.7976931348623157E308" vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="250.0" minHeight="250.0" prefHeight="250.0" valignment="BOTTOM" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="250.0" minHeight="250.0" prefHeight="250.0"
|
||||
valignment="BOTTOM" vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<GridPane id="timerGrid" fx:id="timerGrid" prefWidth="192.0" styleClass="timer">
|
||||
<GridPane id="timerGrid" fx:id="timerGrid" prefWidth="192.0"
|
||||
styleClass="timer">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="50.0" minWidth="50.0" prefWidth="50.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="135.0" minWidth="135.0" prefWidth="135.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="50.0" minWidth="50.0"
|
||||
prefWidth="50.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="135.0"
|
||||
minWidth="135.0" prefWidth="135.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0"
|
||||
vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<opaqueInsets>
|
||||
<Insets/>
|
||||
@@ -54,7 +58,9 @@
|
||||
<Insets left="10.0" right="200.0" top="10.0"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<ImageView fitHeight="40.0" fitWidth="40.0" pickOnBounds="true" preserveRatio="true" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
|
||||
<ImageView fitHeight="40.0" fitWidth="40.0" pickOnBounds="true"
|
||||
preserveRatio="true" GridPane.halignment="CENTER"
|
||||
GridPane.valignment="CENTER">
|
||||
<image>
|
||||
<Image url="@../images/timer.png"/>
|
||||
</image>
|
||||
@@ -62,7 +68,8 @@
|
||||
<Insets/>
|
||||
</GridPane.margin>
|
||||
</ImageView>
|
||||
<Label fx:id="timerLabel" text="00:03:34" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
|
||||
<Label fx:id="timerLabel" text="00:03:34" GridPane.columnIndex="1"
|
||||
GridPane.halignment="CENTER" GridPane.valignment="CENTER">
|
||||
<font>
|
||||
<Font size="21.0"/>
|
||||
</font>
|
||||
@@ -74,23 +81,32 @@
|
||||
</GridPane>
|
||||
<GridPane GridPane.columnIndex="2">
|
||||
<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 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>
|
||||
<GridPane fx:id="chatGridPane" GridPane.columnIndex="2" GridPane.rowIndex="2">
|
||||
<GridPane fx:id="chatGridPane" GridPane.columnIndex="2"
|
||||
GridPane.rowIndex="2">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="390.0" minWidth="390.0" prefWidth="390.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="390.0"
|
||||
minWidth="390.0" prefWidth="390.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="1.7976931348623157E308" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="60.0" minHeight="60.0" prefHeight="60.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="1.7976931348623157E308"
|
||||
vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="60.0" minHeight="60.0" prefHeight="60.0"
|
||||
vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Pane fx:id="chatHistoryHolder" prefHeight="200.0" prefWidth="200.0" GridPane.hgrow="ALWAYS" GridPane.valignment="BOTTOM" GridPane.vgrow="ALWAYS">
|
||||
<Pane fx:id="chatHistoryHolder" prefHeight="200.0" prefWidth="200.0"
|
||||
GridPane.hgrow="ALWAYS" GridPane.valignment="BOTTOM"
|
||||
GridPane.vgrow="ALWAYS">
|
||||
<GridPane.margin>
|
||||
<Insets/>
|
||||
</GridPane.margin>
|
||||
@@ -100,19 +116,28 @@
|
||||
</Pane>
|
||||
<GridPane fx:id="chatInputHolder" GridPane.rowIndex="1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="90.0" prefWidth="90.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0"
|
||||
prefWidth="100.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity"
|
||||
minWidth="90.0" prefWidth="90.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="50.0" minHeight="50.0" prefHeight="50.0" valignment="CENTER" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="50.0" minHeight="50.0"
|
||||
prefHeight="50.0" valignment="CENTER" vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<JFXButton fx:id="chatSend" alignment="CENTER" buttonType="RAISED" maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" text="SEND" GridPane.columnIndex="1">
|
||||
<JFXButton fx:id="chatSend" alignment="CENTER"
|
||||
buttonType="RAISED" maxHeight="-Infinity"
|
||||
maxWidth="1.7976931348623157E308" minHeight="-Infinity"
|
||||
minWidth="-Infinity" prefHeight="35.0" text="SEND"
|
||||
GridPane.columnIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
<Insets bottom="10.0" left="10.0" right="10.0"
|
||||
top="10.0"/>
|
||||
</GridPane.margin>
|
||||
</JFXButton>
|
||||
<JFXTextField fx:id="chatInput" maxHeight="35.0" minHeight="-Infinity" prefHeight="35.0">
|
||||
<JFXTextField fx:id="chatInput" maxHeight="35.0"
|
||||
minHeight="-Infinity" prefHeight="35.0">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" left="20.0" right="10.0"/>
|
||||
</GridPane.margin>
|
||||
@@ -130,49 +155,72 @@
|
||||
<Insets bottom="10.0" right="10.0"/>
|
||||
</GridPane.margin>
|
||||
</GridPane>
|
||||
<GridPane fx:id="windGridPane" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="150.0" prefWidth="240.0" GridPane.halignment="LEFT" GridPane.rowIndex="2" GridPane.valignment="BOTTOM">
|
||||
<GridPane fx:id="windGridPane" maxHeight="-Infinity" maxWidth="-Infinity"
|
||||
prefHeight="150.0" prefWidth="240.0" GridPane.halignment="CENTER"
|
||||
GridPane.rowIndex="2" GridPane.valignment="BOTTOM">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0" prefWidth="130.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="132.0" minWidth="10.0" prefWidth="111.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="110.0"
|
||||
minWidth="110.0" prefWidth="110.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="132.0" minWidth="10.0"
|
||||
prefWidth="132.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="120.0" minHeight="120.0" prefHeight="120.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="120.0" minHeight="120.0"
|
||||
prefHeight="120.0" vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0"
|
||||
vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label fx:id="positionLabel" text="Position:" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.rowSpan="2" GridPane.valignment="TOP">
|
||||
<Label fx:id="positionLabel" text="Position:"
|
||||
GridPane.columnIndex="1" GridPane.halignment="LEFT"
|
||||
GridPane.rowSpan="2" GridPane.valignment="TOP">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="10.0" right="5.0" top="5.0"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label fx:id="boatSpeedLabel" text="Boat Speed:" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.rowSpan="2" GridPane.valignment="CENTER">
|
||||
<Label fx:id="boatSpeedLabel" text="Boat Speed:"
|
||||
GridPane.columnIndex="1" GridPane.halignment="LEFT"
|
||||
GridPane.rowSpan="2" GridPane.valignment="CENTER">
|
||||
<opaqueInsets>
|
||||
<Insets/>
|
||||
</opaqueInsets>
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="10.0" right="5.0" top="5.0"/>
|
||||
</padding></Label>
|
||||
<Label fx:id="boatHeadingLabel" text="Boat Heading:" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.rowSpan="2" GridPane.valignment="BOTTOM">
|
||||
</padding>
|
||||
</Label>
|
||||
<Label fx:id="boatHeadingLabel" text="Boat Heading:"
|
||||
GridPane.columnIndex="1" GridPane.halignment="LEFT"
|
||||
GridPane.rowSpan="2" GridPane.valignment="BOTTOM">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="10.0" right="5.0" top="5.0"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<GridPane fx:id="windHolder" GridPane.rowSpan="2">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0" prefWidth="130.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0"
|
||||
prefWidth="100.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="120.0" minHeight="120.0" prefHeight="120.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="120.0" minHeight="120.0"
|
||||
prefHeight="120.0" vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="30.0" minHeight="30.0"
|
||||
prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<ImageView fx:id="windImageView" fitHeight="92.0" fitWidth="109.0" pickOnBounds="true" preserveRatio="true" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
|
||||
<Label fx:id="windSpeedLabel" text="0.0 Knots" GridPane.halignment="RIGHT" GridPane.rowIndex="1" GridPane.valignment="CENTER">
|
||||
<ImageView fx:id="windImageView" fitHeight="92.0"
|
||||
fitWidth="109.0" pickOnBounds="true" preserveRatio="true"
|
||||
GridPane.halignment="CENTER" GridPane.rowSpan="2"
|
||||
GridPane.valignment="CENTER"/>
|
||||
<Label fx:id="windSpeedLabel" text="0.0 Knots"
|
||||
GridPane.halignment="RIGHT" GridPane.rowIndex="1"
|
||||
GridPane.valignment="CENTER">
|
||||
<GridPane.margin>
|
||||
<Insets right="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label fx:id="windDirectionLabel" text="180.0°" GridPane.halignment="LEFT" GridPane.rowIndex="1" GridPane.valignment="CENTER">
|
||||
<Label fx:id="windDirectionLabel" text="180.0°"
|
||||
GridPane.halignment="LEFT" GridPane.rowIndex="1"
|
||||
GridPane.valignment="CENTER">
|
||||
<GridPane.margin>
|
||||
<Insets left="5.0"/>
|
||||
</GridPane.margin>
|
||||
@@ -190,6 +238,8 @@
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
</StackPane>
|
||||
</children>
|
||||
<stylesheets>
|
||||
<String fx:value="/css/Master.css" />
|
||||
<String fx:value="/css/RaceView.css" />
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import com.jfoenix.controls.JFXButton?>
|
||||
<?import com.jfoenix.controls.JFXDialogLayout?>
|
||||
<?import com.jfoenix.controls.JFXListView?>
|
||||
<?import java.lang.String?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<JFXDialogLayout maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
|
||||
minWidth="-Infinity" prefWidth="400.0" xmlns="http://javafx.com/javafx/8"
|
||||
xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="seng302.visualiser.controllers.dialogs.FinishDialogController">
|
||||
<children>
|
||||
<GridPane>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="90.0" minHeight="90.0" prefHeight="90.0"
|
||||
vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="100.0" minHeight="100.0" prefHeight="100.0"
|
||||
vgrow="SOMETIMES"/>
|
||||
<RowConstraints maxHeight="164.0" minHeight="100.0" prefHeight="126.0"
|
||||
vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<JFXButton fx:id="playAgain" prefHeight="45.0" prefWidth="220.0" text="PLAY AGAIN"
|
||||
GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER"/>
|
||||
<JFXListView fx:id="finishersList" GridPane.rowIndex="1"/>
|
||||
<Label fx:id="raceFinishLabel" text="RACE OVER" GridPane.halignment="CENTER"
|
||||
GridPane.valignment="CENTER"/>
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
<stylesheets>
|
||||
<String fx:value="/css/dialogs/BoatCustomize.css"/>
|
||||
<String fx:value="/css/Master.css"/>
|
||||
</stylesheets>
|
||||
</JFXDialogLayout>
|
||||
Reference in New Issue
Block a user