From 18ab4d94262c94d658e7e732f5e80a942a23d909 Mon Sep 17 00:00:00 2001 From: Lara Blersch <lb210@hdm-stuttgart.de> Date: Tue, 6 Jun 2023 12:39:24 +0200 Subject: [PATCH] starting to build recipe-view.fxml, still a lot to do --- .../hdm/controllers/RecipeViewController.java | 1 + src/main/resources/fxml/recipe-view.fxml | 135 ++++++++++++++++-- 2 files changed, 124 insertions(+), 12 deletions(-) diff --git a/src/main/java/mi/hdm/controllers/RecipeViewController.java b/src/main/java/mi/hdm/controllers/RecipeViewController.java index 5012e35..edeb678 100644 --- a/src/main/java/mi/hdm/controllers/RecipeViewController.java +++ b/src/main/java/mi/hdm/controllers/RecipeViewController.java @@ -12,6 +12,7 @@ public class RecipeViewController extends BaseController { private final RecipeManager recipeManager; + //TODO: Change TilePane to something else because there is no TilePane in the fxml file anymore @FXML private TilePane recipeTilePane; @FXML diff --git a/src/main/resources/fxml/recipe-view.fxml b/src/main/resources/fxml/recipe-view.fxml index adbce37..010f473 100644 --- a/src/main/resources/fxml/recipe-view.fxml +++ b/src/main/resources/fxml/recipe-view.fxml @@ -1,16 +1,127 @@ <?xml version="1.0" encoding="UTF-8"?> -<?import javafx.geometry.Insets?> -<?import javafx.scene.control.SplitPane?> +<?import javafx.geometry.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.image.*?> <?import javafx.scene.layout.*?> -<AnchorPane fx:id="parent" prefHeight="400.0" prefWidth="677.0" xmlns="http://javafx.com/javafx/17.0.2-ea" - xmlns:fx="http://javafx.com/fxml/1" fx:controller="mi.hdm.controllers.RecipeViewController"> - <SplitPane orientation="VERTICAL" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" - AnchorPane.rightAnchor="0.0"> - <TilePane fx:id="recipeTilePane" hgap="8.0" prefHeight="333.0" prefWidth="675.0" vgap="8.0"> - <padding> - <Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/> - </padding> - </TilePane> - </SplitPane> +<?import javafx.scene.text.*?> + +<AnchorPane prefHeight="540.0" prefWidth="872.0" style="-fx-background-color: ffffff;" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="mi.hdm.controllers.RecipeViewController"> + <children> + <VBox layoutX="410.0" layoutY="1.0" prefHeight="539.0" prefWidth="872.0" style="-fx-background-color: ffffff;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <padding> + <Insets bottom="16.0" left="16.0" right="16.0" /> + </padding> + <GridPane prefHeight="40.0" prefWidth="840.0"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="609.5914306640625" minWidth="10.0" prefWidth="607.0957641601562" /> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="274.7779541015625" minWidth="10.0" prefWidth="40.40423583984375" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <Label alignment="TOP_CENTER" prefHeight="54.0" prefWidth="207.0" text="Recipe Name" textFill="#d91c1c" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.valignment="TOP"> + <font> + <Font name="Arial" size="34.0" /> + </font> + </Label> + </children> + </GridPane> + <GridPane prefHeight="447.0" prefWidth="840.0"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="467.98846435546875" minWidth="10.0" prefWidth="452.50830078125" /> + <ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="496.43231201171875" minWidth="10.0" prefWidth="387.49169921875" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <VBox prefHeight="200.0" prefWidth="100.0"> + <children> + <GridPane prefHeight="65.0" prefWidth="393.0"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="235.0" minWidth="10.0" prefWidth="233.0" /> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="191.0" minWidth="10.0" prefWidth="160.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <Button alignment="CENTER" contentDisplay="RIGHT" mnemonicParsing="false" prefHeight="41.0" prefWidth="159.0" style="-fx-background-color: ffffff; -fx-control-inner-background: transparent; -fx-border-color: d91c1c; -fx-border-radius: 5; -fx-border-width: 4;" text="Delete" textAlignment="CENTER" textFill="#d91c1c"> + <font> + <Font name="System Bold" size="17.0" /> + </font> + </Button> + <Button alignment="CENTER" contentDisplay="RIGHT" mnemonicParsing="false" prefHeight="41.0" prefWidth="159.0" style="-fx-background-color: ffffff; -fx-control-inner-background: transparent; -fx-border-color: d91c1c; -fx-border-radius: 5; -fx-border-width: 4;" text="Edit" textAlignment="CENTER" textFill="#d91c1c" GridPane.columnIndex="1"> + <font> + <Font name="System Bold" size="17.0" /> + </font> + </Button> + </children> + <VBox.margin> + <Insets bottom="10.0" /> + </VBox.margin> + </GridPane> + <ListView fixedCellSize="1.0" prefHeight="80.0" prefWidth="393.0"> + <VBox.margin> + <Insets bottom="10.0" top="10.0" /> + </VBox.margin></ListView> + <ScrollPane prefHeight="244.0" prefWidth="393.0" style="-fx-border-color: D91C1C; -fx-border-width: 4; -fx-border-radius: 10; -fx-background-color: transparent;"> + <content> + <Label alignment="TOP_LEFT" contentDisplay="CENTER" lineSpacing="1.5" prefHeight="372.0" prefWidth="393.0" style="-fx-background-color: transparent;" text=" sjdfjakjfkj j kasdjfkasjdkf aorjfaksdjf alösjfailjskdf aöiejraö skjdfoakdjfpoeaijf alskjdf aroijf oajdfo oerajfija oaeijr oaiejrüoj oaejf üoaijer fjüaroifj üeorj ojeaüroit oijetiüfj üeor" wrapText="true"> + <font> + <Font name="Inter Regular" size="12.0" /> + </font> + <opaqueInsets> + <Insets /> + </opaqueInsets> + <padding> + <Insets bottom="10.0" left="10.0" right="20.0" top="10.0" /> + </padding> + </Label> + </content> + </ScrollPane> + </children> + <GridPane.margin> + <Insets left="30.0" right="30.0" top="30.0" /> + </GridPane.margin> + </VBox> + <VBox prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="1"> + <children> + <Pane prefHeight="200.0" prefWidth="200.0" style="-fx-background-color: transparent; -fx-border-color: d91c1c; -fx-border-radius: 10; -fx-border-width: 4;"> + <children> + <ImageView fitHeight="200.0" fitWidth="338.0" pickOnBounds="true" preserveRatio="true" /> + </children> + <VBox.margin> + <Insets bottom="10.0" /> + </VBox.margin></Pane> + <Pane layoutX="10.0" layoutY="10.0" prefHeight="200.0" prefWidth="200.0" style="-fx-background-color: transparent; -fx-border-color: d91c1c; -fx-border-radius: 10; -fx-border-width: 4;"> + <children> + <ScrollBar layoutX="317.0" layoutY="5.0" orientation="VERTICAL" prefHeight="190.0" prefWidth="14.0" /> + <TableView layoutY="-1.0" prefHeight="200.0" prefWidth="321.0" style="-fx-background-color: transparent;"> + + <columns> + <TableColumn editable="false" prefWidth="91.0" text="C1" /> + <TableColumn editable="false" prefWidth="229.0" text="C2" /> + </columns> + <padding> + <Insets bottom="4.0" left="4.0" right="4.0" top="4.0" /> + </padding> + </TableView> + </children> + <VBox.margin> + <Insets top="10.0" /> + </VBox.margin> + </Pane> + </children> + <GridPane.margin> + <Insets left="30.0" right="20.0" top="30.0" /> + </GridPane.margin> + </VBox> + </children> + </GridPane> + </VBox> + </children> </AnchorPane> -- GitLab