Class RecipeTileController
java.lang.Object
no.ntnu.idatt1002.demo.controller.RecipeTileController
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
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.
-
Constructor Details
-
RecipeTileController
public RecipeTileController()
-
-
Method Details
-
initialize
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 interfacejavafx.fxml.Initializable
- Parameters:
url
- The location to resolve the relative paths to the root object.resourceBundle
- Resources used to localize the root object.
-
setData
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)
-