java.lang.Object
stud.ntnu.idatt1005.pantrypal.utils.ViewManager
The ViewManager class is responsible for managing the views in the application.
It keeps track of the views and provides methods for adding, removing, and setting views.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionViewManager
(javafx.stage.Stage stage) Constructs a new ViewManager with a given stage. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a view to the view manager.Gets the current view of the application.void
init()
Initializes the controllers and views for the application.void
removeView
(Route route) Removes a view from the view manager.void
Sets the view of the application to a given route.
-
Field Details
-
stage
private final javafx.stage.Stage stage -
views
-
-
Constructor Details
-
ViewManager
public ViewManager(javafx.stage.Stage stage) Constructs a new ViewManager with a given stage.- Parameters:
stage
- The stage for the application.
-
-
Method Details
-
init
public void init()Initializes the controllers and views for the application. -
addView
Adds a view to the view manager.- Parameters:
route
- The route of the view.view
- The view to add.
-
removeView
Removes a view from the view manager.- Parameters:
route
- The route of the view to remove.
-
setView
Sets the view of the application to a given route.- Parameters:
route
- The route of the view to set.
-
getCurrentView
Gets the current view of the application.- Returns:
- The current view.
-