Loading src/main/java/org/example/newmat/MainScene.java +28 −1 Original line number Diff line number Diff line Loading @@ -14,11 +14,22 @@ import javafx.stage.FileChooser; import java.io.File; import java.io.IOException; /** * The main class that represents the application's main scene. */ public class MainScene extends Application { /** * The main entry point for the application. * * @param stage The primary stage for the application. * @throws Exception If an error occurs during application startup. */ @Over @Override public void start(Stage stage) throws Exception { Scene menuScene = createMenuScene(stage); //Event Handler for ESC key back to the main menu stage.addEventHandler(KeyEvent.KEY_PRESSED, event -> { if (event.getCode() == KeyCode.ESCAPE) { Loading @@ -43,6 +54,12 @@ public class MainScene extends Application { int normalObstacles = 0; int gameObstacles = 0; /** * Creates the main menu scene. * * @param stage The primary stage for the application. * @return The main menu scene. */ private Scene createMenuScene(Stage stage) { //LABELS FOR FIGURE SELECTION Loading Loading @@ -224,9 +241,19 @@ public class MainScene extends Application { return menuScene; } /** * The main entry point for the Java application. * * @param args The command line arguments. */ public static void main(String[] args) {launch(args);} //Switch statement for the text taken from the buttons /** * Determines the file path based on the selected radio button. * * @param selected The selected radio button. * @return The file path corresponding to the selected radio button. */ public String chooseFigureStr(RadioButton selected){ return switch (selected.getText()) { case "Armadillo" -> "src/armadillo.txt"; Loading Loading
src/main/java/org/example/newmat/MainScene.java +28 −1 Original line number Diff line number Diff line Loading @@ -14,11 +14,22 @@ import javafx.stage.FileChooser; import java.io.File; import java.io.IOException; /** * The main class that represents the application's main scene. */ public class MainScene extends Application { /** * The main entry point for the application. * * @param stage The primary stage for the application. * @throws Exception If an error occurs during application startup. */ @Over @Override public void start(Stage stage) throws Exception { Scene menuScene = createMenuScene(stage); //Event Handler for ESC key back to the main menu stage.addEventHandler(KeyEvent.KEY_PRESSED, event -> { if (event.getCode() == KeyCode.ESCAPE) { Loading @@ -43,6 +54,12 @@ public class MainScene extends Application { int normalObstacles = 0; int gameObstacles = 0; /** * Creates the main menu scene. * * @param stage The primary stage for the application. * @return The main menu scene. */ private Scene createMenuScene(Stage stage) { //LABELS FOR FIGURE SELECTION Loading Loading @@ -224,9 +241,19 @@ public class MainScene extends Application { return menuScene; } /** * The main entry point for the Java application. * * @param args The command line arguments. */ public static void main(String[] args) {launch(args);} //Switch statement for the text taken from the buttons /** * Determines the file path based on the selected radio button. * * @param selected The selected radio button. * @return The file path corresponding to the selected radio button. */ public String chooseFigureStr(RadioButton selected){ return switch (selected.getText()) { case "Armadillo" -> "src/armadillo.txt"; Loading