Class RecipeFrame
java.lang.Object
edu.ntnu.stud.controller.framecontroller.RecipeFrame
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.control.Button
Returns the button to add the recipe to the shopping list.javafx.scene.layout.StackPane
Returns the frame of the recipe.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.
-
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 recipesteps
- the steps of the recipeimagePath
- the path to the image of the recipeingredients
- 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
-