Merge remote-tracking branch 'origin/css' into css

# Conflicts:
#	racevisionGame/src/main/resources/visualiser/scenes/hostgame.fxml
main
David Wu 9 years ago
commit 28e6709890

@ -73,6 +73,11 @@ public class MainController extends Controller {
*/ */
public void hostGame(){ hostController.hostGame(); } public void hostGame(){ hostController.hostGame(); }
/**
* Sets up the css for the start of the program
*/
public void startCss(){titleController.setDayMode();}
/** /**
* Main Controller for the applications will house the menu and the displayed pane. * Main Controller for the applications will house the menu and the displayed pane.
* *

@ -5,6 +5,7 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.RadioButton;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage; import javafx.stage.Stage;
@ -24,6 +25,10 @@ public class TitleController extends Controller {
Button btnJoin; Button btnJoin;
@FXML @FXML
AnchorPane titleWrapper; AnchorPane titleWrapper;
@FXML
RadioButton dayModeRD;
@FXML
RadioButton nightModeRD;
/** /**
* Method called when the 'host a game' button is pressed. * Method called when the 'host a game' button is pressed.
@ -50,6 +55,18 @@ public class TitleController extends Controller {
parent.enterLobby(); parent.enterLobby();
} }
public void setDayMode(){
dayModeRD.getScene().getStylesheets().clear();
dayModeRD.getScene().getStylesheets().add("/css/dayMode.css");
nightModeRD.setSelected(false);
}
public void setNightMode(){
nightModeRD.getScene().getStylesheets().clear();
nightModeRD.getScene().getStylesheets().add("/css/nightMode.css");
dayModeRD.setSelected(false);
}
@Override @Override
public void initialize(URL location, ResourceBundle resources) { public void initialize(URL location, ResourceBundle resources) {

@ -37,7 +37,7 @@ public class App extends Application {
}); });
FXMLLoader loader = new FXMLLoader(getClass().getResource("/visualiser/scenes/main.fxml")); FXMLLoader loader = new FXMLLoader(getClass().getResource("/visualiser/scenes/main.fxml"));
Parent root = loader.load(); Parent root = loader.load();
stage.setResizable(false); // stage.setResizable(false);
MainController mc = (MainController) loader.getController(); MainController mc = (MainController) loader.getController();
mc.enterTitle(); mc.enterTitle();
Scene scene = new Scene(root); Scene scene = new Scene(root);
@ -45,6 +45,7 @@ public class App extends Application {
stage.setScene(scene); stage.setScene(scene);
stage.setTitle("RaceVision - Team 7"); stage.setTitle("RaceVision - Team 7");
stage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/SailIcon.png"))); stage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/SailIcon.png")));
mc.startCss();
stage.show(); stage.show();
} }
} }

@ -11,9 +11,9 @@
-fx-control-inner-background-alt: derive(-fx-control-inner-background, 10%); -fx-control-inner-background-alt: derive(-fx-control-inner-background, 10%);
/* text colors depending on background's brightness */ /* text colors depending on background's brightness */
-fx-light-text-color: rgb(220, 220, 220); -fx-light-text-color: rgb(80, 80, 80);
-fx-mid-text-color: rgb(100, 100, 100); -fx-mid-text-color: rgb(20, 20, 20);
-fx-dark-text-color: rgb(20, 20, 20); -fx-dark-text-color: rgb(0, 0, 0);
/*highlighting/accenting objects. */ /*highlighting/accenting objects. */
-fx-accent: rgb(128, 128, 128); -fx-accent: rgb(128, 128, 128);
@ -27,8 +27,8 @@
/* Fix derived prompt color for text fields */ /* Fix derived prompt color for text fields */
.text-input { .text-input {
-fx-prompt-text-fill: derive(-fx-control-inner-background, +50%); -fx-prompt-text-fill: derive(-fx-control-inner-background, +0%);
-fx-background-color: #a9a9a9 , black , black;
} }
/* Keep prompt invisible when focused (above color fix overrides it) */ /* Keep prompt invisible when focused (above color fix overrides it) */

@ -27,7 +27,8 @@
/* Fix derived prompt color for text fields */ /* Fix derived prompt color for text fields */
.text-input { .text-input {
-fx-prompt-text-fill: derive(-fx-control-inner-background, +50%); -fx-prompt-text-fill: derive(-fx-control-inner-background, +0%);
-fx-background-color: #a9a9a9 , white , white;
} }

@ -7,7 +7,7 @@
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<AnchorPane fx:id="hostWrapper" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="780.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.HostController"> <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" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.HostController">
<children> <children>
<GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints> <columnConstraints>
@ -21,8 +21,8 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<children> <children>
<TextField fx:id="gameAddressFld" promptText="Enter Address" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.valignment="TOP" /> <TextField fx:id="gameNameField" disable="true" promptText="Enter game name" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.valignment="TOP" />
<TextField fx:id="gamePortFld" promptText="Enter Port" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.valignment="BOTTOM" /> <TextField fx:id="hostNameField" disable="true" promptText="Enter host name" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.valignment="BOTTOM" />
<Button fx:id="hostGameBtn" mnemonicParsing="false" onAction="#hostGamePressed" text="Host Game" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2"> <Button fx:id="hostGameBtn" mnemonicParsing="false" onAction="#hostGamePressed" text="Host Game" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2">
<font> <font>
<Font size="20.0" /> <Font size="20.0" />

@ -15,7 +15,7 @@
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?> <?import javafx.scene.text.Text?>
<AnchorPane fx:id="titleWrapper" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.TitleController"> <AnchorPane fx:id="titleWrapper" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.TitleController">
<children> <children>
<GridPane layoutY="39.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="800.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <GridPane layoutY="39.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="800.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints> <columnConstraints>
@ -45,6 +45,8 @@
<Font name="Comic Sans MS" size="12.0" /> <Font name="Comic Sans MS" size="12.0" />
</font> </font>
</Text> </Text>
<RadioButton fx:id="nightModeRD" layoutX="681.0" layoutY="168.0" mnemonicParsing="false" onAction="#setNightMode" text="Night Mode" />
<RadioButton fx:id="dayModeRD" layoutX="574.0" layoutY="168.0" mnemonicParsing="false" onAction="#setDayMode" selected="true" text="Day Mode" />
</children> </children>
</Pane> </Pane>
<Pane prefHeight="20.0" prefWidth="20.0" style="-fx-background-color: #6be6ff;" GridPane.columnSpan="4" GridPane.rowSpan="4"> <Pane prefHeight="20.0" prefWidth="20.0" style="-fx-background-color: #6be6ff;" GridPane.columnSpan="4" GridPane.rowSpan="4">
@ -59,7 +61,7 @@
<Image url="@../images/cloud.png" /> <Image url="@../images/cloud.png" />
</image> </image>
</ImageView> </ImageView>
<ImageView fx:id="imgWhale" fitHeight="113.0" fitWidth="98.0" layoutX="68.0" layoutY="257.0" pickOnBounds="true" preserveRatio="true"> <ImageView fx:id="imgWhale" fitHeight="113.0" fitWidth="98.0" layoutX="69.0" layoutY="302.0" pickOnBounds="true" preserveRatio="true">
<image> <image>
<Image url="@../images/whale.png" /> <Image url="@../images/whale.png" />
</image> </image>

Loading…
Cancel
Save