diff --git a/HangmanFx/.classpath b/HangmanFx/.classpath index ee00ee8..0b76434 100644 --- a/HangmanFx/.classpath +++ b/HangmanFx/.classpath @@ -1,6 +1,7 @@ + diff --git a/HangmanFx/src/application/BloodBlocks.ttf b/HangmanFx/src/application/BloodBlocks.ttf new file mode 100644 index 0000000..567592c Binary files /dev/null and b/HangmanFx/src/application/BloodBlocks.ttf differ diff --git a/HangmanFx/src/application/HangmanPreload.java b/HangmanFx/src/application/HangmanPreload.java index 07f318b..98a99ab 100644 --- a/HangmanFx/src/application/HangmanPreload.java +++ b/HangmanFx/src/application/HangmanPreload.java @@ -1,6 +1,7 @@ package application; import javafx.application.Preloader; +import javafx.application.Preloader.StateChangeNotification; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; @@ -27,6 +28,18 @@ public class HangmanPreload extends Preloader { } + @Override + public void handleStateChangeNotification(Preloader.StateChangeNotification info) { + + StateChangeNotification.Type type = info.getType(); + switch (type) { + + case BEFORE_START: + // Called after MyApplication#init and before MyApplication#start is called. + System.out.println("BEFORE_START"); + preloaderStage.hide(); + break; + } } - +} diff --git a/HangmanFx/src/application/Main.java b/HangmanFx/src/application/Main.java index cd1d0b1..b162cce 100644 --- a/HangmanFx/src/application/Main.java +++ b/HangmanFx/src/application/Main.java @@ -1,25 +1,33 @@ package application; import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.URL; import java.util.ArrayList; import java.util.Random; +import java.util.ResourceBundle; import com.sun.javafx.application.LauncherImpl; import javafx.application.Application; import javafx.application.Preloader; +import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.stage.Stage; import javafx.scene.Parent; import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.control.ProgressBar; import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.scene.image.ImageView; +import javafx.scene.text.Font; import javafx.scene.text.Text; public class Main extends Application { @@ -33,7 +41,32 @@ public class Main extends Application { TextField textField; @FXML Text info; - + @FXML + Label zuErratendesWort; + @FXML + private Label progress; + + public static Label label; + + + @FXML + private ProgressBar progressBar; + + public static ProgressBar statProgressBar; + + @FXML + private void handleButtonAction(ActionEvent event) { + + + } + + public void initialize(URL url, ResourceBundle rb) { + label = progress ; + statProgressBar = progressBar; + } + private static final int COUNT_LIMIT = 10; + + String wort; String rightletterString; @@ -49,10 +82,13 @@ public class Main extends Application { Scene scene = new Scene(root); scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm()); + + primaryStage.setScene(scene); primaryStage.setTitle("****HANGMAN****"); primaryStage.show(); - + + } catch (Exception e) { e.printStackTrace(); @@ -127,7 +163,21 @@ public class Main extends Application { return temp.get(random.nextInt(temp.size())).toString(); } + @Override + public void init() throws Exception { + + // Perform some heavy lifting (i.e. database start, check for application updates, etc. ) + for (int i = 1; i <= COUNT_LIMIT; i++) { + double progress = (double) i/10; + System.out.println("progress: " + progress); + LauncherImpl.notifyPreloader(this, new Preloader.ProgressNotification(progress)); + Thread.sleep(250); + } + + } + + diff --git a/HangmanFx/src/application/Ui.fxml b/HangmanFx/src/application/Ui.fxml index 54d768f..eb693ed 100644 --- a/HangmanFx/src/application/Ui.fxml +++ b/HangmanFx/src/application/Ui.fxml @@ -1,7 +1,15 @@ + + + + + + + + @@ -9,33 +17,66 @@ - + + + + + + + + + - + - + + + + - + + - + + + + - - - - - - + + diff --git a/HangmanFx/src/application/application.css b/HangmanFx/src/application/application.css index 83d6f33..d3d84a6 100644 --- a/HangmanFx/src/application/application.css +++ b/HangmanFx/src/application/application.css @@ -1 +1,9 @@ -/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */ \ No newline at end of file +/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */ +@font-face { + font-family: BloodBlocks; + src: url('BloodBlocks.ttf'); +} +.label{ + -fx-font-family: 'BloodBlocks'; + -fx-font-size: 60; +} \ No newline at end of file diff --git a/HangmanFx/src/images/1.png b/HangmanFx/src/images/1.png index 36906e4..0261dd5 100644 Binary files a/HangmanFx/src/images/1.png and b/HangmanFx/src/images/1.png differ diff --git a/HangmanFx/src/images/10.png b/HangmanFx/src/images/10.png index c0fa61f..0eb2924 100644 Binary files a/HangmanFx/src/images/10.png and b/HangmanFx/src/images/10.png differ diff --git a/HangmanFx/src/images/11.png b/HangmanFx/src/images/11.png index aed95c9..f06d6dc 100644 Binary files a/HangmanFx/src/images/11.png and b/HangmanFx/src/images/11.png differ diff --git a/HangmanFx/src/images/12.png b/HangmanFx/src/images/12.png index 8db3683..3e065c1 100644 Binary files a/HangmanFx/src/images/12.png and b/HangmanFx/src/images/12.png differ diff --git a/HangmanFx/src/images/13.png b/HangmanFx/src/images/13.png index a872778..07c4e37 100644 Binary files a/HangmanFx/src/images/13.png and b/HangmanFx/src/images/13.png differ diff --git a/HangmanFx/src/images/14.png b/HangmanFx/src/images/14.png index 615d91c..03b35d3 100644 Binary files a/HangmanFx/src/images/14.png and b/HangmanFx/src/images/14.png differ diff --git a/HangmanFx/src/images/15.png b/HangmanFx/src/images/15.png index 701e034..a79794b 100644 Binary files a/HangmanFx/src/images/15.png and b/HangmanFx/src/images/15.png differ diff --git a/HangmanFx/src/images/2.png b/HangmanFx/src/images/2.png index 9a806d4..91399a9 100644 Binary files a/HangmanFx/src/images/2.png and b/HangmanFx/src/images/2.png differ diff --git a/HangmanFx/src/images/3.png b/HangmanFx/src/images/3.png index e2a8a7c..23eb3d0 100644 Binary files a/HangmanFx/src/images/3.png and b/HangmanFx/src/images/3.png differ diff --git a/HangmanFx/src/images/4.png b/HangmanFx/src/images/4.png index 482185d..ca7d124 100644 Binary files a/HangmanFx/src/images/4.png and b/HangmanFx/src/images/4.png differ diff --git a/HangmanFx/src/images/5.png b/HangmanFx/src/images/5.png index 89be5db..a988550 100644 Binary files a/HangmanFx/src/images/5.png and b/HangmanFx/src/images/5.png differ diff --git a/HangmanFx/src/images/6.png b/HangmanFx/src/images/6.png index d05e579..44040a8 100644 Binary files a/HangmanFx/src/images/6.png and b/HangmanFx/src/images/6.png differ diff --git a/HangmanFx/src/images/7.png b/HangmanFx/src/images/7.png index ff1c91b..691bc7d 100644 Binary files a/HangmanFx/src/images/7.png and b/HangmanFx/src/images/7.png differ diff --git a/HangmanFx/src/images/8.png b/HangmanFx/src/images/8.png index 3bf2f9f..b677415 100644 Binary files a/HangmanFx/src/images/8.png and b/HangmanFx/src/images/8.png differ diff --git a/HangmanFx/src/images/9.png b/HangmanFx/src/images/9.png index c54ce9f..8d1e1d8 100644 Binary files a/HangmanFx/src/images/9.png and b/HangmanFx/src/images/9.png differ diff --git a/HangmanFx/src/images/bg.jpg b/HangmanFx/src/images/bg.jpg new file mode 100644 index 0000000..0a37c9c Binary files /dev/null and b/HangmanFx/src/images/bg.jpg differ