#54 update Seasons enum + update method name + javadoc update

This commit is contained in:
giavaphi
2022-11-05 17:19:41 +01:00
parent 2cf7f55215
commit e92538fbb4
3 changed files with 19 additions and 15 deletions
@@ -20,7 +20,6 @@ import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.VBox;
import javafx.stage.Modality;
import javafx.stage.Stage;
@@ -55,17 +54,17 @@ public class PlantsController implements Initializable {
private ListView<Plant> list_plants;
@FXML
private Button saveToMyPlant_button;
private Button selectSowDay_button;
@FXML
private TextField search_plants;
/**
* saves the current selected plant in new JSON database
* open new window to select sow or harvest day to save the crop
* @param event event
*/
@FXML
void saveToMyPlant(ActionEvent event) throws IOException {
void selectSowDate(ActionEvent event) throws IOException {
Parent root;
FXMLLoader fxmlLoader = new FXMLLoader(Objects.requireNonNull(getClass().getResource("SelectSowDay.fxml")));
root = fxmlLoader.load();
@@ -92,7 +91,7 @@ public class PlantsController implements Initializable {
list_plants.itemsProperty().bind(plantListProperty);
description_plant.setText("");
saveToMyPlant_button.setDisable(true);
selectSowDay_button.setDisable(true);
createFilterSeasons();
createFilterHardinessZone();
@@ -202,7 +201,7 @@ public class PlantsController implements Initializable {
private void createFilterSeasons() {
ToggleGroup seasonGroup = new ToggleGroup();
for (Seasons season : Seasons.values()) {
RadioButton radioButton = new RadioButton(season.name());
RadioButton radioButton = new RadioButton(season.getName());
radioButton.setToggleGroup(seasonGroup);
radioButton.setPadding(new Insets(0,0,10,0));
if (season.equals(Seasons.AllSEASONS)) {
@@ -239,7 +238,7 @@ public class PlantsController implements Initializable {
if(newValue != null) {
selectedPlant = newValue;
description_plant.setText(selectedPlant.description());
saveToMyPlant_button.setDisable(false);
selectSowDay_button.setDisable(false);
Image img;
if(selectedPlant.image() != null) {
img = selectedPlant.image();
@@ -252,7 +251,7 @@ public class PlantsController implements Initializable {
} else {
selectedPlant = null;
description_plant.setText("");
saveToMyPlant_button.setDisable(true);
selectSowDay_button.setDisable(true);
Image img = new Image(String.valueOf(PlantsController.class.getResource("placeholder.png")));
img_plant.setImage(img);
}