java.lang.Object
javafx.application.Application
com.example.cab302project.HelloApplication
public class HelloApplication
extends javafx.application.Application
The main entry point for the RADIUS JavaFX application.
This class handles the initial window setup, global configuration constants,
and maintains the singleton-style database access point for the entire application.
It also manages the lifecycle of the local tile proxy server, which is required
for reliable OSM map tile loading on both macOS and Windows via JavaFX WebView.
-
Nested Class Summary
Nested classes/interfaces inherited from class javafx.application.Application
javafx.application.Application.Parameters -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IAppDAOThe shared Data Access Object instance used across the application.static final intThe default height of the application window in pixels.static final StringThe display title of the application window.static final intThe default width of the application window in pixels.Fields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENA -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class javafx.application.Application
getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet
-
Field Details
-
TITLE
The display title of the application window.- See Also:
-
WIDTH
public static final int WIDTHThe default width of the application window in pixels.- See Also:
-
HEIGHT
public static final int HEIGHTThe default height of the application window in pixels.- See Also:
-
DATABASE
The shared Data Access Object instance used across the application. All controllers should reference this static instance to interact with the database.
-
-
Constructor Details
-
HelloApplication
public HelloApplication()
-
-
Method Details
-
getTileServerPort
public static int getTileServerPort()Returns the port the local OSM tile proxy is running on. Returns -1 if the server failed to start. -
start
Initializes and displays the primary stage (window) of the application. Loads the initial login view from FXML and applies global window settings.- Specified by:
startin classjavafx.application.Application- Parameters:
stage- The primary stage for this application, onto which the scene is set.- Throws:
IOException- If the initial FXML view file cannot be located or loaded.
-
stop
public void stop()Called by the JavaFX runtime when the application is shutting down. Ensures the tile proxy server is properly stopped to free the port.- Overrides:
stopin classjavafx.application.Application
-