Class RecipeController

java.lang.Object
no.ntnu.idatt1002.demo.controller.RecipeController

public class RecipeController extends Object
The RecipeController manages the view Recipe.fxml that displays one particular recipe in full detail. It has the recipe's name as headline, lists the ingredients of the recipe in a scroll pane to the left and the instructions in a scroll pane to the right.
Author:
hannesofie
  • Constructor Details

    • RecipeController

      public RecipeController()
  • Method Details

    • setData

      public void setData(Recipe recipeOfInterest)
      The setData method takes a Recipe object as parameter and sets the information of the view accordingly. Specifically, the recipe name is set as headline, it's ingredients are stored in an ObservableList and it's instructions are set as text in the scroll pane to the right. Finally, the method 'setIngredientTiles' is called to fill the ingredient list with the component IngredientTile for each ingredient.
      Parameters:
      recipeOfInterest - A Recipe object to present in full detail on the Recipe.fxml view.