BestelluebersichtMitarbeiter Maske (fast fertig)
This commit is contained in:
parent
05c829a633
commit
62521c5b5c
@ -1,19 +1,107 @@
|
|||||||
package de.subway_surfers.vpr_app;
|
package de.subway_surfers.vpr_app;
|
||||||
|
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
import javafx.fxml.FXML;
|
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.ScrollPane;
|
||||||
|
import javafx.scene.control.TitledPane;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class BestelluebersichtMitarbeiter {
|
public class BestelluebersichtMitarbeiter {
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private ListView listViewBestellMitarbeiter;
|
private ScrollPane scrollPane;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Accordion accordion;
|
||||||
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
|
||||||
ScrollPane scrollPane = new ScrollPane();
|
List<String> datum = new ArrayList<>();
|
||||||
|
|
||||||
scrollPane.hbarPolicyProperty().setValue(ScrollPane.ScrollBarPolicy.NEVER);
|
datum.add("15.10.1999");
|
||||||
scrollPane.vbarPolicyProperty().setValue(ScrollPane.ScrollBarPolicy.ALWAYS);
|
datum.add("23.12.2002");
|
||||||
scrollPane.setContent(listViewBestellMitarbeiter);
|
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");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ public class VerwaltungApplication extends Application {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage stage) throws IOException {
|
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());
|
Scene scene = new Scene(fxmlLoader.load());
|
||||||
|
|
||||||
stage.setWidth(960);
|
stage.setWidth(960);
|
||||||
|
@ -1,24 +1,28 @@
|
|||||||
<?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.*?>
|
||||||
|
|
||||||
<!-- Erstellt von Stefan Groß -->
|
<!-- Erstellt von Stefan Groß -->
|
||||||
<VBox xmlns="http://javafx.com/javafx"
|
|
||||||
xmlns:fx="http://javafx.com/fxml"
|
<VBox prefHeight="400.0" prefWidth="600.0" stylesheets="@layout.css" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.subway_surfers.vpr_app.BestelluebersichtMitarbeiter">
|
||||||
fx:controller="de.subway_surfers.vpr_app.BestelluebersichtMitarbeiter"
|
|
||||||
prefHeight="400.0" prefWidth="600.0" stylesheets="@layout.css">
|
|
||||||
|
|
||||||
<BorderPane styleClass="kopfzeile">
|
<BorderPane styleClass="kopfzeile">
|
||||||
<left>
|
<left>
|
||||||
<Button text="Zurück" fx:id="zurueck"/>
|
<Button fx:id="zurueck" text="Zurück"/>
|
||||||
</left>
|
</left>
|
||||||
<right>
|
<right>
|
||||||
<Button text="Abmelden" fx:id="abmelden"/>
|
<Button fx:id="abmelden" text="Abmelden" onAction="#onAbmelden"/>
|
||||||
</right>
|
</right>
|
||||||
</BorderPane>
|
</BorderPane>
|
||||||
|
|
||||||
<ScrollPane fitToHeight="true" fitToWidth="true">
|
<ScrollPane fx:id="scrollPane" fitToWidth="true" VBox.vgrow="ALWAYS">
|
||||||
<Label text="Test"/>
|
<padding>
|
||||||
<ListView fx:id="listViewBestellMitarbeiter"/>
|
<Insets bottom="30.0" left="30.0" right="30.0" top="30.0" />
|
||||||
|
</padding>
|
||||||
|
<Accordion fx:id="accordion">
|
||||||
|
</Accordion>
|
||||||
</ScrollPane>
|
</ScrollPane>
|
||||||
|
|
||||||
</VBox>
|
</VBox>
|
@ -61,3 +61,9 @@
|
|||||||
-fx-font-size: 30;
|
-fx-font-size: 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.titledPaneUeberschrift > .title {
|
||||||
|
-fx-pref-height: 50;
|
||||||
|
-fx-padding: 10 10 16 10;
|
||||||
|
-fx-font-size: 15;
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user