Commit 22a40a40 authored by Audrick Libraire's avatar Audrick Libraire
Browse files

[ihm-main] playerprofil fxml

parent 69bd18e9
......@@ -15,6 +15,10 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
......@@ -53,11 +57,25 @@ public class IHMMain {
primaryStage.setHeight(800);
// Load the font for the css
String path = IHMMain.class.getProtectionDomain().getCodeSource().getLocation().getPath();
String decodedPath = URLDecoder.decode(path, "UTF-8");
System.out.println("=====> " + decodedPath);
//try {
URL resource = classLoader.getResource("/styles/space_age.ttf");
File is = null;
is = new File(resource.toURI());
/*
try {
Font.loadFont(new FileInputStream(new File("./target/classes/styles/space_age.ttf")), 10);
} catch (FileNotFoundException ex) {
Logger.getLogger(PlayerListController.class.getName()).log(Level.SEVERE, null, ex);
}
FileInputStream input = new FileInputStream(is);
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}*/
//InputStream configStream = getClass().getResourceAsStream("/styles/space_age.ttf");
// Font.loadFont(new FileInputStream(new File("styles/space_age.ttf")), 10);
//} catch (FileNotFoundException ex) {
//Logger.getLogger(PlayerListController.class.getName()).log(Level.SEVERE, null, ex);
//}
//load all scenes when app starts
for(SceneName scenename : SceneName.values()){
......@@ -70,12 +88,6 @@ public class IHMMain {
toNetworkInterfaceChoice();
stage.show();
// Load the font for the css
try {
Font.loadFont(new FileInputStream(new File("./target/classes/styles/space_age.ttf")), 10);
} catch (FileNotFoundException ex) {
Logger.getLogger(PlayerListController.class.getName()).log(Level.SEVERE, null, ex);
}
//add onClose event handler which handle the event when user clicks X
stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
......
......@@ -9,7 +9,7 @@
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<!--
<GridPane alignment="CENTER" prefHeight="600.0" prefWidth="800.0" style="-fx-background-color: #061f30;" stylesheets="@../../styles/ihmmain.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.utclo23.ihmmain.controller.PlayerProfileController">
<children>
<GridPane alignment="CENTER" prefHeight="0.0" prefWidth="800.0" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
......@@ -43,13 +43,13 @@
<GridPane alignment="CENTER" prefHeight="257.0" prefWidth="282.0">
<children>
<Label alignment="CENTER" text="Nickname" />
<Label fx:id="userID" text="--" GridPane.columnIndex="1" />
<Label fx:id="userID" text="" GridPane.columnIndex="1" />
<Label text="First Name" GridPane.rowIndex="1" />
<Label fx:id="firstNameText" text="--" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="firstNameText" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Last Name" GridPane.rowIndex="2" />
<Label fx:id="lastNameText" text="--" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label fx:id="lastNameText" text="" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="Birthday" GridPane.rowIndex="3" />
<Label fx:id="birthdayText" text="--" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label fx:id="birthdayText" text="" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label text="Password" GridPane.rowIndex="4" />
<Button fx:id="playerName" mnemonicParsing="false" onAction="#edit" text="edit" GridPane.columnIndex="2" />
<Button fx:id="firstName" mnemonicParsing="false" onAction="#edit" text="edit" GridPane.columnIndex="2" GridPane.rowIndex="1" />
......@@ -73,7 +73,8 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" valignment="CENTER" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children></VBox>
</children>
</VBox>
</children>
</HBox>
</children>
......@@ -187,3 +188,207 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
-->
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="600" minWidth="800" prefHeight="768" prefWidth="1368" id="generalGrid" stylesheets="@../../styles/ihmmain.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.utclo23.ihmmain.controller.PlayerProfileController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" />
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="70.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<!-- Title -->
<Label fx:id="pageTitleLabel" textAlignment="CENTER" text="User Profile" GridPane.columnIndex="0" GridPane.halignment="CENTER" GridPane.rowIndex="0" GridPane.valignment="CENTER" />
<Line fx:id="lineDesign" endX="100.0" startX="-100.0" styleClass="lineDesign" GridPane.halignment="CENTER" GridPane.valignment="BOTTOM" />
<!-- Body -->
<GridPane GridPane.rowIndex = "2">
<columnConstraints>
<ColumnConstraints percentWidth="100.0" hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="50.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="50.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<!-- First row ( picture, edit ) -->
<GridPane GridPane.rowIndex = "0">
<columnConstraints>
<ColumnConstraints percentWidth="50.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="50.0" hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="100.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<!-- Picture -->
<GridPane GridPane.columnIndex = "0">
<columnConstraints>
<ColumnConstraints percentWidth="100.0" hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="90.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<ImageView GridPane.rowIndex="0" GridPane.halignment="center" GridPane.valignment="center" fx:id="image" fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true" />
<GridPane GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints percentWidth="35.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="30.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="35.0" hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="100.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button GridPane.columnIndex="1" maxWidth="Infinity" fx:id="avatar" mnemonicParsing="false" onAction="#editAvatar" text="Modify"/>
</children>
</GridPane>
</children>
</GridPane>
<!-- Edit -->
<GridPane GridPane.columnIndex = "1">
<columnConstraints>
<ColumnConstraints percentWidth="40.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="40.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="20.0" hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label alignment="CENTER" text="Nickname" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Label fx:id="userID" text="" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label text="First Name" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<Label fx:id="firstNameText" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Last Name" GridPane.columnIndex="0" GridPane.rowIndex="2" />
<Label fx:id="lastNameText" text="" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="Birthday" GridPane.columnIndex="0" GridPane.rowIndex="3" />
<Label fx:id="birthdayText" text="" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label text="Password" GridPane.columnIndex="0" GridPane.rowIndex="4" />
<Label fx:id="birthday1" text="******" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Button fx:id="playerName" mnemonicParsing="false" onAction="#edit" text="edit" GridPane.columnIndex="2" />
<Button fx:id="firstName" mnemonicParsing="false" onAction="#edit" text="edit" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Button fx:id="lastName" mnemonicParsing="false" onAction="#edit" text="edit" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Button fx:id="birthday" mnemonicParsing="false" onAction="#edit" text="edit" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<Button fx:id="password" mnemonicParsing="false" onAction="#edit" text="edit" GridPane.columnIndex="2" GridPane.rowIndex="4" />
</children>
</GridPane>
</children>
</GridPane>
<!-- Second row ( stats and chart ) -->
<GridPane GridPane.rowIndex = "1">
<columnConstraints>
<ColumnConstraints percentWidth="5.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="40.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="10.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="40.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="5.0" hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="7.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="90.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="3.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<!-- Stats -->
<GridPane fx:id="stat" GridPane.columnIndex = "1" GridPane.rowIndex = "1">
<columnConstraints>
<ColumnConstraints percentWidth="20.0" hgrow="SOMETIMES"/>
<ColumnConstraints halignment="CENTER" percentWidth="20.0" hgrow="SOMETIMES"/>
<ColumnConstraints halignment="CENTER" percentWidth="20.0" hgrow="SOMETIMES"/>
<ColumnConstraints halignment="CENTER" percentWidth="20.0" hgrow="SOMETIMES"/>
<ColumnConstraints halignment="CENTER" percentWidth="20.0" hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="25.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="25.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="25.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="25.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text=" Classical" GridPane.rowIndex="1"/>
<Label text=" Belgian" GridPane.rowIndex="2"/>
<Label text=" Total" GridPane.rowIndex="3"/>
<Label text="Win" GridPane.columnIndex="1" />
<Label text="Loss" GridPane.columnIndex="2" />
<Label text="Abandoned" GridPane.columnIndex="3" />
<Label text="Played" GridPane.columnIndex="4" />
</children>
</GridPane>
<!-- Charts -->
<GridPane fx:id="gridBorderChart" GridPane.columnIndex="3" GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="33.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="34.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="33.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="8.0" vgrow="SOMETIMES" />
<RowConstraints percentHeight="92.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<!-- <PieChart fx:id="allMode" minHeight="-Infinity" minWidth="-Infinity" prefHeight="120.0" prefWidth="120.0" title="All Mode" titleSide="BOTTOM" />
<PieChart fx:id="classical" minHeight="-Infinity" minWidth="-Infinity" prefHeight="120.0" prefWidth="120.0" title="Classical" titleSide="BOTTOM" GridPane.columnIndex="1" />
<PieChart fx:id="belge" minHeight="-Infinity" minWidth="-Infinity" prefHeight="120.0" prefWidth="120.0" title="Belge" titleSide="BOTTOM" GridPane.columnIndex="2" /> -->
<Label fx:id="rateAll" text="win rate:" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
<Label fx:id="rateClassic" text="win rate:" GridPane.columnIndex="1" GridPane.halignment="CENTER" />
<Label fx:id="rateBelgian" text="win rate:" GridPane.columnIndex="2" GridPane.halignment="CENTER" />
<PieChart fx:id="allMode" labelsVisible="false" legendVisible="false" minHeight="-Infinity" minWidth="-Infinity" prefHeight="238.0" prefWidth="152.0" stylesheets="@../../styles/ihmmain.css" title="All Mode" titleSide="BOTTOM" GridPane.rowIndex="1" />
<PieChart fx:id="classical" labelsVisible="false" legendVisible="false" minHeight="-Infinity" minWidth="-Infinity" prefHeight="235.0" prefWidth="156.0" stylesheets="@../../styles/ihmmain.css" title="Classical" titleSide="BOTTOM" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<PieChart fx:id="belge" labelsVisible="false" legendVisible="false" minHeight="-Infinity" minWidth="-Infinity" prefHeight="234.0" prefWidth="146.0" stylesheets="@../../styles/ihmmain.css" title="Belgian" titleSide="BOTTOM" GridPane.columnIndex="2" GridPane.rowIndex="1" />
</children>
</GridPane>
</children>
</GridPane>
</children>
</GridPane>
<!-- Button -->
<GridPane GridPane.rowIndex = "3">
<columnConstraints>
<ColumnConstraints percentWidth="30.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="15.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="10.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="15.0" hgrow="SOMETIMES"/>
<ColumnConstraints percentWidth="30.0" hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="100.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button GridPane.columnIndex="3" maxWidth="Infinity" fx:id="backButton" mnemonicParsing="false" onAction="#back" text="Return" GridPane.halignment="LEFT" GridPane.valignment="CENTER"/>
<Button GridPane.columnIndex="1" maxWidth="Infinity" fx:id="playerList" mnemonicParsing="false" onAction="#toPlayerList" text="Other Player" GridPane.valignment="CENTER" />
</children>
</GridPane>
</children>
</GridPane>
......@@ -228,7 +228,12 @@
-fx-border-color: #ef8d00;
}
#statGrid {
#stat {
-fx-border-radius: 15px;
-fx-border-color: #ef8d00;
}
#gridBorderChart {
-fx-border-radius: 15px;
-fx-border-color: #ef8d00;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment