Commit 47c82856 authored by Louis  Jimenez-Hernandez's avatar Louis Jimenez-Hernandez
Browse files

JavaDocs for MainScene

parent 15c40d28
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
@@ -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)
            {
@@ -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
@@ -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";