Class Controller
java.lang.Object
stud.ntnu.idatt1005.pantrypal.controllers.Controller
- Direct Known Subclasses:
AddRecipeController
,CookbookController
,HomeController
,LogInController
,PantryController
,ShoppingListController
The Root controller class for the application. This class is responsible for handling the logic
for that all controllers use. This is logIn and logOut functionality and navigation between
different views.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionController
(ViewManager viewManager) Creates an instance of the controller, and sets the viewManager. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the user is logged in.void
logOut()
Logs out the user and navigates to the reloads the initial application, without login.void
onNavLinkPress
(Route route) Navigates to the view the given route represents.
-
Field Details
-
viewManager
The view manager for the application.
-
-
Constructor Details
-
Controller
Creates an instance of the controller, and sets the viewManager.- Parameters:
viewManager
- The view manager for the application
-
-
Method Details
-
isLoggedIn
public boolean isLoggedIn()Checks if the user is logged in.- Returns:
- true if the user is logged in, false otherwise
-
logOut
public void logOut()Logs out the user and navigates to the reloads the initial application, without login.