moving commit to stable:

Richard Reiswich:
6e60fb1517
0a7f941d61
28dc4a7ab
9d7b981c22
This commit is contained in:
Malte Schulze Hobeling 2023-02-01 22:49:35 +01:00
parent 9b6d60a571
commit b9101e4a55
3 changed files with 287 additions and 246 deletions

View File

@ -1,24 +1,100 @@
/**
* Author: Reshad Meher
* Startseite
* fxml: menue-view.fxml
*/
package com.bib.essensbestellungsverwaltung;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.stage.Stage;
import java.io.IOException;
import javafx.scene.Node;
import javafx.scene.control.*;
public class MenueController {
@FXML
Button btFirstMealMon;
@FXML
Button btSecondMealMon;
@FXML
Button btNoMealMon;
@FXML
Button btFirstDessertMon;
@FXML
Button btSecondDessertMon;
@FXML
Button btNoDessertMon;
@FXML
Button btFirstMealTue;
@FXML
Button btSecondMealTue;
@FXML
Button btNoMealTue;
@FXML
Button btFirstDessertTue;
@FXML
Button btSecondDessertTue;
@FXML
Button btNoDessertTue;
@FXML
Button btFirstMealWed;
@FXML
Button btSecondMealWed;
@FXML
Button btNoMealWed;
@FXML
Button btFirstDessertWed;
@FXML
Button btSecondDessertWed;
@FXML
Button btNoDessertWed;
@FXML
Button btFirstMealThu;
@FXML
Button btSecondMealThu;
@FXML
Button btNoMealThu;
@FXML
Button btFirstDessertThu;
@FXML
Button btSecondDessertThu;
@FXML
Button btNoDessertThu;
@FXML
Button btFirstMealFri;
@FXML
Button btSecondMealFri;
@FXML
Button btNoMealFri;
@FXML
Button btFirstDessertFri;
@FXML
Button btSecondDessertFri;
@FXML
Button btNoDessertFri;
@FXML
ComboBox<String> cbPickChild;
@FXML
Button btLogin;
@FXML
Button btSaveOrder;
@FXML
ListView<String> lvFoodInfo;
private void setButtonActive(){
public ObservableList<Node> buttons = FXCollections.observableArrayList();
public void setButtonActive(ActionEvent event) {
Button b = (Button) event.getSource();
javafx.scene.Parent p = b.getParent();
buttons = p.getChildrenUnmodifiable();
for(Node button : buttons){
System.out.println(b.getStyleClass());
/*
b.getStyleClass().remove("active");
if (button.equals(b)){
b.getStyleClass().add("active");;
}
*/
}
}
}

View File

@ -10,15 +10,15 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane prefHeight="750.0" prefWidth="950.0" stylesheets="@menue.css" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.bib.essensbestellungsverwaltung.MenueController">
<AnchorPane prefHeight="600.0" prefWidth="900.0" stylesheets="@menue.css" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.bib.essensbestellungsverwaltung.MenueController">
<children>
<Label alignment="CENTER" layoutX="392.0" layoutY="25.0" prefHeight="40.0" prefWidth="223.0" text="Essen bestellen">
<Label alignment="CENTER" layoutX="14.0" layoutY="14.0" prefHeight="35.0" prefWidth="895.0" text="Essenbestellung">
<font>
<Font size="28.0" />
</font>
</Label>
<Button id="btLogin" alignment="CENTER" layoutX="848.0" layoutY="34.0" mnemonicParsing="false" text="Login" />
<HBox layoutX="220.0" layoutY="87.0" prefHeight="570.0" prefWidth="688.0">
<Button id="btLogin" fx:id="btLogin" alignment="CENTER" layoutX="848.0" layoutY="34.0" mnemonicParsing="false" text="Login" />
<HBox layoutX="220.0" layoutY="87.0" prefHeight="414.0" prefWidth="688.0">
<children>
<VBox prefHeight="350.0" prefWidth="180.0" style="-fx-background-color: transparent; -fx-padding: 5;">
<children>
@ -30,35 +30,25 @@
<Font size="18.0" />
</font>
</Label>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1">
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstMealMon" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" styleClass="btFood" text="Mahlzeit 1" />
<Button id="btFoodChoice" fx:id="btSecondMealMon" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" styleClass="btFood" text="Mahlzeit 2" />
<Button id="btFoodChoice" fx:id="btNoMealMon" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" styleClass="btFood" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin></Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin></Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="30.0" top="10.0" />
<Insets bottom="20.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 1">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin></Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin></Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="kein Dessert">
<VBox.margin>
<Insets top="10.0" />
</VBox.margin></Button>
</children>
<HBox.margin>
<Insets />
</HBox.margin>
</VBox>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstDessertMon" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 1" />
<Button id="btFoodChoice" fx:id="btSecondDessertMon" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 2" />
<Button id="btFoodChoice" fx:id="btNoDessertMon" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="kein Dessert" />
</children>
</VBox>
</children>
</VBox>
<VBox prefHeight="350.0" prefWidth="180.0" style="-fx-background-color: transparent; -fx-padding: 5;">
<children>
@ -70,38 +60,26 @@
<Font size="18.0" />
</font>
</Label>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1">
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstMealTue" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1" />
<Button id="btFoodChoice" fx:id="btSecondMealTue" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2" />
<Button id="btFoodChoice" fx:id="btNoMealTue" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="30.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 1">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="kein Dessert">
<VBox.margin>
<Insets top="10.0" />
<Insets bottom="20.0" />
</VBox.margin>
</Button>
</children>
</VBox>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstDessertTue" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 1" />
<Button id="btFoodChoice" fx:id="btSecondDessertTue" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 2" />
<Button id="btFoodChoice" fx:id="btNoDessertTue" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="kein Dessert" />
</children>
</VBox>
</children>
</VBox>
<VBox prefHeight="350.0" prefWidth="180.0" style="-fx-background-color: transparent; -fx-padding: 5;">
<children>
<Label alignment="CENTER" contentDisplay="TOP" prefHeight="23.0" prefWidth="196.0" style="-fx-background-color: lightdarkblue;" text="Mittwoch" textAlignment="CENTER">
@ -112,38 +90,26 @@
<Font size="18.0" />
</font>
</Label>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1">
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstMealWed" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1" />
<Button id="btFoodChoice" fx:id="btSecondMealWed" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2" />
<Button id="btFoodChoice" fx:id="btNoMealWed" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="30.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 1">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="kein Dessert">
<VBox.margin>
<Insets top="10.0" />
<Insets bottom="20.0" />
</VBox.margin>
</Button>
</children>
</VBox>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstDessertWed" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 1" />
<Button id="btFoodChoice" fx:id="btSecondDessertWed" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 2" />
<Button id="btFoodChoice" fx:id="btNoDessertWed" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="kein Dessert" />
</children>
</VBox>
</children>
</VBox>
<VBox prefHeight="350.0" prefWidth="180.0" style="-fx-background-color: transparent; -fx-padding: 5;">
<children>
<Label alignment="CENTER" contentDisplay="TOP" prefHeight="23.0" prefWidth="196.0" style="-fx-background-color: lightdarkblue;" text="Donnerstag" textAlignment="CENTER">
@ -154,38 +120,26 @@
<Font size="18.0" />
</font>
</Label>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1">
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstMealThu" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1" />
<Button id="btFoodChoice" fx:id="btSecondMealThu" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2" />
<Button id="btFoodChoice" fx:id="btNoMealThu" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="30.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 1">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="kein Dessert">
<VBox.margin>
<Insets top="10.0" />
<Insets bottom="20.0" />
</VBox.margin>
</Button>
</children>
</VBox>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstDessertThu" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 1" />
<Button id="btFoodChoice" fx:id="btSecondDessertThu" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 2" />
<Button id="btFoodChoice" fx:id="btNoDessertThu" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="kein Dessert" />
</children>
</VBox>
</children>
</VBox>
<VBox prefHeight="350.0" prefWidth="180.0" style="-fx-background-color: transparent; -fx-padding: 5;">
<children>
<Label alignment="CENTER" contentDisplay="TOP" prefHeight="23.0" prefWidth="196.0" style="-fx-background-color: lightdarkblue;" text="Freitag" textAlignment="CENTER">
@ -196,42 +150,30 @@
<Font size="18.0" />
</font>
</Label>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1">
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstMealFri" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1" />
<Button id="btFoodChoice" fx:id="btSecondMealFri" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2" />
<Button id="btFoodChoice" fx:id="btNoMealFri" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
<VBox.margin>
<Insets bottom="30.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 1">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="78.0" prefWidth="218.0" text="Dessert 2">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
</Button>
<Button id="btFoodChoice" alignment="CENTER" mnemonicParsing="false" prefHeight="20.0" prefWidth="170.0" text="kein Dessert">
<VBox.margin>
<Insets top="10.0" />
<Insets bottom="20.0" />
</VBox.margin>
</Button>
</children>
</VBox>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button id="btFoodChoice" fx:id="btFirstDessertFri" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 1" />
<Button id="btFoodChoice" fx:id="btSecondDessertFri" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Dessert 2" />
<Button id="btFoodChoice" fx:id="btNoDessertFri" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="kein Dessert" />
</children>
</VBox>
</children>
</VBox>
</children>
</HBox>
<Button id="btPlaceOrder" layoutX="436.0" layoutY="677.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="150.0" text="Bestellung speichern" />
<ComboBox id="cbChooseChild" layoutX="29.0" layoutY="34.0" prefWidth="150.0" promptText="Wähle Kind" stylesheets="@menue.css" />
<ListView id="lvShowDescription" layoutX="14.0" layoutY="151.0" prefHeight="475.0" prefWidth="200.0" />
<Button id="btPlaceOrder" fx:id="btSaveOrder" layoutX="379.0" layoutY="527.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="150.0" text="Bestellung abschicken" />
<ComboBox id="cbChooseChild" fx:id="cbPickChild" layoutX="29.0" layoutY="34.0" prefWidth="150.0" promptText="Wähle Kind" stylesheets="@menue.css" />
<ListView id="lvShowDescription" fx:id="lvFoodInfo" layoutX="20.0" layoutY="115.0" prefHeight="370.0" prefWidth="200.0" />
</children>
</AnchorPane>

View File

@ -1,10 +1,33 @@
.sidebar-nav_button {
-fx-background-color: #69b6ff;
-fx-text-fill: #123;
-fx-border-color: #000;
-fx-border-radius: 20;
}
.sidebar-nav_button.active {
-fx-background-color: #4e92b4;
#btFoodChoice{
-fx-background-color: transparent;
}
#btFoodChoice:hover{
-fx-underline: true;
-fx-text-fill: black;
}
#btPlaceOrder{
-fx-background-color: lightblue;
-fx-text-fill: white;
-fx-background-radius: 25;
}
#btPlaceOrder:hover{
-fx-border-width: 0;
-fx-text-fill: black;
-fx-underline: true;
}
#cbChooseChild{
-fx-background-color: lightgray;
}
.btFood{
-fx-background-color: transparent;
}
.btFood.active{
-fx-background-color: rgba(97, 97, 232, 0.3);
-fx-background-radius: 25;
}