Compare commits
8 Commits
KindImplem
...
412d9d7497
Author | SHA1 | Date | |
---|---|---|---|
412d9d7497 | |||
2b719ea39f | |||
2652f5e9ac | |||
ce161a6caf | |||
7f4fde9f4a | |||
ca919637a3 | |||
d69a3d6010 | |||
aa9baabb5c |
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@@ -7,8 +7,9 @@
|
|||||||
<option value="$PROJECT_DIR$/pom.xml" />
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="workspaceImportForciblyTurnedOn" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
50
src/main/java/Logik/Account.java
Normal file
50
src/main/java/Logik/Account.java
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
// Programmiert von Samuel Wolff
|
||||||
|
// Noch nicht getestet
|
||||||
|
|
||||||
|
package Logik;
|
||||||
|
|
||||||
|
public class Account {
|
||||||
|
|
||||||
|
// region Felder
|
||||||
|
private String passwort;
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private String benutzername;
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Getter & Setter
|
||||||
|
public String getPasswort() {
|
||||||
|
return passwort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPasswort(String passwort) {
|
||||||
|
this.passwort = passwort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getBenutzername() {
|
||||||
|
return benutzername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBenutzername(String benutzername) {
|
||||||
|
this.benutzername = benutzername;
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Konstruktoren
|
||||||
|
public Account(String passwort, String benutzername) {
|
||||||
|
this.passwort = passwort;
|
||||||
|
this.benutzername = benutzername;
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
}
|
72
src/main/java/Logik/Benutzer.java
Normal file
72
src/main/java/Logik/Benutzer.java
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
// Programmiert von Samuel Wolff
|
||||||
|
// Noch nicht getestet
|
||||||
|
|
||||||
|
//
|
||||||
|
// TODO: Methoden implementieren!
|
||||||
|
//
|
||||||
|
|
||||||
|
package Logik;
|
||||||
|
|
||||||
|
import java.nio.file.WatchEvent;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Benutzer extends Account {
|
||||||
|
|
||||||
|
// region Felder
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private ArrayList<Kind> kinder;
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Getter & Setter
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<Kind> getKinder() {
|
||||||
|
return kinder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKinder(ArrayList<Kind> kinder) {
|
||||||
|
this.kinder = kinder;
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Konstruktoren
|
||||||
|
public Benutzer(String passwort, String benutzername, String email) {
|
||||||
|
super(passwort, benutzername);
|
||||||
|
this.email = email;
|
||||||
|
kinder = new ArrayList<>();
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Methoden
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lädt eine Rechnung herunter
|
||||||
|
*/
|
||||||
|
public void rechnungHerunterladen() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bestellt eine Mahlzeit
|
||||||
|
*/
|
||||||
|
public void mahlzeitBestellen() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeigt Rechnungen gefiltert an
|
||||||
|
* @param params Die Filter Argumente
|
||||||
|
*/
|
||||||
|
public void rechnungAnzeigen(String params) {
|
||||||
|
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
}
|
59
src/main/java/Logik/Kind.java
Normal file
59
src/main/java/Logik/Kind.java
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
package Logik;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Kind {
|
||||||
|
|
||||||
|
// region Felder
|
||||||
|
private String name;
|
||||||
|
private String vorname;
|
||||||
|
private int id;
|
||||||
|
// TODO Zutat implementieren!
|
||||||
|
// private ArrayList<Zutat> filter;
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Getter & Setter
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVorname() {
|
||||||
|
return vorname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVorname(String vorname) {
|
||||||
|
this.vorname = vorname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO Zutat implementieren!
|
||||||
|
/*
|
||||||
|
public ArrayList<Zutat> getFilter() {
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFilter(ArrayList<Zutat> filter) {
|
||||||
|
this.filter = filter;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Konstruktoren
|
||||||
|
public Kind(String name, String vorname) {
|
||||||
|
this.name = name;
|
||||||
|
this.vorname = vorname;
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
}
|
87
src/main/java/Logik/MitarbeiterAccount.java
Normal file
87
src/main/java/Logik/MitarbeiterAccount.java
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
// Programmiert von Samuel Wolff
|
||||||
|
// Noch nicht getestet
|
||||||
|
|
||||||
|
//
|
||||||
|
// TODO Methoden implementieren
|
||||||
|
//
|
||||||
|
|
||||||
|
package Logik;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class MitarbeiterAccount extends Account {
|
||||||
|
|
||||||
|
// region Konstrukoren
|
||||||
|
public MitarbeiterAccount(String passwort, String benutzername) {
|
||||||
|
super(passwort, benutzername);
|
||||||
|
}
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
// region Methoden
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das Passwort eines gegebenen Accounts auf das gegebene Passwort zurück
|
||||||
|
* @param other Der Accout dessen Passwort zurückgesetzt wird
|
||||||
|
* @param passwort Das neue Passwort
|
||||||
|
*/
|
||||||
|
public void passwortZurzecksetzen(Account other, String passwort) {
|
||||||
|
// Soll das so?
|
||||||
|
other.setPasswort(passwort);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bestellt eine Mahlzeit
|
||||||
|
*/
|
||||||
|
public void mahlzeitBestellen() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ändert einen Tagesplan
|
||||||
|
*/
|
||||||
|
public void tagesplanAendern() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erstellt einen neuen Account und fügt ihn in die Datenbank ein
|
||||||
|
* @param passwort Passwort des neuen Accounts
|
||||||
|
* @param benutzername Benutzername des neuen Accounts
|
||||||
|
* @param email Die E-Mail mit der sich der User einloggt
|
||||||
|
* @param kinder Eine Liste mit allen zugehörigen Kindern des Accounts
|
||||||
|
*/
|
||||||
|
public void accountErstellen(String passwort, String benutzername, String email, ArrayList<Kind> kinder) {
|
||||||
|
Benutzer newAccount = new Benutzer(passwort, benutzername, email);
|
||||||
|
newAccount.setKinder(kinder);
|
||||||
|
// Id muss aus der Datenbank geholt werden und dann gesetzt werden
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeigt Rechnungen gefilter nach params an
|
||||||
|
* @param params Die Filter Arguemente
|
||||||
|
*/
|
||||||
|
public void rechnungAnzeigen(String[] params) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO sollte hier nicht noch ein User mitgegeben werden?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Weist ein Kind einem Account zu
|
||||||
|
* @param kind Das zuzuweisende Kind
|
||||||
|
*/
|
||||||
|
public void kinderZuweisen(Kind kind) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO hier auch?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeigt einen Benutzer an
|
||||||
|
*/
|
||||||
|
public void zeigeBenutzer() {
|
||||||
|
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
}
|
@@ -33,7 +33,7 @@ public class AccounterstellungMitarbeiter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onAbmelden(ActionEvent actionEvent) {
|
public void onAbmelden(ActionEvent actionEvent) {
|
||||||
VerwaltungApplication.abmelden();
|
//VerwaltungApplication.abmelden();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTypMitarbeiter(ActionEvent actionEvent) {
|
public void onTypMitarbeiter(ActionEvent actionEvent) {
|
||||||
|
@@ -0,0 +1,53 @@
|
|||||||
|
package de.subway_surfers.vpr_app;
|
||||||
|
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.geometry.Pos;
|
||||||
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.control.Control;
|
||||||
|
import javafx.scene.layout.ColumnConstraints;
|
||||||
|
import javafx.scene.layout.GridPane;
|
||||||
|
import javafx.scene.layout.Priority;
|
||||||
|
import javafx.scene.layout.RowConstraints;
|
||||||
|
|
||||||
|
|
||||||
|
public class EssensverwaltungMitarbeiterView {
|
||||||
|
@FXML
|
||||||
|
private GridPane tagesplan;
|
||||||
|
|
||||||
|
public void initialize(){
|
||||||
|
for (int i = 0; i < tagesplan.getColumnCount(); i++) {
|
||||||
|
ColumnConstraints cc = new ColumnConstraints();
|
||||||
|
cc.setHgrow(Priority.ALWAYS);
|
||||||
|
cc.setFillWidth(true);
|
||||||
|
tagesplan.getColumnConstraints().add(cc);
|
||||||
|
}
|
||||||
|
VerwaltungApplication.responsiveBreiteGrid(tagesplan);
|
||||||
|
|
||||||
|
tagesplan.heightProperty().addListener((obs,oldValue,newValue) -> {
|
||||||
|
final int zeile = 1;
|
||||||
|
for (Node n : tagesplan.getChildren()){
|
||||||
|
if(n instanceof Control && GridPane.getRowIndex(n) == zeile){
|
||||||
|
((Control) n).setPrefHeight(newValue.floatValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
public void onAbmelden(ActionEvent actionEvent) {
|
||||||
|
VerwaltungApplication.sceneWechseln("login-view.fxml");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onFilter(ActionEvent actionEvent) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onHinzufuegen(ActionEvent actionEvent) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onZurueck(ActionEvent actionEvent) {
|
||||||
|
VerwaltungApplication.sceneWechseln("hauptmenue_mitarbeiter-view.fxml");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -5,7 +5,7 @@ import javafx.event.ActionEvent;
|
|||||||
public class HauptmenueMitarbeiterView {
|
public class HauptmenueMitarbeiterView {
|
||||||
|
|
||||||
public void onAbmelden(ActionEvent actionEvent) {
|
public void onAbmelden(ActionEvent actionEvent) {
|
||||||
VerwaltungApplication.abmelden();
|
//VerwaltungApplication.abmelden();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAccountAnlegen(ActionEvent actionEvent) {
|
public void onAccountAnlegen(ActionEvent actionEvent) {
|
||||||
|
@@ -2,8 +2,11 @@ package de.subway_surfers.vpr_app;
|
|||||||
|
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.scene.Node;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
|
import javafx.scene.control.Control;
|
||||||
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -105,10 +108,25 @@ public class VerwaltungApplication extends Application {
|
|||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void abmelden() {
|
/**
|
||||||
sceneWechseln("login-view.fxml");
|
* Methode zum automatischen vergrößern und verkleinern von Grids
|
||||||
|
*
|
||||||
|
* Geschrieben: Max Heer, Sven Alteköster
|
||||||
|
* Getestet
|
||||||
|
*
|
||||||
|
* @param grid das responsiv sein soll
|
||||||
|
*/
|
||||||
|
public static void responsiveBreiteGrid (GridPane grid) {
|
||||||
|
grid.widthProperty().addListener((obs, oldValue, newValue) -> {
|
||||||
|
for (Node n : grid.getChildren()) {
|
||||||
|
if (n instanceof Control) {
|
||||||
|
((Control) n).setPrefWidth(newValue.floatValue() / grid.getColumnCount());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--Erstellt von Max Heer-->
|
||||||
|
|
||||||
|
<?import java.lang.*?>
|
||||||
|
<?import java.util.*?>
|
||||||
|
<?import javafx.scene.*?>
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
|
<BorderPane xmlns="http://javafx.com/javafx"
|
||||||
|
xmlns:fx="http://javafx.com/fxml"
|
||||||
|
fx:controller="de.subway_surfers.vpr_app.EssensverwaltungMitarbeiterView"
|
||||||
|
prefHeight="400.0" prefWidth="600.0"
|
||||||
|
stylesheets="@layout.css">
|
||||||
|
<top>
|
||||||
|
<BorderPane styleClass="kopfzeile">
|
||||||
|
<right>
|
||||||
|
<Button text="Abmelden" onAction="#onAbmelden"/>
|
||||||
|
</right>
|
||||||
|
<left>
|
||||||
|
<Button text="Zurück" onAction="#onZurueck"/>
|
||||||
|
</left>
|
||||||
|
</BorderPane>
|
||||||
|
</top>
|
||||||
|
<center>
|
||||||
|
<BorderPane>
|
||||||
|
<top>
|
||||||
|
<BorderPane>
|
||||||
|
<left>
|
||||||
|
<HBox styleClass="test" spacing="10">
|
||||||
|
<Button text="Filter" onAction="#onFilter"/>
|
||||||
|
<Button text="Hinzufügen" onAction="#onHinzufuegen"/>
|
||||||
|
</HBox>
|
||||||
|
</left>
|
||||||
|
<right>
|
||||||
|
<HBox styleClass="test" spacing="10">
|
||||||
|
<Button styleClass="pfeil, links"/>
|
||||||
|
<Label text="Montag DD.MM.YY"/>
|
||||||
|
<Button styleClass="pfeil"/>
|
||||||
|
</HBox>
|
||||||
|
</right>
|
||||||
|
</BorderPane>
|
||||||
|
</top>
|
||||||
|
<center>
|
||||||
|
<AnchorPane>
|
||||||
|
<GridPane fx:id="tagesplan" AnchorPane.bottomAnchor="20" AnchorPane.rightAnchor="20" AnchorPane.leftAnchor="20" AnchorPane.topAnchor="20" styleClass="essensuebersicht_gridlines">
|
||||||
|
<Label text="GerichtName" GridPane.columnIndex="0" GridPane.rowIndex="0"/>
|
||||||
|
<Label GridPane.columnIndex="1" GridPane.rowIndex="0"/>
|
||||||
|
<Label GridPane.columnIndex="2" GridPane.rowIndex="0"/>
|
||||||
|
<Label GridPane.columnIndex="3" GridPane.rowIndex="0"/>
|
||||||
|
<Label GridPane.columnIndex="0" GridPane.rowIndex="1"/>
|
||||||
|
</GridPane>
|
||||||
|
</AnchorPane>
|
||||||
|
</center>
|
||||||
|
</BorderPane>
|
||||||
|
|
||||||
|
</center>
|
||||||
|
<bottom>
|
||||||
|
<BorderPane styleClass="button-untenrechts">
|
||||||
|
<right>
|
||||||
|
<Button text="Bestätigen" styleClass=".button"/>
|
||||||
|
</right>
|
||||||
|
</BorderPane>
|
||||||
|
</bottom>
|
||||||
|
</BorderPane>
|
Reference in New Issue
Block a user