Commit d5e2a439 authored by Audrick Libraire's avatar Audrick Libraire
Browse files

[ihm-main] playerprofil fxml

parent 039b54d7
...@@ -15,6 +15,10 @@ import java.io.File; ...@@ -15,6 +15,10 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; 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.HashMap;
import java.util.Map; import java.util.Map;
import java.util.logging.Level; import java.util.logging.Level;
...@@ -53,11 +57,25 @@ public class IHMMain { ...@@ -53,11 +57,25 @@ public class IHMMain {
primaryStage.setHeight(800); primaryStage.setHeight(800);
// Load the font for the css // Load the font for the css
try { String path = IHMMain.class.getProtectionDomain().getCodeSource().getLocation().getPath();
Font.loadFont(new FileInputStream(new File("./target/classes/styles/space_age.ttf")), 10); String decodedPath = URLDecoder.decode(path, "UTF-8");
} catch (FileNotFoundException ex) { System.out.println("=====> " + decodedPath);
Logger.getLogger(PlayerListController.class.getName()).log(Level.SEVERE, null, ex); //try {
} URL resource = classLoader.getResource("/styles/space_age.ttf");
File is = null;
is = new File(resource.toURI());
/*
try {
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 //load all scenes when app starts
for(SceneName scenename : SceneName.values()){ for(SceneName scenename : SceneName.values()){
...@@ -69,13 +87,7 @@ public class IHMMain { ...@@ -69,13 +87,7 @@ public class IHMMain {
primaryStage.setTitle("Battle Ship"); primaryStage.setTitle("Battle Ship");
toNetworkInterfaceChoice(); toNetworkInterfaceChoice();
stage.show(); 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 //add onClose event handler which handle the event when user clicks X
stage.setOnCloseRequest(new EventHandler<WindowEvent>() { stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override @Override
......
...@@ -228,7 +228,12 @@ ...@@ -228,7 +228,12 @@
-fx-border-color: #ef8d00; -fx-border-color: #ef8d00;
} }
#statGrid { #stat {
-fx-border-radius: 15px; -fx-border-radius: 15px;
-fx-border-color: #ef8d00; -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