BestelluebersichtMitarbeiter Maske (fast fertig)

This commit is contained in:
Avapox
2023-12-18 09:03:28 +01:00
parent 05c829a633
commit 62521c5b5c
4 changed files with 116 additions and 18 deletions

View File

@@ -1,19 +1,107 @@
package de.subway_surfers.vpr_app;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.ListView;
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 ListView listViewBestellMitarbeiter;
public void initialize(){
private ScrollPane scrollPane;
ScrollPane scrollPane = new ScrollPane();
@FXML
private Accordion accordion;
scrollPane.hbarPolicyProperty().setValue(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.vbarPolicyProperty().setValue(ScrollPane.ScrollBarPolicy.ALWAYS);
scrollPane.setContent(listViewBestellMitarbeiter);
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

@@ -14,7 +14,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);