From 28dcd4a7ab2b4bd1999d27aab2f0dfe9a0253c89 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 1 Feb 2023 18:23:19 +0100 Subject: [PATCH] MenueController Button highlight --- .../MenueController.java | 104 +++- .../menue-view.fxml | 483 ++++++------------ 2 files changed, 258 insertions(+), 329 deletions(-) diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java index aaa7f7a..6ce335c 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java @@ -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 cbPickChild; + @FXML + Button btLogin; + @FXML + Button btSaveOrder; + @FXML + ListView lvFoodInfo; - private void setButtonActive(){ + public ObservableList 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");; + } + */ + } } } diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml index 43deb3c..7b70ae0 100644 --- a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml +++ b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml @@ -3,324 +3,177 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +