Compare commits

..

No commits in common. "ae62ff5fd792e8e325b6687c16ba79af8182cd6b" and "c5b249e096dce9aad933559c139f205e6c659280" have entirely different histories.

9 changed files with 120 additions and 131 deletions

View File

@ -1,6 +1,8 @@
package com.example.vpr_javafx; package com.example.vpr_javafx;
import javafx.fxml.FXML;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField; import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
@ -25,40 +27,15 @@ import java.util.regex.Pattern;
*/ */
public class Data { public class Data {
private String pathRead; private String pathRead;
@FXML
private TextField tfPhone;
@FXML
private PasswordField pfPassword;
public Data(String pathRead) { public Data(String pathRead) {
this.pathRead = pathRead; this.pathRead = pathRead;
} }
/**
* @author Kevin Pfannenstiel
* @return
*/
public HashMap<String, String> readLoginData()
{
try {
List<String> lines = Files.readAllLines(Paths.get(pathRead));
HashMap<String, String> user = new HashMap<>();
for (int i = 0; i < lines.size(); i++)
{
String[] parts = lines.get(i).split(";");
String phoneNumber = parts[3];
String password = parts[5];
user.put(phoneNumber, password);
}
return user;
} catch (IOException e) {
e.printStackTrace();
return new HashMap<>();
}
}
/** /**
* readUser() is a method to split user.txt into lines and save them in an arraylist * readUser() is a method to split user.txt into lines and save them in an arraylist
* *
@ -294,7 +271,8 @@ public class Data {
boolean phoneNumberValid = false; boolean phoneNumberValid = false;
boolean passwordValid = false; boolean passwordValid = false;
HashMap<String, String> users = readLoginData(); LoginDatei file = new LoginDatei("user.txt");
HashMap<String, String> users = file.readFile();
String phoneNumber = tfPhone.getText(); String phoneNumber = tfPhone.getText();
String password = pfPassword.getText(); String password = pfPassword.getText();

View File

@ -113,7 +113,6 @@ public class HelloController {
@FXML @FXML
protected void FillLabels() { protected void FillLabels() {
try { try {
List<String> menu = Files.readAllLines(Paths.get("menue.txt")); List<String> menu = Files.readAllLines(Paths.get("menue.txt"));
@ -129,85 +128,85 @@ public class HelloController {
String dayMenu = dish+"\n"+sideDish+"\n"+"("+allergenic+")"; String dayMenu = dish+"\n"+sideDish+"\n"+"("+allergenic+")";
// if(typ.equals("Fleisch")) { if(typ.equals("Fleisch")) {
// imageUrl=meatUrl; imageUrl=meatUrl;
// } }
// if(typ.equals("Vegetarisch")) { if(typ.equals("Vegetarisch")) {
// imageUrl=veggieImageUrl; imageUrl=veggieImageUrl;
// } }
// if(typ.equals("Vegan")) { if(typ.equals("Vegan")) {
// imageUrl=veganUrl; imageUrl=veganUrl;
// } }
//
// Image image = new Image("C:/Unterricht/VPR_Projekt/target/classes/com/example/vpr_javafx/" + imageUrl); Image image = new Image("C:/VPR_Projekt_Java/target/classes/com/example/vpr_javafx/" + imageUrl);
switch (i) { switch (i) {
case 0: case 0:
lMonH1.setText(dayMenu); lMonH1.setText(dayMenu);
// imgImage1.setImage(image); imgImage1.setImage(image);
break; break;
case 1: case 1:
lMonD1.setText(dayMenu); lMonD1.setText(dayMenu);
break; break;
case 2: case 2:
lMonH2.setText(dayMenu); lMonH2.setText(dayMenu);
// imgImage2.setImage(image); imgImage2.setImage(image);
break; break;
case 3: case 3:
lMonD2.setText(dayMenu); lMonD2.setText(dayMenu);
break; break;
case 4: case 4:
lTueH1.setText(dayMenu); lTueH1.setText(dayMenu);
// imgImage3.setImage(image); imgImage3.setImage(image);
break; break;
case 5: case 5:
lTueD1.setText(dayMenu); lTueD1.setText(dayMenu);
break; break;
case 6: case 6:
lTueH2.setText(dayMenu); lTueH2.setText(dayMenu);
// imgImage4.setImage(image); imgImage4.setImage(image);
break; break;
case 7: case 7:
lTueD2.setText(dayMenu); lTueD2.setText(dayMenu);
break; break;
case 8: case 8:
lWednH1.setText(dayMenu); lWednH1.setText(dayMenu);
// imgImage5.setImage(image); imgImage5.setImage(image);
break; break;
case 9: case 9:
lWednD1.setText(dayMenu); lWednD1.setText(dayMenu);
break; break;
case 10: case 10:
lWednH2.setText(dayMenu); lWednH2.setText(dayMenu);
// imgImage6.setImage(image); imgImage6.setImage(image);
break; break;
case 11: case 11:
lWednD2.setText(dayMenu); lWednD2.setText(dayMenu);
break; break;
case 12: case 12:
lThurH1.setText(dayMenu); lThurH1.setText(dayMenu);
// imgImage7.setImage(image); imgImage7.setImage(image);
break; break;
case 13: case 13:
lThurD1.setText(dayMenu); lThurD1.setText(dayMenu);
break; break;
case 14: case 14:
lThurH2.setText(dayMenu); lThurH2.setText(dayMenu);
// imgImage8.setImage(image); imgImage8.setImage(image);
break; break;
case 15: case 15:
lThurD2.setText(dayMenu); lThurD2.setText(dayMenu);
break; break;
case 16: case 16:
lFriH1.setText(dayMenu); lFriH1.setText(dayMenu);
// imgImage9.setImage(image); imgImage9.setImage(image);
break; break;
case 17: case 17:
lFriD1.setText(dayMenu); lFriD1.setText(dayMenu);
break; break;
case 18: case 18:
lFriH2.setText(dayMenu); lFriH2.setText(dayMenu);
// imgImage10.setImage(image); imgImage10.setImage(image);
break; break;
case 19: case 19:
lFriD2.setText(dayMenu); lFriD2.setText(dayMenu);

View File

@ -1,42 +1,42 @@
//package com.example.vpr_javafx; package com.example.vpr_javafx;
//
//import java.io.IOException; import java.io.IOException;
//import java.nio.file.Files; import java.nio.file.Files;
//import java.nio.file.Paths; import java.nio.file.Paths;
//import java.util.HashMap; import java.util.HashMap;
//import java.util.List; import java.util.List;
//
//public class LoginDatei public class LoginDatei
//{ {
// private final String dateiname; private final String dateiname;
//
// public LoginDatei(String dateiname) public LoginDatei(String dateiname)
// { {
// this.dateiname = dateiname; this.dateiname = dateiname;
// } }
//
// public HashMap<String, String> readFile() public HashMap<String, String> readFile()
// { {
// try { try {
// List<String> lines = Files.readAllLines(Paths.get(dateiname)); List<String> lines = Files.readAllLines(Paths.get(dateiname));
//
// HashMap<String, String> user = new HashMap<>(); HashMap<String, String> user = new HashMap<>();
//
// for (int i = 0; i < lines.size(); i++) for (int i = 0; i < lines.size(); i++)
// { {
// String[] parts = lines.get(i).split(";"); String[] parts = lines.get(i).split(";");
//
// String phoneNumber = parts[3]; String phoneNumber = parts[3];
// String password = parts[5]; String password = parts[5];
//
// user.put(phoneNumber, password); user.put(phoneNumber, password);
// } }
//
// return user; return user;
//
// } catch (IOException e) { } catch (IOException e) {
// e.printStackTrace(); e.printStackTrace();
// return new HashMap<>(); return new HashMap<>();
// } }
// } }
//} }

View File

@ -1,19 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.*?>
<?import javafx.scene.control.Label?> <?import javafx.scene.image.*?>
<?import javafx.scene.control.PasswordField?> <?import javafx.scene.layout.*?>
<?import javafx.scene.control.TextField?> <?import javafx.scene.shape.*?>
<?import javafx.scene.control.ToolBar?> <?import javafx.scene.text.*?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="742.0" prefWidth="980.0" style="-fx-background-color: #f0C8bd;" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController"> <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="742.0" prefWidth="980.0" style="-fx-background-color: #f0C8bd;" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController">
<Label fx:id="monday" layoutX="76.0" layoutY="176.0" textFill="#6f7baf"> <Label layoutX="76.0" layoutY="176.0" text="Montag" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -21,7 +16,7 @@
<Insets /> <Insets />
</opaqueInsets> </opaqueInsets>
</Label> </Label>
<Label fx:id="tuesday" layoutX="74.0" layoutY="299.0" textFill="#6f7baf"> <Label layoutX="74.0" layoutY="299.0" text="Dienstag" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -29,7 +24,7 @@
<Insets /> <Insets />
</opaqueInsets> </opaqueInsets>
</Label> </Label>
<Label fx:id="wendesday" layoutX="72.0" layoutY="422.0" textFill="#6f7baf"> <Label layoutX="72.0" layoutY="422.0" text="Mittwoch" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -37,7 +32,7 @@
<Insets /> <Insets />
</opaqueInsets> </opaqueInsets>
</Label> </Label>
<Label fx:id="thursday" layoutX="63.0" layoutY="543.0" textFill="#6f7baf"> <Label layoutX="63.0" layoutY="543.0" text="Donnerstag" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -45,7 +40,7 @@
<Insets /> <Insets />
</opaqueInsets> </opaqueInsets>
</Label> </Label>
<Label fx:id="friday" layoutX="79.0" layoutY="664.0" textFill="#6f7baf"> <Label layoutX="79.0" layoutY="664.0" text="Freitag" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -204,4 +199,15 @@
</font> </font>
</Label> </Label>
<Label fx:id="allergene" layoutX="780.0" layoutY="362.0" prefHeight="183.0" prefWidth="192.0" /> <Label fx:id="allergene" layoutX="780.0" layoutY="362.0" prefHeight="183.0" prefWidth="192.0" />
<ImageView fx:id="imgImage1" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="154.0" pickOnBounds="true" preserveRatio="true"/>
<ImageView fx:id="imgImage2" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="189.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage3" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="277.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage4" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="312.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage5" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="400.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage6" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="435.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage7" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="523.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage8" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="556.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage9" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="643.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage10" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="677.0" pickOnBounds="true" preserveRatio="true" />
<CheckBox layoutX="358.0" layoutY="154.0" mnemonicParsing="false" />
</AnchorPane> </AnchorPane>

Binary file not shown.

View File

@ -1,19 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.*?>
<?import javafx.scene.control.Label?> <?import javafx.scene.image.*?>
<?import javafx.scene.control.PasswordField?> <?import javafx.scene.layout.*?>
<?import javafx.scene.control.TextField?> <?import javafx.scene.shape.*?>
<?import javafx.scene.control.ToolBar?> <?import javafx.scene.text.*?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="742.0" prefWidth="980.0" style="-fx-background-color: #f0C8bd;" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController"> <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="742.0" prefWidth="980.0" style="-fx-background-color: #f0C8bd;" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController">
<Label fx:id="monday" layoutX="76.0" layoutY="176.0" textFill="#6f7baf"> <Label layoutX="76.0" layoutY="176.0" text="Montag" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -21,7 +16,7 @@
<Insets /> <Insets />
</opaqueInsets> </opaqueInsets>
</Label> </Label>
<Label fx:id="tuesday" layoutX="74.0" layoutY="299.0" textFill="#6f7baf"> <Label layoutX="74.0" layoutY="299.0" text="Dienstag" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -29,7 +24,7 @@
<Insets /> <Insets />
</opaqueInsets> </opaqueInsets>
</Label> </Label>
<Label fx:id="wendesday" layoutX="72.0" layoutY="422.0" textFill="#6f7baf"> <Label layoutX="72.0" layoutY="422.0" text="Mittwoch" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -37,7 +32,7 @@
<Insets /> <Insets />
</opaqueInsets> </opaqueInsets>
</Label> </Label>
<Label fx:id="thursday" layoutX="63.0" layoutY="543.0" textFill="#6f7baf"> <Label layoutX="63.0" layoutY="543.0" text="Donnerstag" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -45,7 +40,7 @@
<Insets /> <Insets />
</opaqueInsets> </opaqueInsets>
</Label> </Label>
<Label fx:id="friday" layoutX="79.0" layoutY="664.0" textFill="#6f7baf"> <Label layoutX="79.0" layoutY="664.0" text="Freitag" textFill="#6f7baf">
<font> <font>
<Font name="Century Gothic Bold" size="13.0" /> <Font name="Century Gothic Bold" size="13.0" />
</font> </font>
@ -204,4 +199,15 @@
</font> </font>
</Label> </Label>
<Label fx:id="allergene" layoutX="780.0" layoutY="362.0" prefHeight="183.0" prefWidth="192.0" /> <Label fx:id="allergene" layoutX="780.0" layoutY="362.0" prefHeight="183.0" prefWidth="192.0" />
<ImageView fx:id="imgImage1" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="154.0" pickOnBounds="true" preserveRatio="true"/>
<ImageView fx:id="imgImage2" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="189.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage3" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="277.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage4" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="312.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage5" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="400.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage6" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="435.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage7" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="523.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage8" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="556.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage9" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="643.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imgImage10" fitHeight="30.0" fitWidth="35.0" layoutX="110.0" layoutY="677.0" pickOnBounds="true" preserveRatio="true" />
<CheckBox layoutX="358.0" layoutY="154.0" mnemonicParsing="false" />
</AnchorPane> </AnchorPane>

View File

@ -28,9 +28,9 @@
<Label text="Passwort bestätigen: " GridPane.rowIndex="3" /> <Label text="Passwort bestätigen: " GridPane.rowIndex="3" />
<PasswordField GridPane.columnIndex="1" GridPane.rowIndex="2" /> <PasswordField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<PasswordField GridPane.columnIndex="1" GridPane.rowIndex="3" /> <PasswordField GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField GridPane.columnIndex="1" /> <TextField fx:id="tfRegisterName" GridPane.columnIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" /> <TextField fx:id="tfRegisterPhone" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="4" /> <TextField fx:id="tfRegisterChild" GridPane.columnIndex="1" GridPane.rowIndex="4" />
</children> </children>
</GridPane> </GridPane>
</children> </children>