From f54b39b1f2bf756dc80d5ab6d1426b3ea15e5899 Mon Sep 17 00:00:00 2001 From: giavaphi Date: Fri, 9 Dec 2022 06:59:37 +0100 Subject: [PATCH] updated style --- .../CropDetailController.java | 17 ++++ .../gartenverwaltung/MainFXMLController.java | 12 ++- .../gartenverwaltung/MyGardenController.java | 9 ++ .../MyScheduleController.java | 2 + .../gartenverwaltung/PlantsController.java | 5 ++ .../gartenverwaltung/SettingsController.java | 5 ++ .../ch/zhaw/gartenverwaltung/CropDetail.fxml | 13 +-- .../ch/zhaw/gartenverwaltung/Home.fxml | 10 +-- .../ch/zhaw/gartenverwaltung/MyGarden.fxml | 4 +- .../ch/zhaw/gartenverwaltung/MySchedule.fxml | 4 +- .../ch/zhaw/gartenverwaltung/Plants.fxml | 14 +-- .../ch/zhaw/gartenverwaltung/Tutorial.fxml | 6 +- .../bootstrap/dialogStyle.css | 86 +++++++++++++++++++ .../gartenverwaltung/bootstrap/styles.css | 74 ++++++++++++++-- 14 files changed, 229 insertions(+), 32 deletions(-) create mode 100644 src/main/resources/ch/zhaw/gartenverwaltung/bootstrap/dialogStyle.css diff --git a/src/main/java/ch/zhaw/gartenverwaltung/CropDetailController.java b/src/main/java/ch/zhaw/gartenverwaltung/CropDetailController.java index ab76e34..a8095b6 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/CropDetailController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/CropDetailController.java @@ -28,6 +28,7 @@ import javafx.stage.Stage; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.logging.Level; import java.util.logging.Logger; @@ -222,6 +223,8 @@ public class CropDetailController { Button edit = new Button(); Button delete = new Button(); + edit.getStyleClass().add("button-class"); + delete.getStyleClass().add("button-class"); HBox.setHgrow(edit, Priority.NEVER); HBox.setHgrow(delete, Priority.NEVER); setIconToButton(edit, "editIcon.png"); @@ -305,6 +308,10 @@ public class CropDetailController { DialogPane dialogPane = dialog.getDialogPane(); + dialogPane.getStylesheets().add( + Objects.requireNonNull(getClass().getResource("bootstrap/dialogStyle.css")).toExternalForm()); + dialogPane.getStyleClass().add("myDialog"); + ButtonType saveTask; if(newTask) { saveTask = new ButtonType("Add", ButtonBar.ButtonData.OK_DONE); @@ -351,6 +358,10 @@ public class CropDetailController { DialogPane dialogPane = dialog.getDialogPane(); + dialogPane.getStylesheets().add( + Objects.requireNonNull(getClass().getResource("bootstrap/dialogStyle.css")).toExternalForm()); + dialogPane.getStyleClass().add("myDialog"); + ButtonType save = new ButtonType("Save", ButtonBar.ButtonData.OK_DONE); dialogPane.getButtonTypes().addAll(save, ButtonType.CANCEL); @@ -382,6 +393,12 @@ public class CropDetailController { alert.setTitle("Delete " + task.getName()); alert.setHeaderText("Are you sure want to delete this Task?"); + DialogPane dialogPane = alert.getDialogPane(); + + dialogPane.getStylesheets().add( + Objects.requireNonNull(getClass().getResource("bootstrap/dialogStyle.css")).toExternalForm()); + dialogPane.getStyleClass().add("myDialog"); + alert.showAndWait() .ifPresent(buttonType -> { if (buttonType == ButtonType.OK) { diff --git a/src/main/java/ch/zhaw/gartenverwaltung/MainFXMLController.java b/src/main/java/ch/zhaw/gartenverwaltung/MainFXMLController.java index 9877d22..cc2ffb7 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/MainFXMLController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/MainFXMLController.java @@ -16,6 +16,7 @@ import javafx.stage.Stage; import javafx.stage.WindowEvent; import java.io.IOException; +import java.util.Objects; import java.util.logging.Level; import java.util.logging.Logger; @@ -89,6 +90,10 @@ public class MainFXMLController { DialogPane dialogPane = dialog.getDialogPane(); + dialogPane.getStylesheets().add( + Objects.requireNonNull(getClass().getResource("bootstrap/dialogStyle.css")).toExternalForm()); + dialogPane.getStyleClass().add("myDialog"); + ButtonType saveSettings = new ButtonType("Save", ButtonBar.ButtonData.OK_DONE); dialogPane.getButtonTypes().addAll(saveSettings, ButtonType.CANCEL); @@ -156,7 +161,12 @@ public class MainFXMLController { } private void styleChangeButton(Button button) { - //ToDo changeStyle of the menu buttons + /*home_button.setStyle("-fx-background-color: rgb(0,128,0)"); + myGarden_button.setStyle("-fx-background-color: rgb(0,128,0)"); + mySchedule_button.setStyle("-fx-background-color: rgb(0,128,0)"); + settings_button.setStyle("-fx-background-color: rgb(0,128,0)"); + tutorial_button.setStyle("-fx-background-color: rgb(0,128,0)"); + button.setStyle("-fx-background-color: darkgreen");*/ } /** diff --git a/src/main/java/ch/zhaw/gartenverwaltung/MyGardenController.java b/src/main/java/ch/zhaw/gartenverwaltung/MyGardenController.java index 49fc9a0..f69ec9d 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/MyGardenController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/MyGardenController.java @@ -117,6 +117,9 @@ public class MyGardenController { Button details = new Button(); Button delete = new Button(); + details.getStyleClass().add("button-class"); + delete.getStyleClass().add("button-class"); + setIconToButton(details, "detailsIcon.png"); setIconToButton(delete, "deleteIcon.png"); details.setOnAction(getGoToCropDetailEvent(crop)); @@ -186,6 +189,12 @@ public class MyGardenController { Plant plant = plantList.getPlantById(Settings.getInstance().getCurrentHardinessZone(), crop.getPlantId()).get(); Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setTitle("Delete " + plant.name()); + DialogPane dialogPane = alert.getDialogPane(); + + dialogPane.getStylesheets().add( + Objects.requireNonNull(getClass().getResource("bootstrap/dialogStyle.css")).toExternalForm()); + dialogPane.getStyleClass().add("myDialog"); + alert.setHeaderText("Are you sure want to delete this Crop?"); alert.setContentText("Deleting this crop will remove all associated tasks from your schedule."); diff --git a/src/main/java/ch/zhaw/gartenverwaltung/MyScheduleController.java b/src/main/java/ch/zhaw/gartenverwaltung/MyScheduleController.java index 768b3aa..e9db661 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/MyScheduleController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/MyScheduleController.java @@ -169,6 +169,8 @@ public class MyScheduleController { Pane puffer = new Pane(); HBox.setHgrow(puffer, Priority.ALWAYS); Button button = new Button("Task completed!"); + button.getStyleClass().add("button-class"); + button.setOnAction(new EventHandler() { @Override public void handle(ActionEvent event) { diff --git a/src/main/java/ch/zhaw/gartenverwaltung/PlantsController.java b/src/main/java/ch/zhaw/gartenverwaltung/PlantsController.java index cc8e997..d29d097 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/PlantsController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/PlantsController.java @@ -25,6 +25,7 @@ import javafx.scene.layout.VBox; import java.io.IOException; import java.time.LocalDate; import java.util.List; +import java.util.Objects; import java.util.logging.Level; import java.util.logging.Logger; @@ -82,6 +83,10 @@ public class PlantsController { DialogPane dialogPane = dateSelection.getDialogPane(); + dialogPane.getStylesheets().add( + Objects.requireNonNull(getClass().getResource("bootstrap/dialogStyle.css")).toExternalForm()); + dialogPane.getStyleClass().add("myDialog"); + ButtonType sowButton = new ButtonType("Save", ButtonBar.ButtonData.OK_DONE); dialogPane.getButtonTypes().addAll(sowButton, ButtonType.CANCEL); diff --git a/src/main/java/ch/zhaw/gartenverwaltung/SettingsController.java b/src/main/java/ch/zhaw/gartenverwaltung/SettingsController.java index e9301e2..db076db 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/SettingsController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/SettingsController.java @@ -12,6 +12,7 @@ import javafx.scene.image.ImageView; import java.io.IOException; import java.net.URL; +import java.util.Objects; import java.util.ResourceBundle; /** @@ -91,6 +92,10 @@ public class SettingsController implements Initializable { DialogPane dialogPane = dialog.getDialogPane(); + dialogPane.getStylesheets().add( + Objects.requireNonNull(getClass().getResource("bootstrap/dialogStyle.css")).toExternalForm()); + dialogPane.getStyleClass().add("myDialog"); + ButtonType save = new ButtonType("Save", ButtonBar.ButtonData.OK_DONE); dialogPane.getButtonTypes().addAll(save, ButtonType.CANCEL); diff --git a/src/main/resources/ch/zhaw/gartenverwaltung/CropDetail.fxml b/src/main/resources/ch/zhaw/gartenverwaltung/CropDetail.fxml index 86303a7..6a2e116 100644 --- a/src/main/resources/ch/zhaw/gartenverwaltung/CropDetail.fxml +++ b/src/main/resources/ch/zhaw/gartenverwaltung/CropDetail.fxml @@ -19,19 +19,19 @@ - - + + + @@ -86,7 +89,7 @@ -