Skip to content
Snippets Groups Projects
Commit a39eeade authored by Dirksmöller Karin's avatar Dirksmöller Karin
Browse files

Merge remote-tracking branch 'origin/main'

parents 5aa2c98e b82e99de
No related branches found
No related tags found
No related merge requests found
package mi.hdm.controllers;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.TilePane;
import javafx.scene.layout.VBox;
import mi.hdm.recipes.Recipe;
import mi.hdm.recipes.RecipeManager;
import mi.hdm.shoppingList.ShoppingList;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class ShoppingListViewController extends BaseController {
private static final Logger log = LogManager.getLogger(ShoppingListViewController.class);
private final RecipeManager recipeManager;
private final ShoppingList shoppingList;
@FXML
private SplitPane shoppingListSplitPane;
public ShoppingListViewController(RecipeManager recipeManager, ShoppingList shoppingList) {
this.recipeManager = recipeManager;
this.shoppingList = shoppingList;
}
}
......@@ -5,6 +5,7 @@ import javafx.scene.Parent;
import mi.hdm.HelloController;
import mi.hdm.TastyPages;
import mi.hdm.recipes.RecipeManager;
import mi.hdm.shoppingList.ShoppingList;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -13,11 +14,13 @@ import java.io.IOException;
public enum View {
MAIN("/fxml/hello.fxml", "Tasty Pages"),
RECIPE_VIEW("/fxml/recipe-view.fxml", "Tasty Pages - Recipe View");
RECIPE_VIEW("/fxml/recipe-view.fxml", "Tasty Pages - Recipe View"),
SHOPPINGLIST_VIEW("/fxml/shoppingList-view.fxml", "Tasty Pages - Shopping List View");
private static final Logger log = LogManager.getLogger(View.class);
private final RecipeManager recipeManager = TastyPages.recipeManager;
private final ShoppingList shoppingList = ShoppingList.getInstance();
private final String path;
private final String windowTitle;
......@@ -40,6 +43,9 @@ public enum View {
case RECIPE_VIEW -> loader.setControllerFactory((callback) ->
new RecipeViewController(recipeManager)
);
case SHOPPINGLIST_VIEW -> loader.setControllerFactory((callback) ->
new ShoppingListViewController(recipeManager, shoppingList)
);
}
return loader.load();
......
package mi.hdm.controllers;
public enum Views {
MAIN,
RECIPE_VIEW
}
......@@ -4,7 +4,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxml.ShoppingListView">
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="mi.hdm.controllers.ShoppingListViewController">
<children>
<ToolBar prefHeight="40.0" prefWidth="606.0" style="-fx-background-color: FFFFFF;">
<items>
......@@ -23,7 +23,7 @@
</font>
</TextField>
</items></ToolBar>
<SplitPane dividerPositions="0.6341059602649006" layoutY="40.0" mouseTransparent="true" prefHeight="360.0" prefWidth="606.0" style="-fx-background-color: FFFFFF;">
<SplitPane fx:id="shoppingListSplitPane" dividerPositions="0.6341059602649006" layoutY="40.0" mouseTransparent="true" prefHeight="360.0" prefWidth="606.0" style="-fx-background-color: FFFFFF;">
<items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="360.0" prefWidth="379.0" style="-fx-background-color: FFFFFF; -fx-border-color: D91C1C; -fx-border-radius: 10; -fx-border-width: 4; -fx-border-insets: 15;">
<children>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment