Newer
Older

Karsch Lukas
committed
package mi.hdm.controllers;

Karsch Lukas
committed
import javafx.fxml.FXML;

Karsch Lukas
committed
import javafx.scene.layout.AnchorPane;

Karsch Lukas
committed
import javafx.scene.layout.TilePane;
import mi.hdm.recipes.RecipeManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Karsch Lukas
committed
public class RecipeViewController extends BaseController {

Karsch Lukas
committed
private static final Logger log = LogManager.getLogger(RecipeViewController.class);
private final RecipeManager recipeManager;
//TODO: Change TilePane to something else because there is no TilePane in the fxml file anymore

Karsch Lukas
committed
@FXML
private TilePane recipeTilePane;

Karsch Lukas
committed
@FXML
private AnchorPane parent;

Karsch Lukas
committed
public RecipeViewController(RecipeManager recipeManager) {
this.recipeManager = recipeManager;
}
@FXML
public void changeSceneToMain() {
try {
changeScene(View.MAIN);
} catch (Exception e) {
e.printStackTrace();
log.error("Something went wrong when changing the scene.");
}
}
@FXML
public void initialize() {

Karsch Lukas
committed
loadHeader(parent);

Karsch Lukas
committed
log.debug("Added {} recipes to GUI", recipeManager.getRecipes().size());
}