Merge remote-tracking branch 'origin/stefan'

# Conflicts:
#	src/main/resources/de/subway_surfers/vpr_app/layout.css
This commit is contained in:
2023-12-20 08:18:52 +01:00
5 changed files with 144 additions and 1 deletions

View File

@@ -0,0 +1,107 @@
package de.subway_surfers.vpr_app;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.geometry.Insets;
import javafx.scene.control.Accordion;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TitledPane;
import java.util.ArrayList;
import java.util.List;
public class BestelluebersichtMitarbeiter {
@FXML
private ScrollPane scrollPane;
@FXML
private Accordion accordion;
public void initialize() {
List<String> datum = new ArrayList<>();
datum.add("15.10.1999");
datum.add("23.12.2002");
datum.add("05.01.2020");
accordion.setStyle("-fx-box-border: transparent;");
for (String s : datum) {
TitledPane datumUeberschrift = new TitledPane(s, createGerichtAkkordion());
datumUeberschrift.getStyleClass().add("titledPaneUeberschrift");
datumUeberschrift.animatedProperty().set(false);
datumUeberschrift.setPadding(new Insets(0, 0, 15, 0));
accordion.getPanes().add(datumUeberschrift);
}
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS);
}
private Accordion createGerichtAkkordion() {
Accordion accordion = new Accordion();
int anzahlGerichtA = 1;
int anzahlGerichtB = 15;
int anzahlGerichtC = 3;
int anzahlGerichtD = 2;
double preisGerichtA = 4.99;
double preisGerichtB = 9.99;
double preisGerichtC = 3.99;
double preisGerichtD = 12.49;
int anzahlNachtischA = 2;
int anzahlNachtischB = 213;
double preisNachtischA = 0.49;
double preisNachtischB = 99.49;
if (anzahlGerichtA >= 1) {
TitledPane tp = new TitledPane();
tp.setText("GerichtA " + anzahlGerichtA + "-Mal " + preisGerichtA * anzahlGerichtA + "");
accordion.getPanes().addAll(tp);
}
if (anzahlGerichtB >= 1) {
TitledPane tp = new TitledPane();
tp.setText("GerichtB " + anzahlGerichtB + "-Mal " + preisGerichtB * anzahlGerichtB + "");
accordion.getPanes().addAll(tp);
}
if (anzahlGerichtC >= 1) {
TitledPane tp = new TitledPane();
tp.setText("GerichtC " + anzahlGerichtC + "-Mal " + preisGerichtC * anzahlGerichtC + "");
accordion.getPanes().addAll(tp);
}
if (anzahlGerichtD >= 1) {
TitledPane tp = new TitledPane();
tp.setText("GerichtD " + anzahlGerichtD + "-Mal " + preisGerichtD * anzahlGerichtD + "");
accordion.getPanes().addAll(tp);
}
if(anzahlNachtischA >= 1){
TitledPane tp = new TitledPane();
tp.setText("NachtischA " + anzahlNachtischA + "-Mal " + preisNachtischA * anzahlNachtischA + "");
accordion.getPanes().addAll(tp);
}
if(anzahlNachtischA >= 1){
TitledPane tp = new TitledPane();
tp.setText("NachtischB " + anzahlNachtischB + "-Mal " + preisNachtischB * anzahlNachtischB + "");
accordion.getPanes().addAll(tp);
}
return accordion;
}
public void onAbmelden(ActionEvent event) {
VerwaltungApplication.sceneWechseln("login-view.fxml");
}
}

View File

@@ -17,7 +17,7 @@ public class VerwaltungApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(VerwaltungApplication.class.getResource("login-view.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(VerwaltungApplication.class.getResource("bestelluebersicht_mitarbeiter-view.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setWidth(960);