Class HelloApplication

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

    Fields
    Modifier and Type
    Field
    Description
    static final IAppDAO
    The shared Data Access Object instance used across the application.
    static final int
    The default height of the application window in pixels.
    static final String
    The display title of the application window.
    static final int
    The default width of the application window in pixels.

    Fields inherited from class javafx.application.Application

    STYLESHEET_CASPIAN, STYLESHEET_MODENA
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    Returns the port the local OSM tile proxy is running on.
    void
    start(javafx.stage.Stage stage)
    Initializes and displays the primary stage (window) of the application.
    void
    Called by the JavaFX runtime when the application is shutting down.

    Methods inherited from class javafx.application.Application

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

    Methods inherited from class java.lang.Object

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

    • TITLE

      public static final String TITLE
      The display title of the application window.
      See Also:
    • WIDTH

      public static final int WIDTH
      The default width of the application window in pixels.
      See Also:
    • HEIGHT

      public static final int HEIGHT
      The default height of the application window in pixels.
      See Also:
    • DATABASE

      public static final IAppDAO 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

      public void start(javafx.stage.Stage stage) throws IOException
      Initializes and displays the primary stage (window) of the application. Loads the initial login view from FXML and applies global window settings.
      Specified by:
      start in class javafx.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:
      stop in class javafx.application.Application