Skip to content
Snippets Groups Projects
Commit d0fd083f authored by HSoreide's avatar HSoreide
Browse files

Resolve conflicts after rebasing onto master

parent 90911f75
No related branches found
No related tags found
1 merge request!49Improve UI based on customer feedback(21/4-23) and add help-button to the 'Add...
...@@ -5,21 +5,20 @@ import javafx.collections.FXCollections; ...@@ -5,21 +5,20 @@ import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.control.Label; import javafx.scene.control.*;
import javafx.scene.control.ListView;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import no.ntnu.idatt1002.demo.data.recipes.FileHandler; import no.ntnu.idatt1002.demo.data.recipes.FileHandler;
import no.ntnu.idatt1002.demo.data.recipes.FoodItem; import no.ntnu.idatt1002.demo.data.recipes.FoodItem;
import no.ntnu.idatt1002.demo.data.recipes.IngredientsAtHand; import no.ntnu.idatt1002.demo.data.recipes.IngredientsAtHand;
/** /**
* The AddIngredientController manages a dialog pane used to display a search-field along with a list of all the * The AddIngredientController manages a dialog pane used to display a search-field along with a list of all the
* possible food types in the application according to the FoodItem enum class. The food types in the list may be * possible food types in the application according to the FoodItem enum class. The food types in the list may be
...@@ -38,6 +37,10 @@ public class AddIngredientController implements Initializable { ...@@ -38,6 +37,10 @@ public class AddIngredientController implements Initializable {
@FXML @FXML
private Button addBtn; private Button addBtn;
@FXML
private Button helpBtn;
@FXML @FXML
private ListView<String> listView; private ListView<String> listView;
...@@ -68,6 +71,27 @@ public class AddIngredientController implements Initializable { ...@@ -68,6 +71,27 @@ public class AddIngredientController implements Initializable {
status.setWrapText(true); status.setWrapText(true);
} }
/**
* The help method is called whenever the help-button (displayed as a round button with a question mark on it) is
* clicked. An alert box appears on the screen with information about how the current window is navigated to
* perform the intended use.
*/
@FXML
void help () {
Alert a = new Alert(Alert.AlertType.INFORMATION);
a.setTitle("How to add ingredients to the fridge");
String information = "Write a word in the search field and either press 'ENTER' on your keyboard or " +
"press the button 'Search' to perform the search. Then click on the food you want to add and " +
"press the 'ADD' button. If the food was added to the fridge, it will appear below the 'ADD' button, " +
"if not, it was probably in the fridge already!";
a.setContentText(information);
a.showAndWait();
}
/** /**
* The addToFridge method reads an up-to-date instance of the IngredientsAtHand object from file and * The addToFridge method reads an up-to-date instance of the IngredientsAtHand object from file and
* gets hold of the FoodItem constant that is currently selected in the list. If the selected FoodItem is not * gets hold of the FoodItem constant that is currently selected in the list. If the selected FoodItem is not
......
...@@ -31,6 +31,6 @@ public class IngredientTileController { ...@@ -31,6 +31,6 @@ public class IngredientTileController {
.append(ingredient.getAmount()).append(" ") .append(ingredient.getAmount()).append(" ")
.append(ingredient.getUnit().label); .append(ingredient.getUnit().label);
text.setText(String.valueOf(sb)); text.setText(String.valueOf(sb));
text.setStyle("-fx-font-size: 18"); text.setStyle("-fx-font-size: 16");
} }
} }
APRILpåske APRILreasonable
\ No newline at end of file \ No newline at end of file
...@@ -17,3 +17,7 @@ LAM ...@@ -17,3 +17,7 @@ LAM
CHILLI_POWDER CHILLI_POWDER
SAUSAGE SAUSAGE
YELLOW_CHEESE YELLOW_CHEESE
PARMESAN
OLIVE_OIL
CHILLI
EGG
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
} }
.scroll-pane { .scroll-pane {
-fx-background-color: rgba(255, 255, 255, 0.35); -fx-background-color: rgba(255, 255, 255, 0.5);
-fx-border-width: 5; -fx-border-width: 5;
-fx-border-radius: 5; -fx-border-radius: 5;
-fx-border-color: rgba(255, 255, 255, 0.75); -fx-border-color: rgba(255, 255, 255, 0.75);
......
...@@ -11,7 +11,10 @@ ...@@ -11,7 +11,10 @@
<ImageView fitHeight="695.0" fitWidth="1130.0" pickOnBounds="true" preserveRatio="true"> <ImageView fitHeight="695.0" fitWidth="1130.0" pickOnBounds="true" preserveRatio="true">
<image> <image>
<Image url="@../Images/backgroundMini.jpg" /> <Image url="@../Images/backgroundMini.jpg" />
</image></ImageView> </image>
<rotationAxis>
<Point3D />
</rotationAxis></ImageView>
<BorderPane prefHeight="695.0" prefWidth="1130.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <BorderPane prefHeight="695.0" prefWidth="1130.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<top> <top>
<HBox prefHeight="164.0" prefWidth="1130.0" BorderPane.alignment="CENTER"> <HBox prefHeight="164.0" prefWidth="1130.0" BorderPane.alignment="CENTER">
...@@ -27,12 +30,15 @@ ...@@ -27,12 +30,15 @@
</Pane> </Pane>
<Pane prefHeight="103.0" prefWidth="853.0"> <Pane prefHeight="103.0" prefWidth="853.0">
<children> <children>
<Label fx:id="recipeName" alignment="CENTER" contentDisplay="CENTER" layoutX="44.0" layoutY="38.0" styleClass="head-line" stylesheets="@../style.css" text="RecipeName" textAlignment="CENTER"> <Label fx:id="recipeName" alignment="CENTER" contentDisplay="CENTER" layoutY="3.0" prefHeight="156.0" prefWidth="735.0" styleClass="head-line" stylesheets="@../style.css" text="RecipeName" textAlignment="CENTER" wrapText="true">
<font> <font>
<Font size="36.0" /> <Font size="36.0" />
</font> </font>
</Label> </Label>
</children> </children>
<HBox.margin>
<Insets right="25.0" />
</HBox.margin>
</Pane> </Pane>
</children> </children>
</HBox> </HBox>
...@@ -40,9 +46,9 @@ ...@@ -40,9 +46,9 @@
<center> <center>
<HBox prefHeight="100.0" prefWidth="200.0" spacing="50.0" BorderPane.alignment="CENTER"> <HBox prefHeight="100.0" prefWidth="200.0" spacing="50.0" BorderPane.alignment="CENTER">
<children> <children>
<ScrollPane prefHeight="431.0" prefWidth="263.0" stylesheets="@../style.css"> <ScrollPane prefHeight="454.0" prefWidth="311.0" stylesheets="@../style.css">
<content> <content>
<AnchorPane prefHeight="449.0" prefWidth="270.0" styleClass="ingredient-pane" stylesheets="@../style.css"> <AnchorPane styleClass="ingredient-pane" stylesheets="@../style.css">
<children> <children>
<VBox fx:id="ingredientList" styleClass="ingredient-list" stylesheets="@../style.css"> <VBox fx:id="ingredientList" styleClass="ingredient-list" stylesheets="@../style.css">
<padding> <padding>
...@@ -52,7 +58,7 @@ ...@@ -52,7 +58,7 @@
</AnchorPane> </AnchorPane>
</content> </content>
</ScrollPane> </ScrollPane>
<ScrollPane prefHeight="429.0" prefWidth="632.0" stylesheets="@../style.css"> <ScrollPane prefHeight="454.0" prefWidth="660.0" stylesheets="@../style.css">
<content> <content>
<Pane id="recipe-instructions" stylesheets="@../style.css"> <Pane id="recipe-instructions" stylesheets="@../style.css">
<children> <children>
...@@ -68,13 +74,13 @@ ...@@ -68,13 +74,13 @@
</HBox> </HBox>
</center> </center>
<left> <left>
<Pane prefHeight="457.0" prefWidth="75.0" BorderPane.alignment="CENTER" /> <Pane prefHeight="454.0" prefWidth="45.0" BorderPane.alignment="CENTER" />
</left> </left>
<bottom> <bottom>
<Pane prefHeight="77.0" prefWidth="1130.0" BorderPane.alignment="CENTER" /> <Pane prefHeight="56.0" prefWidth="1130.0" BorderPane.alignment="CENTER" />
</bottom> </bottom>
<right> <right>
<Pane prefHeight="454.0" prefWidth="122.0" BorderPane.alignment="CENTER" /> <Pane prefHeight="454.0" prefWidth="86.0" BorderPane.alignment="CENTER" />
</right></BorderPane> </right></BorderPane>
</children> </children>
</AnchorPane> </AnchorPane>
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