public class ControllerMaster
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Controller |
currentController |
private HelpController |
helpController |
private javafx.scene.Scene |
scene
The main scene of the application
|
private Session |
session
Contains the information about the logged in user
|
Constructor and Description |
---|
ControllerMaster(javafx.scene.Scene scene) |
Modifier and Type | Method and Description |
---|---|
private void |
closeHelp()
Closes the Help view
|
javafx.scene.Scene |
getScene() |
User |
getUser() |
java.lang.String |
getUserName() |
Position |
getUserPosition() |
boolean |
isHelpOpen()
Checks if the help is screen is opened
|
void |
onArticlesImport(Shop targetShop)
Shows the Importation view
|
void |
onBestRouteAlgoReady(GroceryList list)
Shows the best route.
|
void |
onCloseSelectGroceryListView()
Removes start and destination pin of best tour.
|
void |
onGroceryListGenerated(java.lang.String recipeName)
Called when a grocery List has been generated from a recipe
|
void |
onLogin(Session newSession)
Sets the session to newSession and then shows the map
|
void |
onLogout()
Closes the help, reset the session and the cryptography
Then, shows the login screen
|
void |
onRegister()
Show Login
|
void |
onShowAddProduct(ProductCreationObserver observer)
Shows the add product view
|
void |
onShowAllGroceryLists()
Shows all the grocery lists of the connected user
|
void |
onShowAllRecipes()
Shows all the recipes of the connected user
|
void |
onShowEditProfile()
Shows the edit profile view
|
void |
onShowGroceryList(java.lang.String listName)
Shows the groceryList view
|
void |
onShowGroceryListSelector()
Shows the view to select a grocery list for a Best Tour.
|
void |
onShowHelp(HelpPage helpPage)
Shows the help view in a new stage
|
void |
onShowLogin()
Shows the login view
|
void |
onShowMap()
Shows the map view.
|
void |
onShowRecipe(java.lang.String recipeName)
Shows the recipe view
|
void |
onShowRegister()
Shows the register view
|
void |
onUserClosedHelp()
Called when the user close the help screen
|
private void |
setCurrentController(Controller controller) |
private void |
setSession(Session session) |
void |
setUser(User user) |
private void |
showLogin() |
void |
showResultsScreen(GroceryList groceryList,
Position position)
Shows the result view
|
void |
updateUserPosition(Position position)
Updates the position of the user in the Session
|
private javafx.scene.Scene scene
private Controller currentController
private HelpController helpController
private Session session
public javafx.scene.Scene getScene()
public void onLogout()
public void onLogin(Session newSession)
newSession
- private void setSession(Session session)
public void onRegister()
public void onShowLogin()
private void showLogin()
private void setCurrentController(Controller controller)
public void onShowRegister()
public void onShowMap()
public void onShowEditProfile()
public void onShowAddProduct(ProductCreationObserver observer)
public void showResultsScreen(GroceryList groceryList, Position position)
groceryList
- position
- public void onShowAllGroceryLists()
public void onShowHelp(HelpPage helpPage)
helpPage
- private void closeHelp()
public void onUserClosedHelp()
public boolean isHelpOpen()
public void onShowAllRecipes()
public void onShowRecipe(java.lang.String recipeName) throws NoSuchRecipeException, RecipeCreationException
public void onGroceryListGenerated(java.lang.String recipeName)
recipeName
- The name of the recipepublic void onShowGroceryList(java.lang.String listName)
listName
- public void onShowGroceryListSelector()
public void onBestRouteAlgoReady(GroceryList list)
list
- The grocery list used for the Best Tourpublic void onCloseSelectGroceryListView()
public void onArticlesImport(Shop targetShop)
targetShop
- The shop in which the articles will be importedpublic void updateUserPosition(Position position)
position
- The new Positionpublic Position getUserPosition()
public User getUser()
public void setUser(User user)
public java.lang.String getUserName()