diff --git a/menue.txt b/menue.txt index bd6ce28..18e8d87 100644 --- a/menue.txt +++ b/menue.txt @@ -1,20 +1,20 @@ -Montag;Pommes;mit Kroketten und Gemüse;Vegan -Montag;Vegane Waffel;mit Puderzucker;DessertV -Montag;Schnitzel;mit Kroketten, Gemüse und Soße;Fleisch -Montag;Wackelpudding;mit Vanillesoße;Dessert -Dienstag;Rote Linsen Curry;mit Süßkartoffeln;Vegan -Dienstag;Vegane Pancakes;mit Ahornsirup;DessertV -Dienstag;Gebratene Nudeln;mit Gemüse;Vegetarisch -Dienstag;Berliner;mit Erdbeerfüllung;Dessert -Mittwoch;Bratkartoffeln;mit veganer Bratensoße;Vegan -Mittwoch;Pudding;mit Schokostreuseln;DessertV -Mittwoch;Bratkartoffeln;mit Leberkäse und Ei;Fleisch -Mittwoch;Pudding;mit Vanillesoße;Dessert -Donnerstag;Bauerntopf;mit veganem Hack;Vegan -Donnerstag;Bananenbrot;mit Datteln;DessertV -Donnerstag;Bauerntopf;mit veganem Hack;Vegan -Donnerstag;Bananenbrot;mit Datteln;DessertV -Freitag;Bauerntopf;mit veganem Hack;Vegan -Freitag;Bananenbrot;mit Datteln;DessertV -Freitag;Bauerntopf;mit veganem Hack;Vegan -Freitag;Bananenbrot;mit Datteln;DessertV \ No newline at end of file +Montag;Pommes;mit Kroketten und Gemüse;Vegan;g,2,3 +Montag;Vegane Waffel;mit Puderzucker;DessertV;g,b,k +Montag;Schnitzel;mit Kroketten, Gemüse und Soße;Fleisch;g,c,a,2,3 +Montag;Wackelpudding;mit Vanillesoße;Dessert;c,2 +Dienstag;Rote Linsen Curry;mit Süßkartoffeln;Vegan;g,b,2,3 +Dienstag;Vegane Pancakes;mit Ahornsirup;DessertV;g,b,3 +Dienstag;Gebratene Nudeln;mit Gemüse;Vegetarisch;b,c,a,i,3 +Dienstag;Berliner;mit Erdbeerfüllung;Dessert;c,a +Mittwoch;Bratkartoffeln;mit veganer Bratensoße;Vegan;b,2,3 +Mittwoch;Pudding;mit Schokostreuseln;DessertV;b,2 +Mittwoch;Bratkartoffeln;mit Leberkäse und Ei;Fleisch;a,j,2,3 +Mittwoch;Pudding;mit Vanillesoße;Dessert;c,2 +Donnerstag;Bauerntopf;mit veganem Hack;Vegan;g,c,a,h,1,2,3 +Donnerstag;Bananenbrot;mit Datteln;DessertV;g,c +Donnerstag;Bauerntopf;mit veganem Hack;Vegan;g,c,a,h,1,2,3 +Donnerstag;Bananenbrot;mit Datteln;DessertV;g,c +Freitag;Bauerntopf;mit veganem Hack;Vegan;g,c,a,h,1,2,3 +Freitag;Bananenbrot;mit Datteln;DessertV;g,c +Freitag;Bauerntopf;mit veganem Hack;Vegan;g,c,a,h,1,2,3 +Freitag;Bananenbrot;mit Datteln;DessertV;g,c \ No newline at end of file diff --git a/src/main/java/com/example/vpr_javafx/HelloController.java b/src/main/java/com/example/vpr_javafx/HelloController.java index 4e911ba..3b8b6aa 100644 --- a/src/main/java/com/example/vpr_javafx/HelloController.java +++ b/src/main/java/com/example/vpr_javafx/HelloController.java @@ -7,8 +7,12 @@ import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.*; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; import javafx.stage.Stage; +import java.io.Console; +import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; @@ -57,6 +61,27 @@ public class HelloController { @FXML private Label lFriD2; + @FXML + private ImageView imgImage1; + @FXML + private ImageView imgImage2; + @FXML + private ImageView imgImage3; + @FXML + private ImageView imgImage4; + @FXML + private ImageView imgImage5; + @FXML + private ImageView imgImage6; + @FXML + private ImageView imgImage7; + @FXML + private ImageView imgImage8; + @FXML + private ImageView imgImage9; + @FXML + private ImageView imgImage10; + @FXML private TextField tfPhone; @FXML @@ -67,6 +92,15 @@ public class HelloController { @FXML private Label allergene; + @FXML + private String veggieImageUrl = "pics/vegetarisch.png"; + @FXML + private String veganUrl = "pics/vegan.png"; + @FXML + private String meatUrl = "pics/fleisch.png"; + @FXML + private String imageUrl; + @FXML protected void OnSignInButton(ActionEvent event) throws IOException { @@ -96,70 +130,95 @@ public class HelloController { for (int i = 0; i < menu.size(); i++) { + String[] parts = menu.get(i).split(";"); String dish = parts[1]; String sideDish = parts[2]; + String typ = parts[3]; + String allergenic = parts[4]; - String dayMenu = dish+"\n"+sideDish; + String dayMenu = dish+"\n"+sideDish+"\n"+"("+allergenic+")"; + + if(typ.equals("Fleisch")) { + imageUrl=meatUrl; + } + if(typ.equals("Vegetarisch")) { + imageUrl=veggieImageUrl; + } + if(typ.equals("Vegan")) { + imageUrl=veganUrl; + } + + Image image = new Image("C:/Unterricht/VPR_Projekt/target/classes/com/example/vpr_javafx/" + imageUrl); switch (i) { case 0: lMonH1.setText(dayMenu); + imgImage1.setImage(image); break; case 1: lMonD1.setText(dayMenu); break; case 2: lMonH2.setText(dayMenu); + imgImage2.setImage(image); break; case 3: lMonD2.setText(dayMenu); break; case 4: lTueH1.setText(dayMenu); + imgImage3.setImage(image); break; case 5: lTueD1.setText(dayMenu); break; case 6: lTueH2.setText(dayMenu); + imgImage4.setImage(image); break; case 7: lTueD2.setText(dayMenu); break; case 8: lWednH1.setText(dayMenu); + imgImage5.setImage(image); break; case 9: lWednD1.setText(dayMenu); break; case 10: lWednH2.setText(dayMenu); + imgImage6.setImage(image); break; case 11: lWednD2.setText(dayMenu); break; case 12: lThurH1.setText(dayMenu); + imgImage7.setImage(image); break; case 13: lThurD1.setText(dayMenu); break; case 14: lThurH2.setText(dayMenu); + imgImage8.setImage(image); break; case 15: lThurD2.setText(dayMenu); break; case 16: lFriH1.setText(dayMenu); + imgImage9.setImage(image); break; case 17: lFriD1.setText(dayMenu); break; case 18: lFriH2.setText(dayMenu); + imgImage10.setImage(image); break; case 19: lFriD2.setText(dayMenu); diff --git a/target/classes/com/example/vpr_javafx/HelloController.class b/target/classes/com/example/vpr_javafx/HelloController.class index d171c35..bde1386 100644 Binary files a/target/classes/com/example/vpr_javafx/HelloController.class and b/target/classes/com/example/vpr_javafx/HelloController.class differ diff --git a/target/classes/com/example/vpr_javafx/MenuOverview-view.fxml b/target/classes/com/example/vpr_javafx/MenuOverview-view.fxml index 9b6e622..6a5cd21 100644 --- a/target/classes/com/example/vpr_javafx/MenuOverview-view.fxml +++ b/target/classes/com/example/vpr_javafx/MenuOverview-view.fxml @@ -1,19 +1,14 @@ - - - - - - - - - - - + + + + + + - -