Application Startup Management
Documentation for ProjectHub's application startup process, detailing initialization sequences, resource loading, and view setup procedures.
UI Component Hierarchy
graph TD
%% Main Components
Root[BorderPane: Root]
Stage[Stage: MainStage]
Scene[Scene: MainScene]
Resources[ResourceBundle]
Styles[StylesheetManager]
%% View Components
NavDrawer[VBox: NavigationDrawer]
AppBar[HBox: AppBar]
Content[StackPane: Content]
StatusBar[HBox: StatusBar]
%% Hierarchy
Stage --> Scene
Scene --> Root
Root --> Resources
Root --> Styles
Root --> NavDrawer
Root --> AppBar
Root --> Content
Root --> StatusBar
%% Resource Management
Resources --> Messages[i18n.messages]
Resources --> Config[app.config]
Styles --> Theme[theme.css]
%% Styling
classDef container fill:#e1f5fe,stroke:#01579b
classDef component fill:#fff,stroke:#0288d1
classDef resource fill:#e8f5e9,stroke:#2e7d32
class Stage,Scene,Root container
class NavDrawer,AppBar,Content,StatusBar component
class Resources,Styles,Messages,Config,Theme resource
Application Startup Sequence
sequenceDiagram
participant App as MainApp
participant Stage as MainStage
participant View as MainView
participant Controller as MainViewController
participant Resources as ResourceBundle
participant CSS as StylesheetManager
Note over App,Resources: Application Startup Phase
App->>Resources: getBundle("i18n.messages")
Resources-->>App: ResourceBundle
Note over App,Stage: View Initialization
App->>Stage: new Stage()
App->>View: loadMainView()
View->>Controller: initialize()
par Resource Loading
Controller->>Resources: loadMessages()
Resources-->>Controller: i18n strings
Controller->>CSS: loadStyles()
CSS-->>Controller: stylesheets
end
Note over Controller: View Setup
Controller->>Controller: setupNavigation()
Controller->>Controller: setupAppBar()
Controller->>Controller: initializeContent()
Note over App,Stage: Display
App->>Stage: setScene()
App->>Stage: show()
Stage-->>App: viewReady
Note over App: Error Handling
alt Loading Error
App->>App: logError()
App->>Stage: showErrorDialog()
end
Data Dictionary
Key components and their responsibilities in the application startup process.
Core Components
Component | Type | Description |
---|---|---|
MainApp | Application | Main application class that initiates the startup sequence. |
MainView | FXML View | Root view container for the application UI. |
MainViewController | Controller | Controls main view behavior and navigation. |
ResourceBundle | Resource Manager | Manages internationalization resources. |
StylesheetManager | Style Manager | Handles application styling and themes. |
Configuration Properties
Property | Type | Description |
---|---|---|
i18n.messages | Properties | Internationalization string resources. |
app.config | Properties | Application configuration settings. |
theme.css | Stylesheet | Custom application styling. |
Startup Process Explanation
- Resource Loading: Initializes application resources including internationalization bundles and configuration properties.
- View Initialization: Loads the main FXML view and establishes controller bindings.
- Style Application: Applies both Gluon framework styles and custom application themes.
- Error Handling: Implements graceful error handling during startup with user notifications.
- Navigation Setup: Configures the navigation drawer and main content area for the application.