Class RecipeLibraryPage

java.lang.Object
edu.ntnu.stud.idatt1005.team3.view.pages.RecipeLibraryPage
All Implemented Interfaces:
ObserverDB

public class RecipeLibraryPage extends Object implements ObserverDB
The recipe library page of the application. The recipe library page is where the user can view all the recipes they have saved in the application.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs the recipe library page of the application.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addRecipeCard(RecipeCard recipeCard, javafx.scene.layout.VBox col1, javafx.scene.layout.VBox col2, javafx.scene.layout.VBox col3)
    Adds a recipe card to the recipe library page.
    void
    clearRecipeCards(javafx.scene.layout.VBox col1, javafx.scene.layout.VBox col2, javafx.scene.layout.VBox col3)
    Clears all recipe cards from the recipe library page.
    javafx.scene.Scene
    Creates a scene for the recipe library page.
    javafx.scene.layout.StackPane
    Returns the root node of the recipe library page.
    Returns the scene controller for the application.
    void
    handleUpdate(Recipe recipe, int updateType, SceneController sceneController, javafx.scene.layout.VBox col1, javafx.scene.layout.VBox col2, javafx.scene.layout.VBox col3)
    Handles the update of the recipe library page when database is updated.
    void
    removeRecipeCard(RecipeCard recipeCard, javafx.scene.layout.VBox col1, javafx.scene.layout.VBox col2, javafx.scene.layout.VBox col3)
    Removes a recipe card from the recipe library page.
    void
    Updates the recipe library page when the database is updated.
    void
    Updates the columns of the recipe library page.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RecipeLibraryPage

      public RecipeLibraryPage(SceneController sceneController, TheCookbookDB db) throws FileNotFoundException
      Constructs the recipe library page of the application.
      Parameters:
      sceneController - The scene controller controlling the switching between scenes.
      db - The database controller for the application.
      Throws:
      FileNotFoundException - If the stylesheet file is not found.
  • Method Details

    • getRoot

      public javafx.scene.layout.StackPane getRoot()
      Returns the root node of the recipe library page.
      Returns:
      Returns the root node of the recipe library page.
    • createScene

      public javafx.scene.Scene createScene()
      Creates a scene for the recipe library page.
      Returns:
      Returns the scene for the recipe library page.
    • getSceneController

      public SceneController getSceneController()
      Returns the scene controller for the application.
      Returns:
      Returns the scene controller for the application.
    • addRecipeCard

      public void addRecipeCard(RecipeCard recipeCard, javafx.scene.layout.VBox col1, javafx.scene.layout.VBox col2, javafx.scene.layout.VBox col3)
      Adds a recipe card to the recipe library page.
      Parameters:
      recipeCard - The recipe card to be added.
      col1 - The first column of recipe cards.
      col2 - The second column of recipe cards.
      col3 - The third column of recipe cards.
    • removeRecipeCard

      public void removeRecipeCard(RecipeCard recipeCard, javafx.scene.layout.VBox col1, javafx.scene.layout.VBox col2, javafx.scene.layout.VBox col3)
      Removes a recipe card from the recipe library page.
      Parameters:
      recipeCard - The recipe card to be removed.
      col1 - The first column of recipe cards.
      col2 - The second column of recipe cards.
      col3 - The third column of recipe cards.
    • clearRecipeCards

      public void clearRecipeCards(javafx.scene.layout.VBox col1, javafx.scene.layout.VBox col2, javafx.scene.layout.VBox col3)
      Clears all recipe cards from the recipe library page.
      Parameters:
      col1 - The first column of recipe cards.
      col2 - The second column of recipe cards.
      col3 - The third column of recipe cards.
    • handleUpdate

      public void handleUpdate(Recipe recipe, int updateType, SceneController sceneController, javafx.scene.layout.VBox col1, javafx.scene.layout.VBox col2, javafx.scene.layout.VBox col3)
      Handles the update of the recipe library page when database is updated.
      Parameters:
      recipe - The recipe to be updated.
      updateType - The type of update.
      sceneController - The scene controller for the application.
      col1 - The first column of recipe cards.
      col2 - The second column of recipe cards.
      col3 - The third column of recipe cards.
    • updateColumns

      public void updateColumns()
      Updates the columns of the recipe library page.
    • update

      public void update()
      Updates the recipe library page when the database is updated.
      Specified by:
      update in interface ObserverDB