Class RecipeFrame

java.lang.Object
edu.ntnu.stud.controller.framecontroller.RecipeFrame

public class RecipeFrame extends Object
A frame that displays a recipe with its name, steps, image and ingredients. The frame also contains a button to add the recipe to the shopping list.
  • Constructor Details

    • RecipeFrame

      public RecipeFrame()
      Constructor for the RecipeFrame class. Loads the fxml file and initializes the ingredients frame. A new instance of an IngredientsFrame is created to be able to use the ItemListFrame class' methods.
  • Method Details

    • setContent

      public void setContent(String name, String steps, String imagePath, Collection<javafx.util.Pair<String,String>> ingredients)
      Sets the content of the recipe frame with the given name, steps, image and ingredients.
      Parameters:
      name - the name of the recipe
      steps - the steps of the recipe
      imagePath - the path to the image of the recipe
      ingredients - the ingredients of the recipe
    • getRecipeFrame

      public javafx.scene.layout.StackPane getRecipeFrame()
      Returns the frame of the recipe.
      Returns:
      the frame of the recipe
    • getAddtoShoppingListButton

      public javafx.scene.control.Button getAddtoShoppingListButton()
      Returns the button to add the recipe to the shopping list.
      Returns:
      the button to add the recipe to the shopping list