Package edu.ntnu.idi.idatt
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic void
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
-
Constructor Details
-
MainApp
public MainApp()
-
-
Method Details
-
main
The main method, which serves as the entry point for the Java application. It callsApplication.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 bymain(String[])
and the system is ready for the application to begin running.It initializes the
AppView
andViewNavigator
, sets up the root layout (aBorderPane
), shows the initial game selection view, creates the main scene with global stylesheets, and configures the primary stage (window).- Specified by:
start
in classjavafx.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 theAppView
as the center content of the root layout and then uses theViewNavigator
to switch to theViewType.GAME_SELECTION
view.
-