Compare commits
5 Commits
54c3b9f3f5
...
Richards_B
Author | SHA1 | Date | |
---|---|---|---|
3ca6aa017a | |||
f5ca04983c | |||
646d63c6c0 | |||
e4eb47aa05 | |||
ba3b92b3c4 |
@@ -5,7 +5,6 @@ import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
|
||||
public class MenueController {
|
||||
|
||||
@@ -80,177 +79,22 @@ public class MenueController {
|
||||
|
||||
public ObservableList<Node> buttons = FXCollections.observableArrayList();
|
||||
|
||||
public void setButtonActive(){
|
||||
|
||||
}
|
||||
public void setButtonActive(ActionEvent event) {
|
||||
Button b = (Button) event.getSource();
|
||||
|
||||
public ObservableList<Node> getSiblings(Button b) {
|
||||
javafx.scene.Parent p = b.getParent();
|
||||
buttons = p.getChildrenUnmodifiable();
|
||||
return buttons;
|
||||
}
|
||||
|
||||
|
||||
public void setButtonActive(Button b) {
|
||||
getSiblings(b);
|
||||
for(Node button : buttons){
|
||||
b.getStyleClass().remove("active");
|
||||
System.out.println(b.getStyleClass());
|
||||
/*
|
||||
b.getStyleClass().remove("active");
|
||||
|
||||
if (button.equals(b)){
|
||||
b.getStyleClass().add("active");;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtSecondMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btSecondMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtNoMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btNoMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstDessertMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstDessertMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtSecondDessertMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btSecondDessertMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtNoDessertMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btNoDessertMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealTueClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealTue);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtSecondMealTueClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btSecondMealTue);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtNoMealTueClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btNoMealTue);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstDessertTueClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstDessertTue);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtSecondDessertTueClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btSecondDessertTue);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtNoDessertTueClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btNoDessertTue);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealWedClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealWed);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtSecondMealWedClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btSecondMealWed);
|
||||
}
|
||||
/*
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onBtFirstMealMonClick(MouseEvent mouseEvent) {
|
||||
setButtonActive(btFirstMealMon);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@@ -32,9 +32,9 @@
|
||||
</Label>
|
||||
<VBox prefHeight="200.0" prefWidth="100.0">
|
||||
<children>
|
||||
<Button id="btFoodChoice" fx:id="btFirstMealMon" alignment="CENTER" mnemonicParsing="false" onAction="#onBtFirstMealMonClick" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1" />
|
||||
<Button id="btFoodChoice" fx:id="btSecondMealMon" alignment="CENTER" mnemonicParsing="false" onAction="#onBtSecondMealMonClick" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2" />
|
||||
<Button id="btFoodChoice" fx:id="btNoMealMon" alignment="CENTER" mnemonicParsing="false" onAction="#onBtNoMealMonClick" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
|
||||
<Button id="btFoodChoice" fx:id="btFirstMealMon" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 1" />
|
||||
<Button id="btFoodChoice" fx:id="btSecondMealMon" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="78.0" prefWidth="218.0" text="Mahlzeit 2" />
|
||||
<Button id="btFoodChoice" fx:id="btNoMealMon" alignment="CENTER" mnemonicParsing="false" onAction="#setButtonActive" prefHeight="20.0" prefWidth="170.0" text="Keine Mahlzeit">
|
||||
<VBox.margin>
|
||||
<Insets bottom="20.0" />
|
||||
</VBox.margin>
|
||||
|
Reference in New Issue
Block a user