From 4f80640718be3862c50f77d630152d8b60f1ce66 Mon Sep 17 00:00:00 2001 From: Haoming Yin Date: Thu, 28 Sep 2017 16:33:16 +1300 Subject: [PATCH] Polished raceview UI elements - changed javaFx css style into Css file tags: #story[1273] --- .../visualiser/controllers/ViewManager.java | 15 +- src/main/resources/css/RaceView.css | 17 ++ src/main/resources/views/RaceView.fxml | 247 ++++++++++-------- 3 files changed, 160 insertions(+), 119 deletions(-) diff --git a/src/main/java/seng302/visualiser/controllers/ViewManager.java b/src/main/java/seng302/visualiser/controllers/ViewManager.java index b12a6c52..4ebe0b25 100644 --- a/src/main/java/seng302/visualiser/controllers/ViewManager.java +++ b/src/main/java/seng302/visualiser/controllers/ViewManager.java @@ -6,10 +6,16 @@ import com.jfoenix.controls.JFXDialog; import com.jfoenix.controls.JFXDialog.DialogTransition; import com.jfoenix.controls.JFXSnackbar; import com.jfoenix.svg.SVGGlyph; +import java.io.IOException; +import java.util.HashMap; import javafx.application.Platform; import javafx.collections.ObservableList; import javafx.fxml.FXMLLoader; -import javafx.scene.*; +import javafx.scene.Cursor; +import javafx.scene.Node; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.SceneAntialiasing; import javafx.scene.image.Image; import javafx.scene.layout.HBox; import javafx.scene.layout.StackPane; @@ -24,9 +30,6 @@ import seng302.visualiser.GameClient; import seng302.visualiser.controllers.dialogs.KeyBindingDialogController; import seng302.visualiser.controllers.dialogs.PopupDialogController; -import java.io.IOException; -import java.util.HashMap; - public class ViewManager { private static ViewManager instance; @@ -376,8 +379,8 @@ public class ViewManager { scene.setOnKeyPressed(gameClient::keyPressed); scene.setOnKeyReleased(gameClient::keyReleased); - stage.setMinHeight(500); - stage.setMinWidth(800); + stage.setMinHeight(800); + stage.setMinWidth(1200); stage.setTitle("Party Parrots At Sea"); stage.getIcons().add(new Image(getClass().getResourceAsStream("/PP.png"))); stage.setOnCloseRequest(e -> closeAll()); diff --git a/src/main/resources/css/RaceView.css b/src/main/resources/css/RaceView.css index f38216c8..bf98c98b 100644 --- a/src/main/resources/css/RaceView.css +++ b/src/main/resources/css/RaceView.css @@ -5,6 +5,7 @@ #timerGrid{ -fx-background-color: rgba(255, 255, 255, 0.6); -fx-effect: -fx-pp-dropshadow-light; + -fx-background-radius: 5; } GridPane .timer * { @@ -27,20 +28,24 @@ GridPane .timer * { #chatHistoryHolder { -fx-background-color: rgba(255, 255, 255, 0.6); -fx-effect: -fx-pp-dropshadow-light; + -fx-background-radius: 5; } #chatInputHolder { -fx-background-color: rgba(255, 255, 255, 0.6); -fx-effect: -fx-pp-dropshadow-light; + -fx-background-radius: 5; } #windGridPane { -fx-background-color: rgba(255, 255, 255, 0.6); -fx-effect: -fx-pp-dropshadow-light; + -fx-background-radius: 5; } #windHolder { -fx-background-color: rgba(255, 255, 255, 0.5); + -fx-background-radius: 5; } #chatSend { @@ -63,4 +68,16 @@ GridPane .timer * { #windImageView { -fx-image: url("/images/wind-180.png"); +} + +#miniMapPane { + -fx-background-color: rgba(255, 255, 255, 0.6); + -fx-background-radius: 5; +} + +#miniMapButton { + -fx-background-color: rgba(255, 255, 255, 0.6); + -fx-background-radius: 5; + -fx-min-width: 30; + -fx-min-height: 30; } \ No newline at end of file diff --git a/src/main/resources/views/RaceView.fxml b/src/main/resources/views/RaceView.fxml index 4113af3a..267779f5 100644 --- a/src/main/resources/views/RaceView.fxml +++ b/src/main/resources/views/RaceView.fxml @@ -1,59 +1,54 @@ - - - - - - - + - + + - + maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" + prefHeight="800.0" prefWidth="1200.0" style="-fx-background-color: skyblue;" + xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"> + prefHeight="800.0" prefWidth="1200.0"> + prefWidth="250.0"/> - + + vgrow="SOMETIMES"/> + valignment="BOTTOM" vgrow="SOMETIMES"/> - - + + - + @@ -63,8 +58,8 @@ + preserveRatio="true" GridPane.halignment="CENTER" + GridPane.valignment="CENTER"> @@ -72,8 +67,9 @@ - - - + + - + - + - - + + - + - + - + prefWidth="100.0"/> + - + - + - + + maxHeight="35.0" minHeight="-Infinity" + prefHeight="35.0"> @@ -153,31 +160,33 @@ - + - - + + - - + + - - + - + @@ -306,12 +324,15 @@ - - + + + + - - + +