Class MainApp

java.lang.Object
javafx.application.Application
edu.ntnu.idi.idatt.MainApp

public class MainApp extends javafx.application.Application
MainApp.

The main entry point for the board game application. This class extends Application and is responsible for initializing the primary stage, setting up the main scene with global styles, and managing the overall application flow through a ViewNavigator and an AppView container.

Upon starting, it configures the main window, loads the initial game selection screen, and makes the application visible.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class javafx.application.Application

    javafx.application.Application.Parameters
  • Field Summary

    Fields inherited from class javafx.application.Application

    STYLESHEET_CASPIAN, STYLESHEET_MODENA
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    The main method, which serves as the entry point for the Java application.
    void
    Navigates the application to display the game selection screen.
    void
    start(javafx.stage.Stage primaryStage)
    The main entry point.

    Methods inherited from class javafx.application.Application

    getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MainApp

      public MainApp()
  • Method Details

    • main

      public static void main(String[] args)
      The main method, which serves as the entry point for the Java application. It calls Application.launch(String...) to start the JavaFX application lifecycle.
      Parameters:
      args - Command line arguments passed to the application (not used in this app).
    • start

      public void start(javafx.stage.Stage primaryStage)
      The main entry point. This method is called after the application has been launched by main(String[]) and the system is ready for the application to begin running.

      It initializes the AppView and ViewNavigator, sets up the root layout (a BorderPane), shows the initial game selection view, creates the main scene with global stylesheets, and configures the primary stage (window).

      Specified by:
      start in class javafx.application.Application
      Parameters:
      primaryStage - The primary stage for this application, onto which the application scene can be set.
    • showGameSelection

      public void showGameSelection()
      Navigates the application to display the game selection screen. It sets the AppView as the center content of the root layout and then uses the ViewNavigator to switch to the ViewType.GAME_SELECTION view.