bug fixes

This commit is contained in:
Kevin Pfannenstiel 2023-02-03 14:07:30 +01:00
parent 85a599cda5
commit 22cc69ecf7
18 changed files with 83 additions and 78 deletions

View File

@ -60,7 +60,7 @@
<!-- Default configuration for running with: mvn clean javafx:run --> <!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id> <id>default-cli</id>
<configuration> <configuration>
<mainClass>com.example.vpr_javafx/com.example.vpr_javafx.HelloApplication</mainClass> <mainClass>com.example.vpr_javafx/com.example.vpr_javafx.MainApplication</mainClass>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>

View File

@ -289,7 +289,7 @@ public class Data {
* @return phoneNumberValid, passwordValid * @return phoneNumberValid, passwordValid
* @author Kevin Maier, Kevin Pfannenstiel * @author Kevin Maier, Kevin Pfannenstiel
*/ */
public boolean validateData(TextField tfPhone, PasswordField pfPassword, HelloController controller) public boolean validateData(TextField tfPhone, PasswordField pfPassword, MainController controller)
{ {
boolean phoneNumberMatchFound; boolean phoneNumberMatchFound;
boolean passwordMatchFound; boolean passwordMatchFound;
@ -411,7 +411,7 @@ public class Data {
* @param controller Controller * @param controller Controller
* @return phoneNumberValid, passwordValid, postalCodeValid * @return phoneNumberValid, passwordValid, postalCodeValid
*/ */
public boolean validateRegistration(TextField tfName, TextField tfPhone, PasswordField pfPassword, TextField tfStreet, TextField tfHouseNumber, TextField tfPostalCode, TextField tfCity, TextField tfChild, HelloController controller) public boolean validateRegistration(TextField tfName, TextField tfPhone, PasswordField pfPassword, TextField tfStreet, TextField tfHouseNumber, TextField tfPostalCode, TextField tfCity, TextField tfChild, MainController controller)
{ {
boolean phoneNumberMatchFound; boolean phoneNumberMatchFound;
boolean passwordMatchFound; boolean passwordMatchFound;

View File

@ -1,42 +0,0 @@
//package com.example.vpr_javafx;
//
//import java.io.IOException;
//import java.nio.file.Files;
//import java.nio.file.Paths;
//import java.util.HashMap;
//import java.util.List;
//
//public class LoginDatei
//{
// private final String dateiname;
//
// public LoginDatei(String dateiname)
// {
// this.dateiname = dateiname;
// }
//
// public HashMap<String, String> readFile()
// {
// try {
// List<String> lines = Files.readAllLines(Paths.get(dateiname));
//
// 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<>();
// }
// }
//}

View File

@ -7,15 +7,15 @@ import javafx.stage.Stage;
import java.io.IOException; import java.io.IOException;
public class HelloApplication extends Application { public class MainApplication extends Application {
@Override @Override
public void start(Stage stage) throws IOException { public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("MenuOverview-view.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("MenuOverview-view.fxml"));
Scene scene = new Scene(fxmlLoader.load(),1000, 800); Scene scene = new Scene(fxmlLoader.load(),1000, 800);
stage.setTitle("Mittagsbestellung"); stage.setTitle("Mittagsbestellung");
stage.setScene(scene); stage.setScene(scene);
stage.show(); stage.show();
HelloController controller = fxmlLoader.getController(); MainController controller = fxmlLoader.getController();
controller.FillLabels(); controller.FillLabels();
controller.writeAllergene(); controller.writeAllergene();
} }

View File

@ -12,7 +12,6 @@ import javafx.scene.Scene;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.scene.image.ImageView; import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.StackPane; import javafx.scene.layout.StackPane;
import javafx.stage.Stage; import javafx.stage.Stage;
import java.io.FileWriter; import java.io.FileWriter;
@ -22,7 +21,7 @@ import java.nio.file.Paths;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class HelloController { public class MainController {
@FXML @FXML
private Label lMonH1; private Label lMonH1;

View File

@ -7,7 +7,7 @@
<?import javafx.scene.shape.*?> <?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<AnchorPane fx:id="anchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="795.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"> <AnchorPane fx:id="anchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="795.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.MainController">
<Label layoutX="97.0" layoutY="176.0" text="Montag" textFill="#6f7baf"> <Label layoutX="97.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" />

View File

@ -6,7 +6,7 @@
<?import javafx.scene.shape.*?> <?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController"> <AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.MainController">
<Label layoutX="27.0" layoutY="160.0" style="-fx-font-weight: bold; -fx-font-family: century gothic; -fx-font-size: 14; -fx-text-fill: #746FA6;" text="Montag" textFill="BLUE"> <Label layoutX="27.0" layoutY="160.0" style="-fx-font-weight: bold; -fx-font-family: century gothic; -fx-font-size: 14; -fx-text-fill: #746FA6;" text="Montag" textFill="BLUE">
<font> <font>
<Font name="Century Gothic" size="13.0" /> <Font name="Century Gothic" size="13.0" />

View File

@ -3,7 +3,7 @@
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController"> <AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.MainController">
<children> <children>
<GridPane layoutX="81.0" layoutY="50.0" prefHeight="272.0" prefWidth="496.0"> <GridPane layoutX="81.0" layoutY="50.0" prefHeight="272.0" prefWidth="496.0">
<columnConstraints> <columnConstraints>

View File

@ -4,7 +4,7 @@
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #F0C8BD;" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController"> <AnchorPane prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #F0C8BD;" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.MainController">
<children> <children>
<GridPane layoutX="50.0" layoutY="62.0" prefHeight="275.0" prefWidth="500.0" style="-fx-background-color: #F0C8BD;"> <GridPane layoutX="50.0" layoutY="62.0" prefHeight="275.0" prefWidth="500.0" style="-fx-background-color: #F0C8BD;">
<columnConstraints> <columnConstraints>

View File

@ -12,7 +12,7 @@
<?import javafx.scene.shape.Line?> <?import javafx.scene.shape.Line?>
<?import javafx.scene.text.Font?> <?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/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.MainController">
<Label layoutX="76.0" layoutY="176.0" text="Montag" 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" />

View File

@ -7,7 +7,7 @@
<?import javafx.scene.shape.*?> <?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<AnchorPane fx:id="anchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="795.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"> <AnchorPane fx:id="anchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="795.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.MainController">
<Label layoutX="97.0" layoutY="176.0" text="Montag" textFill="#6f7baf"> <Label layoutX="97.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" />

View File

@ -6,7 +6,7 @@
<?import javafx.scene.shape.*?> <?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController"> <AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.MainController">
<Label layoutX="27.0" layoutY="160.0" style="-fx-font-weight: bold; -fx-font-family: century gothic; -fx-font-size: 14; -fx-text-fill: #746FA6;" text="Montag" textFill="BLUE"> <Label layoutX="27.0" layoutY="160.0" style="-fx-font-weight: bold; -fx-font-family: century gothic; -fx-font-size: 14; -fx-text-fill: #746FA6;" text="Montag" textFill="BLUE">
<font> <font>
<Font name="Century Gothic" size="13.0" /> <Font name="Century Gothic" size="13.0" />

View File

@ -3,7 +3,7 @@
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController"> <AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.MainController">
<children> <children>
<GridPane layoutX="81.0" layoutY="50.0" prefHeight="272.0" prefWidth="496.0"> <GridPane layoutX="81.0" layoutY="50.0" prefHeight="272.0" prefWidth="496.0">
<columnConstraints> <columnConstraints>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.HelloController"> <AnchorPane prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #F0C8BD;" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.MainController">
<children> <children>
<GridPane layoutX="50.0" layoutY="62.0" prefHeight="275.0" prefWidth="500.0"> <GridPane layoutX="50.0" layoutY="62.0" prefHeight="275.0" prefWidth="500.0" style="-fx-background-color: #F0C8BD;">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="153.0" minWidth="10.0" prefWidth="85.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="153.0" minWidth="10.0" prefWidth="85.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="261.0" minWidth="10.0" prefWidth="200.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="261.0" minWidth="10.0" prefWidth="200.0" />
@ -23,22 +23,70 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<children> <children>
<Label text="Name" /> <Label text="Name:" textFill="#746fa6">
<Label text="Handynummer" GridPane.rowIndex="1" /> <font>
<Label prefWidth="95.0" text="Passwort: " GridPane.rowIndex="2" /> <Font name="Century Gothic Bold" size="12.0" />
<Label text="Kind:" GridPane.rowIndex="5" /> </font></Label>
<Label text="Straße" GridPane.rowIndex="3" /> <Label text="Handynummer:" textFill="#746fa6" GridPane.rowIndex="1">
<Label text="Ort" GridPane.rowIndex="4" /> <font>
<Button mnemonicParsing="false" onAction="#OnRegistrationButton" prefHeight="26.0" prefWidth="90.0" text="Abschicken" translateX="100.0" GridPane.columnIndex="1" GridPane.rowIndex="7" /> <Font name="Century Gothic Bold" size="12.0" />
<PasswordField fx:id="pfPassword" promptText="Passwort" GridPane.columnIndex="1" GridPane.rowIndex="2" /> </font></Label>
<TextField fx:id="tfName" promptText="Voller Name" GridPane.columnIndex="1" /> <Label prefWidth="95.0" text="Passwort: " textFill="#746fa6" GridPane.rowIndex="2">
<TextField fx:id="tfPhone" promptText="Handynummer" GridPane.columnIndex="1" GridPane.rowIndex="1" /> <font>
<TextField fx:id="tfChild" promptText="Kind" GridPane.columnIndex="1" GridPane.rowIndex="5" /> <Font name="Century Gothic Bold" size="12.0" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="4" /> </font></Label>
<TextField fx:id="tfStreet" prefWidth="254.0" promptText="Straße" GridPane.columnIndex="1" GridPane.rowIndex="3" /> <Label text="Kind:" textFill="#746fa6" GridPane.rowIndex="5">
<TextField fx:id="tfHouseNumber" prefWidth="123.0" promptText="Hausnummer" GridPane.columnIndex="2" GridPane.rowIndex="3"/> <font>
<TextField fx:id="tfPostalCode" promptText="Postleitzahl" GridPane.columnIndex="1" GridPane.rowIndex="4" /> <Font name="Century Gothic Bold" size="12.0" />
<TextField fx:id="tfCity" promptText="Ort" GridPane.columnIndex="2" GridPane.rowIndex="4" /> </font></Label>
<Label text="Straße:" textFill="#746fa6" GridPane.rowIndex="3">
<font>
<Font name="Century Gothic Bold" size="12.0" />
</font></Label>
<Label text="Ort:" textFill="#746fa6" GridPane.rowIndex="4">
<font>
<Font name="Century Gothic Bold" size="12.0" />
</font></Label>
<Button mnemonicParsing="false" onAction="#OnRegistrationButton" prefHeight="26.0" prefWidth="90.0" style="-fx-background-color: #CBC7F0; -fx-border-color: #746FA6;" text="Abschicken" textFill="WHITE" translateX="100.0" GridPane.columnIndex="1" GridPane.rowIndex="7">
<font>
<Font name="Century Gothic" size="12.0" />
</font></Button>
<PasswordField fx:id="pfPassword" promptText="Passwort" GridPane.columnIndex="1" GridPane.rowIndex="2">
<font>
<Font name="Century Gothic" size="12.0" />
</font></PasswordField>
<TextField fx:id="tfName" promptText="Voller Name" GridPane.columnIndex="1">
<font>
<Font name="Century Gothic" size="12.0" />
</font></TextField>
<TextField fx:id="tfPhone" promptText="Handynummer" GridPane.columnIndex="1" GridPane.rowIndex="1">
<font>
<Font name="Century Gothic" size="12.0" />
</font></TextField>
<TextField fx:id="tfChild" promptText="Kind" GridPane.columnIndex="1" GridPane.rowIndex="5">
<font>
<Font name="Century Gothic" size="12.0" />
</font></TextField>
<TextField GridPane.columnIndex="1" GridPane.rowIndex="4">
<font>
<Font name="Century Gothic" size="12.0" />
</font></TextField>
<TextField fx:id="tfStreet" prefWidth="254.0" promptText="Straße" GridPane.columnIndex="1" GridPane.rowIndex="3">
<font>
<Font name="Century Gothic" size="12.0" />
</font></TextField>
<TextField fx:id="tfHouseNumber" prefWidth="123.0" promptText="Hausnummer" GridPane.columnIndex="2" GridPane.rowIndex="3">
<font>
<Font name="Century Gothic" size="12.0" />
</font></TextField>
<TextField fx:id="tfPostalCode" promptText="Postleitzahl" GridPane.columnIndex="1" GridPane.rowIndex="4">
<font>
<Font name="Century Gothic" size="12.0" />
</font></TextField>
<TextField fx:id="tfCity" promptText="Ort" GridPane.columnIndex="2" GridPane.rowIndex="4">
<font>
<Font name="Century Gothic" size="12.0" />
</font></TextField>
</children> </children>
</GridPane> </GridPane>

View File

@ -12,7 +12,7 @@
<?import javafx.scene.shape.Line?> <?import javafx.scene.shape.Line?>
<?import javafx.scene.text.Font?> <?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/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vpr_javafx.MainController">
<Label layoutX="76.0" layoutY="176.0" text="Montag" 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" />