Class RecipeTileController

java.lang.Object
no.ntnu.idatt1002.demo.controller.RecipeTileController
All Implemented Interfaces:
javafx.fxml.Initializable

public class RecipeTileController extends Object implements javafx.fxml.Initializable
The RecipeTileController manages the tile components that are used to dynamically display a set of recommended recipes in terms of their name and number of missing ingredients. Each tile is a VBox containing this information.
Author:
hannesofie
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    initialize(URL url, ResourceBundle resourceBundle)
    The initialize method of the controller takes in a URL (location) and ResourceBundle(resources) to initialize the controller once its root element has been processed.
    void
    setData(Recipe recipe)
    The setData method takes in a Recipe object and sets the labels of the Recipe tiles according to that recipe's name and number of missing ingredients.

    Methods inherited from class java.lang.Object

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

    • RecipeTileController

      public RecipeTileController()
  • Method Details

    • initialize

      public void initialize(URL url, ResourceBundle resourceBundle)
      The initialize method of the controller takes in a URL (location) and ResourceBundle(resources) to initialize the controller once its root element has been processed. The method reads and creates an instance of the RecipeRegister class from file and makes sure that the name of the recipe will be able to wrap on the tile if it is longer than the tile width.
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Parameters:
      url - The location to resolve the relative paths to the root object.
      resourceBundle - Resources used to localize the root object.
    • setData

      public void setData(Recipe recipe)
      The setData method takes in a Recipe object and sets the labels of the Recipe tiles according to that recipe's name and number of missing ingredients.
      Parameters:
      recipe - A recipe object to represent as a recipe tile(RecipeTile.fxml)