Class SceneManager
java.lang.Object
ai.tutor.cab302exceptionalhandlers.SceneManager
Manages scene navigation and controller instantiation for the application.
Scene Manager is a singleton providing a centralized point
for switching between different views in the JavaFX application.
It uses a ControllerFactory
to create controllers for each view.
Usage Example:
SceneManager.getInstance().applicationInitialize(primaryStage); SceneManager.getInstance().navigateToAuth(AuthType.LOGIN);
- Author:
- Justin.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applicationInitialize
(javafx.stage.Stage stage) Initializes the SceneManager with the primary stage.static SceneManager
Gets the singleton instance ofSceneManager
.void
navigateToAuth
(AuthType type) Navigates to the authentication view (Login or Sign Up).void
navigateToChat
(User user) Navigates to the main chat view.void
navigateToChatSetup
(User user, ChatSetupType type, Chat chat) Navigates to the chat setup view for creating or updating a chat.void
navigateToQuiz
(Quiz quiz, User user) Navigates to the quiz view.void
navigateToUserSettings
(User user) Navigates to the user settings view.
-
Method Details
-
getInstance
Gets the singleton instance ofSceneManager
.- Returns:
- The singleton instance.
- Throws:
SQLException
- if a database connection error occurs.
-
applicationInitialize
public void applicationInitialize(javafx.stage.Stage stage) Initializes the SceneManager with the primary stage. This method must be called once before application startup.- Parameters:
stage
- The primaryStage
of the application.
-