Merge branch 'dev' into feature_weather

This commit is contained in:
gulerdav 2022-12-09 12:59:43 +01:00 committed by GitHub Enterprise
commit c9baf4dfb1
31 changed files with 799 additions and 422 deletions

View File

@ -31,6 +31,9 @@ import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
/**
* Controller class for the CropDetail.fxml file
*/
public class CropDetailController { public class CropDetailController {
private Crop crop; private Crop crop;
@ -63,15 +66,9 @@ public class CropDetailController {
@FXML @FXML
private Label description_label; private Label description_label;
@FXML
private Label location_label;
@FXML @FXML
private Label light_label; private Label light_label;
@FXML
private Button location_button;
@FXML @FXML
private Label soil_label; private Label soil_label;
@ -106,15 +103,7 @@ public class CropDetailController {
*/ */
@FXML @FXML
void setArea() throws IOException { void setArea() throws IOException {
openTextFieldDialog("set Text Area", "Text Area", area_label.getText(), false); openTextFieldDialog();
}
/**
* open dialog to set location
*/
@FXML
void setLocation() throws IOException {
openTextFieldDialog("set Location", "Location", location_label.getText(), true);
} }
/** /**
@ -138,7 +127,6 @@ public class CropDetailController {
imageView.setImage(plant.image()); imageView.setImage(plant.image());
} }
area_label.setText(String.valueOf(crop.getArea())); area_label.setText(String.valueOf(crop.getArea()));
location_label.setText("");
setTaskListProperty(crop); setTaskListProperty(crop);
taskList_listView.itemsProperty().bind(taskListProperty); taskList_listView.itemsProperty().bind(taskListProperty);
@ -152,11 +140,13 @@ public class CropDetailController {
} }
setIconToButton(addTask_button, "addIcon.png"); setIconToButton(addTask_button, "addIcon.png");
setIconToButton(area_button, "areaIcon.png"); setIconToButton(area_button, "areaIcon.png");
setIconToButton(location_button, "locationIcon.png");
setCellFactoryPests(); setCellFactoryPests();
setCellFactoryTasks(); setCellFactoryTasks();
} }
/**
* cell Factory for TaskListView
*/
private void setCellFactoryTasks() { private void setCellFactoryTasks() {
taskList_listView.setCellFactory(param -> new ListCell<>() { taskList_listView.setCellFactory(param -> new ListCell<>() {
@Override @Override
@ -174,6 +164,9 @@ public class CropDetailController {
}); });
} }
/**
* cell Factory for PestListView
*/
private void setCellFactoryPests() { private void setCellFactoryPests() {
pests_listView.setCellFactory(param -> new ListCell<>() { pests_listView.setCellFactory(param -> new ListCell<>() {
@Override @Override
@ -191,6 +184,10 @@ public class CropDetailController {
}); });
} }
/**
* update task list
* @param crop {@link Crop} that is selected
*/
private void setTaskListProperty(Crop crop) { private void setTaskListProperty(Crop crop) {
crop.getCropId().ifPresent(id -> { crop.getCropId().ifPresent(id -> {
List<Task> taskList; List<Task> taskList;
@ -205,6 +202,11 @@ public class CropDetailController {
}); });
} }
/**
* Creates a {@link HBox} for the given {@link Task}.
* @param task {@link Task} which is selected
* @return {@link HBox} that was created
*/
private HBox createTaskHBox(Task task) { private HBox createTaskHBox(Task task) {
HBox hBox = new HBox(10); HBox hBox = new HBox(10);
Label taskName = new Label(task.getName()+": "); Label taskName = new Label(task.getName()+": ");
@ -231,6 +233,11 @@ public class CropDetailController {
return hBox; return hBox;
} }
/**
* Creates a {@link HBox} for the given {@link Pest}.
* @param pest {@link Pest} which is selected
* @return {@link HBox} that was created
*/
private HBox createPestHBox(Pest pest) { private HBox createPestHBox(Pest pest) {
Label label = new Label(pest.name() + ": "); Label label = new Label(pest.name() + ": ");
label.setStyle("-fx-font-weight: bold"); label.setStyle("-fx-font-weight: bold");
@ -239,12 +246,8 @@ public class CropDetailController {
Label description = new Label(pest.description()); Label description = new Label(pest.description());
description.setAlignment(Pos.TOP_LEFT); description.setAlignment(Pos.TOP_LEFT);
description.setWrapText(true); description.setWrapText(true);
description.setMaxWidth(600); description.setMaxWidth(800);
Pane puffer = new Pane(); hBox.getChildren().addAll(label, description);
HBox.setHgrow(puffer, Priority.ALWAYS);
Button button = new Button("Get Counter Measures");
HBox.setHgrow(button, Priority.NEVER);
hBox.getChildren().addAll(label, description, puffer, button);
return hBox; return hBox;
} }
@ -261,6 +264,11 @@ public class CropDetailController {
button.setGraphic(imageView); button.setGraphic(imageView);
} }
/**
* opens dialog of {@link Task} edit.
* @param task {@link Task}
* @return {@link EventHandler} for the case of editing a {@link Task}
*/
private EventHandler<ActionEvent> getEditTaskEvent(Task task) { private EventHandler<ActionEvent> getEditTaskEvent(Task task) {
return (event) -> { return (event) -> {
try { try {
@ -271,12 +279,24 @@ public class CropDetailController {
}; };
} }
/**
* opens alert of {@link Task} deletion.
* @param task {@link Task}
* @return {@link EventHandler} for the case of deleting a {@link Task}
*/
private EventHandler<ActionEvent> deleteTask(Task task) { private EventHandler<ActionEvent> deleteTask(Task task) {
return (event) -> { return (event) -> {
showDeleteTask(task); showDeleteTask(task);
}; };
} }
/**
* opens a dialog to create a new Task or edit the given Task
* @param newTask boolean if it is a new Task
* @param givenTask {@link Task} which was selected
* @throws IOException Exception
* @throws HardinessZoneNotSetException Exception
*/
private void createTaskDialog(boolean newTask, Task givenTask) throws IOException, HardinessZoneNotSetException { private void createTaskDialog(boolean newTask, Task givenTask) throws IOException, HardinessZoneNotSetException {
Dialog<Task> dialog = new Dialog<>(); Dialog<Task> dialog = new Dialog<>();
dialog.setTitle("Set Task"); dialog.setTitle("Set Task");
@ -319,10 +339,14 @@ public class CropDetailController {
} }
private void openTextFieldDialog(String title, String labelDescription, String value, boolean isLocation) throws IOException { /**
* opens TextField Dialog to enter the plant area.
* @throws IOException Exception
*/
private void openTextFieldDialog() throws IOException {
Dialog<String> dialog = new Dialog<>(); Dialog<String> dialog = new Dialog<>();
dialog.setTitle(title); dialog.setTitle("set Text Area");
dialog.setHeaderText(title); dialog.setHeaderText("set Text Area");
dialog.setResizable(false); dialog.setResizable(false);
DialogPane dialogPane = dialog.getDialogPane(); DialogPane dialogPane = dialog.getDialogPane();
@ -331,30 +355,28 @@ public class CropDetailController {
dialogPane.getButtonTypes().addAll(save, ButtonType.CANCEL); dialogPane.getButtonTypes().addAll(save, ButtonType.CANCEL);
if (appLoader.loadPaneToDialog("TextFieldFormular.fxml", dialogPane) instanceof TextFieldFormularController controller) { if (appLoader.loadPaneToDialog("TextFieldFormular.fxml", dialogPane) instanceof TextFieldFormularController controller) {
controller.setDescription_label(labelDescription); controller.setDescription_label("Text Area");
controller.setValueTextArea(value); controller.setValueTextArea(area_label.getText());
controller.initSaveButton((Button) dialogPane.lookupButton(save)); controller.initSaveButton((Button) dialogPane.lookupButton(save));
dialog.setResultConverter(button -> button.equals(save) ? controller.getValue() : null); dialog.setResultConverter(button -> button.equals(save) ? controller.getValue() : null);
dialog.showAndWait() dialog.showAndWait()
.ifPresent(string -> { .ifPresent(string -> {
if (isLocation) {
System.out.println(string);
//ToDo method to set location
location_label.setText(string);
} else {
try { try {
garden.updateCrop(this.crop.withArea(Double.parseDouble(string))); garden.updateCrop(this.crop.withArea(Double.parseDouble(string)));
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
area_label.setText(string); area_label.setText(string);
}
}); });
} }
} }
/**
* Alert to delete Task.
* @param task {@link Task} which is being deleted
*/
private void showDeleteTask(Task task) { private void showDeleteTask(Task task) {
Alert alert = new Alert(Alert.AlertType.CONFIRMATION); Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setTitle("Delete " + task.getName()); alert.setTitle("Delete " + task.getName());

View File

@ -8,6 +8,9 @@ import javafx.scene.image.ImageView;
import java.net.URL; import java.net.URL;
import java.util.ResourceBundle; import java.util.ResourceBundle;
/**
* Controller class for the Home.fxml file
*/
public class HomeController implements Initializable { public class HomeController implements Initializable {
@FXML @FXML
@ -34,6 +37,11 @@ public class HomeController implements Initializable {
setImages(imageViewPhilippe, ""); setImages(imageViewPhilippe, "");
} }
/**
* set image to image view
* @param imageView the imageView to update
* @param photoName the file name of the photo
*/
private void setImages(ImageView imageView, String photoName) { private void setImages(ImageView imageView, String photoName) {
Image img; Image img;
if (photoName.equals("")) { if (photoName.equals("")) {

View File

@ -19,6 +19,9 @@ import java.io.IOException;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
/**
* Controller class for the MainFXML.fxml file
*/
public class MainFXMLController { public class MainFXMLController {
private static final Logger LOG = Logger.getLogger(MainFXMLController.class.getName()); private static final Logger LOG = Logger.getLogger(MainFXMLController.class.getName());
@ -176,6 +179,10 @@ public class MainFXMLController {
tutorial_button.visibleProperty().bind(Settings.getInstance().getShowTutorialProperty()); tutorial_button.visibleProperty().bind(Settings.getInstance().getShowTutorialProperty());
} }
/**
* close Tutorial Window
* @param windowEvent event
*/
private void closeWindowHandler(WindowEvent windowEvent) { private void closeWindowHandler(WindowEvent windowEvent) {
tutorialModal.close(); tutorialModal.close();
} }

View File

@ -27,6 +27,9 @@ import java.util.*;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
/**
* Controller class for the MyGarden.fxml file
*/
public class MyGardenController { public class MyGardenController {
private static final Logger LOG = Logger.getLogger(MyGardenController.class.getName()); private static final Logger LOG = Logger.getLogger(MyGardenController.class.getName());
@Inject @Inject

View File

@ -12,6 +12,8 @@ import ch.zhaw.gartenverwaltung.types.Task;
import javafx.beans.property.ListProperty; import javafx.beans.property.ListProperty;
import javafx.beans.property.SimpleListProperty; import javafx.beans.property.SimpleListProperty;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
@ -25,6 +27,9 @@ import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
/**
* Controller class for the MySchedule.fxml file
*/
public class MyScheduleController { public class MyScheduleController {
private static final Logger LOG = Logger.getLogger(MyScheduleController.class.getName()); private static final Logger LOG = Logger.getLogger(MyScheduleController.class.getName());
private final ListProperty<List<Task>> taskListProperty = new SimpleListProperty<>(FXCollections.observableArrayList()); private final ListProperty<List<Task>> taskListProperty = new SimpleListProperty<>(FXCollections.observableArrayList());
@ -63,6 +68,9 @@ public class MyScheduleController {
} }
} }
/**
* sort scheduler to selected crop
*/
private void lookForSelectedListEntries() { private void lookForSelectedListEntries() {
scheduledPlants_listview.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { scheduledPlants_listview.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
selectedCrop = newValue; selectedCrop = newValue;
@ -74,6 +82,9 @@ public class MyScheduleController {
}); });
} }
/**
* set cellFactory for the crops.
*/
private void setCellFactoryCropListView() { private void setCellFactoryCropListView() {
scheduledPlants_listview.setCellFactory(param -> new ListCell<>() { scheduledPlants_listview.setCellFactory(param -> new ListCell<>() {
@Override @Override
@ -96,6 +107,9 @@ public class MyScheduleController {
}); });
} }
/**
* set CallFactory for the given Tasks
*/
private void setCellFactoryTaskListView() { private void setCellFactoryTaskListView() {
week_listView.setCellFactory(param -> new ListCell<>() { week_listView.setCellFactory(param -> new ListCell<>() {
@Override @Override
@ -113,6 +127,10 @@ public class MyScheduleController {
}); });
} }
/**
* update task list
* @throws IOException exception
*/
private void loadTaskList() throws IOException { private void loadTaskList() throws IOException {
List<List<Task>> taskLists; List<List<Task>> taskLists;
if (selectedCrop != null) { if (selectedCrop != null) {
@ -124,6 +142,12 @@ public class MyScheduleController {
taskListProperty.addAll(taskLists); taskListProperty.addAll(taskLists);
} }
/**
* Create a {@link VBox} of the given TaskList.
* @param tasks List of {@link Task}s
* @param dayIndex index of the day
* @return {@link VBox} of the given Task of the day
*/
private VBox weekTaskVBox(List<Task> tasks, int dayIndex) { private VBox weekTaskVBox(List<Task> tasks, int dayIndex) {
VBox vBox = new VBox(10); VBox vBox = new VBox(10);
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
@ -144,14 +168,15 @@ public class MyScheduleController {
taskDescription.setMaxSize(600, Double.MAX_VALUE); taskDescription.setMaxSize(600, Double.MAX_VALUE);
Pane puffer = new Pane(); Pane puffer = new Pane();
HBox.setHgrow(puffer, Priority.ALWAYS); HBox.setHgrow(puffer, Priority.ALWAYS);
CheckBox checkBox = new CheckBox("Task completed?"); Button button = new Button("Task completed!");
checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> { button.setOnAction(new EventHandler<ActionEvent>() {
if (newValue) { @Override
showConfirmation(task, checkBox); public void handle(ActionEvent event) {
showConfirmation(task);
} }
}); });
HBox.setHgrow(checkBox, Priority.NEVER); HBox.setHgrow(button, Priority.NEVER);
hBoxDescription.getChildren().addAll(taskDescription, puffer, checkBox); hBoxDescription.getChildren().addAll(taskDescription, puffer, button);
vBox.getChildren().addAll(hBox, hBoxDescription); vBox.getChildren().addAll(hBox, hBoxDescription);
} }
return vBox; return vBox;
@ -161,7 +186,7 @@ public class MyScheduleController {
* Alert to confirm that task has been completed. * Alert to confirm that task has been completed.
* @param task {@link Task} which is selected * @param task {@link Task} which is selected
*/ */
private void showConfirmation(Task task, CheckBox checkBox) { private void showConfirmation(Task task) {
Alert alert = new Alert(Alert.AlertType.CONFIRMATION); Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setTitle("Task Completed?"); alert.setTitle("Task Completed?");
alert.setHeaderText("Are you sure you have completed this task?"); alert.setHeaderText("Are you sure you have completed this task?");
@ -176,8 +201,6 @@ public class MyScheduleController {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} else {
checkBox.setSelected(false);
} }
}); });
} }

View File

@ -28,6 +28,9 @@ import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
/**
* Controller class for the Plants.fxml file
*/
public class PlantsController { public class PlantsController {
private static final Logger LOG = Logger.getLogger(PlantsController.class.getName()); private static final Logger LOG = Logger.getLogger(PlantsController.class.getName());

View File

@ -8,6 +8,10 @@ import javafx.util.Callback;
import java.time.LocalDate; import java.time.LocalDate;
/**
* Controller class for the SelectSowDay.fxml file
* Gets opened with a dialog.
*/
public class SelectSowDayController { public class SelectSowDayController {
private Plant selectedPlant; private Plant selectedPlant;

View File

@ -19,6 +19,8 @@ public class Settings {
private String mailNotificationSubjectTemplate = "Task %s is due!"; // {0} = Task Name private String mailNotificationSubjectTemplate = "Task %s is due!"; // {0} = Task Name
private String mailNotificationTextTemplate = "Dear user\nYour gardentask %s for plant %s is due at %tF. Don't forget to confirm in your application if the task is done.\nTask description:\n%s"; // {0} = Task Name, {1} = plantname, {2} = nextExecution, {3} = Task description private String mailNotificationTextTemplate = "Dear user\nYour gardentask %s for plant %s is due at %tF. Don't forget to confirm in your application if the task is done.\nTask description:\n%s"; // {0} = Task Name, {1} = plantname, {2} = nextExecution, {3} = Task description
private String location = "";
static { static {
instance = new Settings(); instance = new Settings();
} }
@ -49,6 +51,14 @@ public class Settings {
return this.showTutorial.get(); return this.showTutorial.get();
} }
public void setLocation(String location) {
this.location = location;
}
public String getLocation() {
return this.location;
}
public SmtpCredentials getSmtpCredentials() { public SmtpCredentials getSmtpCredentials() {
return smtpCredentials; return smtpCredentials;
} }

View File

@ -1,23 +1,49 @@
package ch.zhaw.gartenverwaltung; package ch.zhaw.gartenverwaltung;
import ch.zhaw.gartenverwaltung.bootstrap.AppLoader;
import ch.zhaw.gartenverwaltung.bootstrap.Inject;
import ch.zhaw.gartenverwaltung.types.HardinessZone; import ch.zhaw.gartenverwaltung.types.HardinessZone;
import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.control.CheckBox; import javafx.scene.control.*;
import javafx.scene.control.ComboBox; import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.ResourceBundle; import java.util.ResourceBundle;
/**
* Controller class for the Settings.fxml file
*/
public class SettingsController implements Initializable { public class SettingsController implements Initializable {
Settings settings = Settings.getInstance(); Settings settings = Settings.getInstance();
@Inject
AppLoader appLoader;
@FXML @FXML
private ComboBox<HardinessZone> selectHardinessZone_comboBox; private ComboBox<HardinessZone> selectHardinessZone_comboBox;
@FXML @FXML
private CheckBox showTutorial_checkBox; private CheckBox showTutorial_checkBox;
@FXML
private Button location_button;
@FXML
private Label location_label;
/**
* open dialog to set location
* @param event event
* @throws IOException exception
*/
@FXML
void setLocation(ActionEvent event) throws IOException {
openTextFieldDialog();
}
/** /**
* save selected values to {@link Settings} * save selected values to {@link Settings}
*/ */
@ -36,5 +62,50 @@ public class SettingsController implements Initializable {
showTutorial_checkBox.setSelected(settings.getShowTutorial()); showTutorial_checkBox.setSelected(settings.getShowTutorial());
selectHardinessZone_comboBox.getItems().addAll(HardinessZone.values()); selectHardinessZone_comboBox.getItems().addAll(HardinessZone.values());
selectHardinessZone_comboBox.setValue(settings.getCurrentHardinessZone()); selectHardinessZone_comboBox.setValue(settings.getCurrentHardinessZone());
setIconToButton(location_button, "locationIcon.png");
location_label.setText(settings.getLocation());
}
/**
* adds icon to button
* @param button the button which get the icon
* @param iconFileName file name of icon
*/
private void setIconToButton(Button button, String iconFileName) {
Image img = new Image(String.valueOf(getClass().getResource("icons/" + iconFileName)));
ImageView imageView = new ImageView(img);
imageView.setFitHeight(20);
imageView.setPreserveRatio(true);
button.setGraphic(imageView);
}
/**
* opens Dialog to set exception
* @throws IOException exception
*/
private void openTextFieldDialog() throws IOException {
Dialog<String> dialog = new Dialog<>();
dialog.setTitle("Set Location of your Garden");
dialog.setHeaderText("set Location of your Garden!");
dialog.setResizable(false);
DialogPane dialogPane = dialog.getDialogPane();
ButtonType save = new ButtonType("Save", ButtonBar.ButtonData.OK_DONE);
dialogPane.getButtonTypes().addAll(save, ButtonType.CANCEL);
if (appLoader.loadPaneToDialog("TextFieldFormular.fxml", dialogPane) instanceof TextFieldFormularController controller) {
controller.setDescription_label("Set");
controller.setValueTextArea(settings.getLocation());
controller.initSaveButton((Button) dialogPane.lookupButton(save));
dialog.setResultConverter(button -> button.equals(save) ? controller.getValue() : null);
dialog.showAndWait()
.ifPresent(string -> {
settings.setLocation(string);
location_label.setText(settings.getLocation());
});
}
} }
} }

View File

@ -19,6 +19,9 @@ import java.net.URL;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.ResourceBundle; import java.util.ResourceBundle;
/**
* Controller class for the TaskFormular.fxml file
*/
public class TaskFormularController implements Initializable { public class TaskFormularController implements Initializable {
private Crop crop; private Crop crop;
private Plant plant; private Plant plant;
@ -49,6 +52,11 @@ public class TaskFormularController implements Initializable {
@AfterInject @AfterInject
@SuppressWarnings("unused") @SuppressWarnings("unused")
/**
* returns the edited or added {@link Task}
* @param crop {@link Crop} which was selected
* @return {@link Task} which was edited or added
*/
public Task returnResult(Crop crop) { public Task returnResult(Crop crop) {
int interval = 0; int interval = 0;
if (!(interval_field.getText().isEmpty() || interval_field.getText().equals(""))) { if (!(interval_field.getText().isEmpty() || interval_field.getText().equals(""))) {
@ -61,11 +69,21 @@ public class TaskFormularController implements Initializable {
return task; return task;
} }
/**
* set selected crop and get the plant from the crop.
* @param crop {@link Crop} which was selected
* @throws HardinessZoneNotSetException exception
* @throws IOException exception
*/
public void setCorp(Crop crop) throws HardinessZoneNotSetException, IOException { public void setCorp(Crop crop) throws HardinessZoneNotSetException, IOException {
this.crop = crop; this.crop = crop;
this.plant = plantList.getPlantById(Settings.getInstance().getCurrentHardinessZone(), crop.getPlantId()).get(); this.plant = plantList.getPlantById(Settings.getInstance().getCurrentHardinessZone(), crop.getPlantId()).get();
} }
/**
* set the values of task into the labels and datePicker.
* @param task {@link Task} which was given
*/
public void setTaskValue(Task task) { public void setTaskValue(Task task) {
this.task = task; this.task = task;
taskName_field.setText(task.getName()); taskName_field.setText(task.getName());
@ -79,6 +97,10 @@ public class TaskFormularController implements Initializable {
} }
} }
/**
* dayCellFactory of the start date
* @return {@link Callback} of the dayCellFactory
*/
private Callback<DatePicker, DateCell> getDayCellFactoryStartDate() { private Callback<DatePicker, DateCell> getDayCellFactoryStartDate() {
return (datePicker) -> new DateCell() { return (datePicker) -> new DateCell() {
@ -103,6 +125,10 @@ public class TaskFormularController implements Initializable {
}; };
} }
/**
* dayCellFactory of the end date
* @return {@link Callback} of the dayCellFactory
*/
private Callback<DatePicker, DateCell> getDayCellFactoryEndDate() { private Callback<DatePicker, DateCell> getDayCellFactoryEndDate() {
return (datePicker) -> new DateCell() { return (datePicker) -> new DateCell() {
@ -127,6 +153,10 @@ public class TaskFormularController implements Initializable {
}; };
} }
/**
* disable button until condition meet.
* @param button {@link Button} which was given
*/
public void initSaveButton(Button button) { public void initSaveButton(Button button) {
interval_field.textProperty().addListener((observable, oldValue, newValue) -> { interval_field.textProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.matches("\\d*")) { if (!newValue.matches("\\d*")) {
@ -139,6 +169,16 @@ public class TaskFormularController implements Initializable {
.or(description_area.textProperty().isEmpty())); .or(description_area.textProperty().isEmpty()));
} }
/**
* initialize dayCellFactories
* @param location
* The location used to resolve relative paths for the root object, or
* {@code null} if the location is not known.
*
* @param resources
* The resources used to localize the root object, or {@code null} if
* the root object was not localized.
*/
@Override @Override
public void initialize(URL location, ResourceBundle resources) { public void initialize(URL location, ResourceBundle resources) {
start_datePicker.setDayCellFactory(getDayCellFactoryStartDate()); start_datePicker.setDayCellFactory(getDayCellFactoryStartDate());

View File

@ -5,6 +5,9 @@ import javafx.scene.control.Button;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
/**
* Controller class for the TexFieldFormular.fxml file
*/
public class TextFieldFormularController { public class TextFieldFormularController {
@FXML @FXML
@ -14,18 +17,34 @@ public class TextFieldFormularController {
private TextField text_area; private TextField text_area;
/**
* set description label
* @param string string of the description
*/
public void setDescription_label(String string) { public void setDescription_label(String string) {
description_label.setText(string); description_label.setText(string);
} }
/**
* set text area value
* @param string string of text area value
*/
public void setValueTextArea(String string) { public void setValueTextArea(String string) {
text_area.setText(string); text_area.setText(string);
} }
/**
* return value of text area
* @return string of the tex area
*/
public String getValue() { public String getValue() {
return text_area.getText(); return text_area.getText();
} }
/**
* Disable Button until condition meet
* @param button {@link Button} which is gets dissabled
*/
public void initSaveButton(Button button) { public void initSaveButton(Button button) {
text_area.textProperty().addListener((observable, oldValue, newValue) -> { text_area.textProperty().addListener((observable, oldValue, newValue) -> {
if (newValue.matches("\\d*\\.?\\d*")) { if (newValue.matches("\\d*\\.?\\d*")) {

View File

@ -8,6 +8,9 @@ import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane; import javafx.scene.layout.StackPane;
import javafx.stage.Stage; import javafx.stage.Stage;
/**
* Controller class for the Tutorial.fxml file
*/
public class TutorialController { public class TutorialController {
@FXML @FXML
@ -44,16 +47,25 @@ public class TutorialController {
setButtonAbilities(); setButtonAbilities();
} }
/**
* disable next or close button according to the location of button
*/
private void setButtonAbilities() { private void setButtonAbilities() {
previousPageButton.setDisable(page <= 0); previousPageButton.setDisable(page <= 0);
nextPageButton.setDisable(page >= tourPages.getChildren().size() - 1); nextPageButton.setDisable(page >= tourPages.getChildren().size() - 1);
} }
/**
* switch to next view
*/
private void switchViews() { private void switchViews() {
tourPages.getChildren().forEach(node -> node.setOpacity(0)); tourPages.getChildren().forEach(node -> node.setOpacity(0));
tourPages.getChildren().get(page).setOpacity(1); tourPages.getChildren().get(page).setOpacity(1);
} }
/**
* close Tutorial
*/
public void closeTutorial() { public void closeTutorial() {
Stage root = (Stage) tourPages.getScene().getWindow(); Stage root = (Stage) tourPages.getScene().getWindow();
root.close(); root.close();

View File

@ -71,7 +71,7 @@ public class JsonTaskList implements TaskList {
if(taskMap.isEmpty()) { if(taskMap.isEmpty()) {
loadTaskListFromFile(); loadTaskListFromFile();
} }
return taskMap.values().stream().filter(task -> task.isInTimePeriode(start, end)).toList(); return taskMap.values().stream().filter(task -> task.isInTimePeriod(start, end)).toList();
} }
/** /**

View File

@ -1,12 +1,12 @@
package ch.zhaw.gartenverwaltung.types; package ch.zhaw.gartenverwaltung.types;
import ch.zhaw.gartenverwaltung.io.JsonPlantList;
import ch.zhaw.gartenverwaltung.io.PlantList;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
/**
* Represents a crop, meaning a specific plant growing at a specific time.
*/
public class Crop { public class Crop {
private Long cropId = null; private Long cropId = null;
private final long plantId; private final long plantId;

View File

@ -7,7 +7,19 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.time.MonthDay; import java.time.MonthDay;
import java.util.List; import java.util.List;
/**
* Represents a growth phase of a plant.
* Plants go through several phases during their life (sowing, germinating, growing, ..., harvest).
* These phases are characterized by what kinds of tasks need to be executed by the gardener to stay alive.
* This class represents one such phase.
*
* @param startDate The earliest date on which this phase can start
* @param endDate The latest date on which this phase can start
* @param group Which group this phase belongs to (if the growth phase can occur multiple times a year, default: 0)
* @param type What {@link GrowthPhaseType} this represents
* @param zone The hardiness zone for which this growth phase is valid
* @param taskTemplates The (undated) tasks required to be performed by the gardener
*/
public record GrowthPhase( public record GrowthPhase(
MonthDay startDate, MonthDay startDate,
MonthDay endDate, MonthDay endDate,

View File

@ -1,5 +1,9 @@
package ch.zhaw.gartenverwaltung.types; package ch.zhaw.gartenverwaltung.types;
/**
* Enumerates the different possible types of {@link GrowthPhase}.
* (Subject to later expansion)
*/
public enum GrowthPhaseType { public enum GrowthPhaseType {
SOW, PLANT, REPLANT, HARVEST SOW, PLANT, REPLANT, HARVEST
} }

View File

@ -1,4 +1,11 @@
package ch.zhaw.gartenverwaltung.types; package ch.zhaw.gartenverwaltung.types;
/**
* Represents a pest or pathogen which may afflict a plant.
*
* @param name The name of the pest
* @param description A description of the pest
* @param measures Measures that can be taken against the pest.
*/
public record Pest(String name, String description, String measures) { public record Pest(String name, String description, String measures) {
} }

View File

@ -9,6 +9,20 @@ import java.util.stream.Collectors;
import static java.time.temporal.ChronoUnit.DAYS; import static java.time.temporal.ChronoUnit.DAYS;
/**
* Represents a plant
*
* @param id A unique identifier
* @param name The name of the plant
* @param description A description of the plant
* @param image An image representing the plant
* @param spacing The amount of space needed between individual plants of this type
* @param light The amount of light preferred by the plant (h/d)
* @param soil The type of soil required for the plant
* @param pests {@link Pest}s that may afflict the plant
* @param wateringCycle The {@link WateringCycle} required by the plant
* @param lifecycle A list of {@link GrowthPhase}s constituting the plants lifecycle
*/
public record Plant( public record Plant(
long id, long id,
String name, String name,
@ -30,9 +44,10 @@ public record Plant(
} }
/** /**
* get all growthPhases of lifecycle group * Get all {@link GrowthPhase}s of a lifecycle group
* @param group lifecycle group *
* @return list of growthPhases * @param group The lifecycle group
* @return A list of {@link GrowthPhase}s
*/ */
public List<GrowthPhase> lifecycleForGroup(int group) { public List<GrowthPhase> lifecycleForGroup(int group) {
return lifecycle.stream() return lifecycle.stream()
@ -40,6 +55,12 @@ public record Plant(
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
/**
* Given a {@link LocalDate}, determines which lifecycle group contains it.
*
* @param date The date to look for
* @return Which lifecycle group the date is in
*/
public int getGrowphaseGroupForDate(LocalDate date) { public int getGrowphaseGroupForDate(LocalDate date) {
for(GrowthPhase growthPhase : lifecycle){ for(GrowthPhase growthPhase : lifecycle){
MonthDay plantingDate = MonthDay.of(date.getMonth().getValue(), date.getDayOfMonth()); MonthDay plantingDate = MonthDay.of(date.getMonth().getValue(), date.getDayOfMonth());
@ -51,16 +72,18 @@ public record Plant(
} }
/** /**
* get sow date from given harvest day from lifecycle group * Get sow date from given harvest date from lifecycle group
*
* @param harvestDate date of the harvest * @param harvestDate date of the harvest
* @return LocaleDate of sow date * @return {@link LocalDate} of sow date
*/ */
public LocalDate sowDateFromHarvestDate(LocalDate harvestDate) { public LocalDate sowDateFromHarvestDate(LocalDate harvestDate) {
return harvestDate.minusDays(timeToHarvest(lifecycleGroupFromHarvestDate(harvestDate))); return harvestDate.minusDays(timeToHarvest(lifecycleGroupFromHarvestDate(harvestDate)));
} }
/** /**
* calculate the days between sow and harvest day for lifecycle group * Calculate the number of days between sow and harvest date for lifecycle group
*
* @param group the lifecycle group * @param group the lifecycle group
* @return Integer number of dates between sow and harvest day * @return Integer number of dates between sow and harvest day
*/ */
@ -79,6 +102,12 @@ public record Plant(
return (int) DAYS.between(sow.startDate().atYear(currentYear),harvest.startDate().atYear(currentYear)); return (int) DAYS.between(sow.startDate().atYear(currentYear),harvest.startDate().atYear(currentYear));
} }
/**
* Given a harvest date, determines which lifecycle group it belongs to.
*
* @param harvestDate The harvest date
* @return Which lifecycle group the harvest date is in
*/
public int lifecycleGroupFromHarvestDate(LocalDate harvestDate) { public int lifecycleGroupFromHarvestDate(LocalDate harvestDate) {
return lifecycle.stream() return lifecycle.stream()
.filter(growthPhase -> growthPhase.type().equals(GrowthPhaseType.HARVEST) && .filter(growthPhase -> growthPhase.type().equals(GrowthPhaseType.HARVEST) &&

View File

@ -2,6 +2,10 @@ package ch.zhaw.gartenverwaltung.types;
import java.time.MonthDay; import java.time.MonthDay;
/**
* Describes the 4 Seasons in terms of {@link java.time.LocalDate}s
* Also describes "All Seasons" as the full year.
*/
public enum Seasons { public enum Seasons {
ALLSEASONS("--01-01", "--12-31", "All Seasons"), ALLSEASONS("--01-01", "--12-31", "All Seasons"),
SPRING("--03-01", "--05-30", "Spring"), SPRING("--03-01", "--05-30", "Spring"),

View File

@ -1,11 +1,10 @@
package ch.zhaw.gartenverwaltung.types; package ch.zhaw.gartenverwaltung.types;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Optional; import java.util.Optional;
/** /**
* Models a Task * Represents a Task
* May be created using the builder pattern. * May be created using the builder pattern.
*/ */
public class Task { public class Task {
@ -18,10 +17,9 @@ public class Task {
private LocalDate nextExecution; private LocalDate nextExecution;
private LocalDate nextNotification; private LocalDate nextNotification;
private long cropId; private long cropId;
private boolean done;
/** /**
* default constructor * Default constructor
* (used by Json deserializer) * (used by Json deserializer)
*/ */
public Task(){ public Task(){
@ -32,6 +30,14 @@ public class Task {
nextExecution = startDate; nextExecution = startDate;
} }
/**
* Constructor for a non-repeating task related to a {@link Crop}
*
* @param name The name of the task
* @param description A description of the task
* @param startDate The start date of the task
* @param cropId The id of the crop to which the task belongs
*/
public Task(String name, String description, LocalDate startDate, long cropId) { public Task(String name, String description, LocalDate startDate, long cropId) {
this.name = name; this.name = name;
this.description = description; this.description = description;
@ -43,6 +49,11 @@ public class Task {
/** /**
* Constructor for weather events * Constructor for weather events
*
* @param name The name of the task
* @param description A description of the task
* @param startDate The start date of the task
* @param endDate The maximum date on which the task should be executed
*/ */
public Task(String name, String description, LocalDate startDate, LocalDate endDate, long cropId) { public Task(String name, String description, LocalDate startDate, LocalDate endDate, long cropId) {
this.name = name; this.name = name;
@ -52,6 +63,16 @@ public class Task {
this.endDate = endDate; this.endDate = endDate;
} }
/**
* Full constructor (without id)
*
* @param name The name of the task
* @param description A description of the task
* @param startDate The start date of the task
* @param endDate The maximum date on which the task should be executed
* @param interval The number of days between executions
* @param cropId The id of the crop to which the task belongs
*/
public Task(String name, String description, LocalDate startDate, LocalDate endDate, int interval, long cropId) { public Task(String name, String description, LocalDate startDate, LocalDate endDate, int interval, long cropId) {
this.name = name; this.name = name;
this.description = description; this.description = description;
@ -76,10 +97,20 @@ public class Task {
return this; return this;
} }
public boolean isInTimePeriode(LocalDate searchStartDate, LocalDate searchEndDate){ /**
* Checks if the Task is within a specific date range.
*
* @param searchStartDate The minimum date
* @param searchEndDate The maximum date
* @return Whether the Task is within the given range
*/
public boolean isInTimePeriod(LocalDate searchStartDate, LocalDate searchEndDate) {
return endDate.isAfter(searchStartDate) && startDate.isBefore(searchEndDate); return endDate.isAfter(searchStartDate) && startDate.isBefore(searchEndDate);
} }
/**
* Marks a specific execution of a Task as done.
*/
public void done(){ public void done(){
if(interval != null && interval != 0 && !nextExecution.plusDays(interval).isAfter(endDate)){ if(interval != null && interval != 0 && !nextExecution.plusDays(interval).isAfter(endDate)){
nextExecution = nextExecution.plusDays(interval); nextExecution = nextExecution.plusDays(interval);
@ -118,6 +149,12 @@ public class Task {
return Optional.ofNullable(endDate); return Optional.ofNullable(endDate);
} }
/**
* Updates the fields of this Task using the values of the given Task
*
* @param task The task whose fields to copy
* @return This task with the fields already updated
*/
public Task updateTask(Task task) { public Task updateTask(Task task) {
this.name = task.getName(); this.name = task.getName();
this.description = task.getDescription(); this.description = task.getDescription();

View File

@ -41,6 +41,13 @@ public class TaskTemplate {
this.relativeStartDate = relativeStartDate; this.relativeStartDate = relativeStartDate;
} }
/**
* Create a concrete {@link Task} given a concrete start date
*
* @param realStartDate The start date of the {@link GrowthPhase} to which the {@link #relativeStartDate} is relative.
* @param cropId The crop for which the task should be generated.
* @return The created {@link Task}
*/
public Task generateTask(LocalDate realStartDate, long cropId) { public Task generateTask(LocalDate realStartDate, long cropId) {
LocalDate endDate = relativeEndDate != null ? realStartDate.plusDays(relativeEndDate) : realStartDate; LocalDate endDate = relativeEndDate != null ? realStartDate.plusDays(relativeEndDate) : realStartDate;

View File

@ -1,5 +1,12 @@
package ch.zhaw.gartenverwaltung.types; package ch.zhaw.gartenverwaltung.types;
/**
* Describes the cycle in which a {@link Plant} should be watered
*
* @param litersPerSqM How many litres of water per square metre of ground
* @param interval The interval (days)
* @param notes Notes on the cycle
*/
public record WateringCycle( public record WateringCycle(
int litersPerSqM, int litersPerSqM,
int interval, int interval,

View File

@ -15,12 +15,9 @@
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="785.0" prefWidth="899.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.CropDetailController"> <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="785.0" prefWidth="899.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.CropDetailController">
<children> <children>
<ScrollPane fitToWidth="true" prefHeight="759.0" prefWidth="664.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <ScrollPane fitToHeight="true" fitToWidth="true" prefHeight="759.0" prefWidth="664.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<content> <content>
<VBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="781.0" prefWidth="897.0"> <VBox fx:id="cropDetailVBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="781.0" prefWidth="897.0" spacing="5.0">
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
<children> <children>
<Button mnemonicParsing="false" onAction="#goBack" prefHeight="25.0" prefWidth="91.0" text="Go Back"> <Button mnemonicParsing="false" onAction="#goBack" prefHeight="25.0" prefWidth="91.0" text="Go Back">
<VBox.margin> <VBox.margin>
@ -32,18 +29,18 @@
<Insets bottom="10.0" /> <Insets bottom="10.0" />
</VBox.margin> </VBox.margin>
</Label> </Label>
<HBox prefHeight="265.0" prefWidth="879.0"> <HBox maxHeight="1.7976931348623157E308" prefHeight="268.0" prefWidth="855.0" spacing="10.0" VBox.vgrow="NEVER">
<children> <children>
<GridPane maxWidth="1.7976931348623157E308" prefHeight="296.0" prefWidth="577.0" HBox.hgrow="ALWAYS"> <GridPane maxWidth="1.7976931348623157E308" prefHeight="231.0" prefWidth="555.0" HBox.hgrow="ALWAYS">
<columnConstraints> <columnConstraints>
<ColumnConstraints halignment="LEFT" hgrow="SOMETIMES" maxWidth="284.0" minWidth="10.0" prefWidth="97.33334350585938" /> <ColumnConstraints halignment="LEFT" hgrow="SOMETIMES" maxWidth="284.0" minWidth="10.0" prefWidth="97.33334350585938" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="488.99999237060547" minWidth="10.0" prefWidth="481.9999898274739" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="488.99999237060547" minWidth="10.0" prefWidth="481.9999898274739" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints maxHeight="149.66665903727215" minHeight="10.0" prefHeight="149.66665903727215" valignment="TOP" vgrow="SOMETIMES" /> <RowConstraints maxHeight="149.66665903727215" minHeight="10.0" prefHeight="126.33328501383463" valignment="TOP" vgrow="SOMETIMES" />
<RowConstraints maxHeight="187.9999647140503" minHeight="10.0" prefHeight="51.00000762939453" vgrow="SOMETIMES" /> <RowConstraints maxHeight="187.9999647140503" minHeight="10.0" prefHeight="45.00002034505208" vgrow="SOMETIMES" />
<RowConstraints maxHeight="105.66662597656247" minHeight="10.0" prefHeight="54.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="105.66662597656247" minHeight="10.0" prefHeight="46.33331298828125" vgrow="SOMETIMES" />
<RowConstraints maxHeight="105.66662597656247" minHeight="10.0" prefHeight="46.66666666666666" vgrow="SOMETIMES" /> <RowConstraints maxHeight="105.66662597656247" minHeight="10.0" prefHeight="45.66668701171875" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<children> <children>
<Label prefHeight="17.0" prefWidth="65.0" text="Description:"> <Label prefHeight="17.0" prefWidth="65.0" text="Description:">
@ -76,31 +73,31 @@
</Label> </Label>
</children> </children>
</GridPane> </GridPane>
<ImageView fx:id="imageView" fitHeight="300.0" fitWidth="300.0" pickOnBounds="true" preserveRatio="true" HBox.hgrow="NEVER" /> <ImageView fx:id="imageView" fitHeight="250.0" fitWidth="250.0" pickOnBounds="true" preserveRatio="true" HBox.hgrow="NEVER" />
</children> </children>
</HBox> </HBox>
<Label text="Tasks:"> <Label text="Tasks:">
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Label> </Label>
<ListView fx:id="taskList_listView" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="200.0" prefWidth="877.0" VBox.vgrow="ALWAYS"> <ListView fx:id="taskList_listView" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" prefHeight="100.0" prefWidth="869.0" VBox.vgrow="ALWAYS">
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets bottom="10.0" />
</VBox.margin> </VBox.margin>
</ListView> </ListView>
<Button fx:id="addTask_button" mnemonicParsing="false" onAction="#addTask" prefHeight="25.0" prefWidth="45.0"> <Button fx:id="addTask_button" mnemonicParsing="false" onAction="#addTask" prefHeight="25.0" prefWidth="45.0" VBox.vgrow="NEVER">
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Button> </Button>
<Label text="Pests:" /> <Label text="Pests:" VBox.vgrow="NEVER" />
<ListView fx:id="pests_listView" maxHeight="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS"> <ListView fx:id="pests_listView" maxHeight="1.7976931348623157E308" minHeight="-Infinity" prefHeight="100.0" prefWidth="855.0" VBox.vgrow="SOMETIMES">
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</ListView> </ListView>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" VBox.vgrow="NEVER"> <HBox alignment="CENTER_LEFT" prefHeight="27.0" prefWidth="869.0" VBox.vgrow="NEVER">
<children> <children>
<Label text="Area:"> <Label text="Area:">
<HBox.margin> <HBox.margin>
@ -115,27 +112,15 @@
<Button fx:id="area_button" mnemonicParsing="false" onAction="#setArea" prefHeight="25.0" prefWidth="116.0" text="Set Area" /> <Button fx:id="area_button" mnemonicParsing="false" onAction="#setArea" prefHeight="25.0" prefWidth="116.0" text="Set Area" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</HBox> </HBox>
<HBox alignment="CENTER_LEFT" layoutX="20.0" layoutY="719.0" prefHeight="100.0" prefWidth="200.0" VBox.vgrow="NEVER">
<children>
<Label text="Location:">
<HBox.margin>
<Insets right="40.0" />
</HBox.margin>
</Label>
<Label fx:id="location_label" minHeight="-Infinity" prefWidth="50.0" text="Label">
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</Label>
<Button fx:id="location_button" mnemonicParsing="false" onAction="#setLocation" prefHeight="25.0" prefWidth="115.0" text="Set Location" />
</children>
</HBox>
</children> </children>
</VBox> </VBox>
</content> </content>
<padding>
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
</padding>
</ScrollPane> </ScrollPane>
</children> </children>
</AnchorPane> </AnchorPane>

View File

@ -6,26 +6,24 @@
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1091.0" prefWidth="1060.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.HomeController"> <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1091.0" prefWidth="1060.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.HomeController">
<children> <children>
<ScrollPane fitToWidth="true" prefHeight="1157.0" prefWidth="1060.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <ScrollPane fitToWidth="true" prefHeight="1157.0" prefWidth="1060.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<padding>
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
</padding>
<content> <content>
<VBox prefHeight="1091.0" prefWidth="1058.0"> <VBox fx:id="homeVBox" prefHeight="1047.0" prefWidth="1019.0" spacing="10.0">
<children>
<Pane prefHeight="1085.0" prefWidth="1018.0">
<children>
<VBox prefHeight="1047.0" prefWidth="1019.0">
<children> <children>
<Label text="Garden Management"> <Label text="Garden Management">
<font> <font>
<Font size="34.0" /> <Font size="34.0" />
</font> </font>
<VBox.margin> <VBox.margin>
<Insets bottom="30.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Label> </Label>
<Label alignment="TOP_LEFT" prefHeight="22.0" prefWidth="1039.0" text="This Application was created to help the user manage his or her garden. For this the Application has many functionalities:" wrapText="true"> <Label alignment="TOP_LEFT" prefHeight="22.0" prefWidth="1039.0" text="This Application was created to help the user manage his or her garden. For this the Application has many functionalities:" wrapText="true">
@ -33,9 +31,11 @@
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Label> </Label>
<VBox prefHeight="200.0" prefWidth="100.0" spacing="5.0" style="-fx-background-color: white; -fx-border-color: black;">
<children>
<Label text="Base Functionalities:"> <Label text="Base Functionalities:">
<font> <font>
<Font name="System Bold" size="14.0" /> <Font name="System Bold" size="14.0" />
@ -46,86 +46,107 @@
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="62.0" text="- The user can filter the plants according to seasons, hardiness zone and search query"> <Label text="- The user can filter the plants according to seasons, hardiness zone and search query">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="62.0" text="- The user can select the harverst or sow date. "> <Label text="- The user can select the harverst or sow date. ">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="102.0" text="- The user can get a detailed information of the plant he wants to harvest."> <Label text="- The user can get a detailed information of the plant he wants to harvest.">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="122.0" text="- The user can get view the task list of the given plant."> <Label text="- The user can get view the task list of the given plant.">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="142.0" text="- The user can get the tasks of the next seven days in the scheduler."> <Label text="- The user can get the tasks of the next seven days in the scheduler.">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Label> </Label>
<Label layoutX="10.0" layoutY="42.0" text="Advanced Functionalities:"> </children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
</VBox>
<VBox prefHeight="200.0" prefWidth="100.0" spacing="5.0" style="-fx-background-color: white; -fx-border-color: black;">
<children>
<Label text="Advanced Functionalities:">
<font> <font>
<Font name="System Bold" size="14.0" /> <Font name="System Bold" size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="62.0" text="- The user can edit the task list and add custom tasks."> <Label text="- The user can edit the task list and add custom tasks.">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="212.0" text="- The user can set the area (sqare meter) for the plants."> <Label text="- The user can set the area (sqare meter) for the plants.">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="232.0" text="- The user can set the location (PLZ) for the plants."> <Label text="- The user can set the location (PLZ) for the plants.">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="162.0" text="- The user can set the pesticide which will be used, which will create additonal tasks."> <Label text="- The user can set the pesticide which will be used, which will create additonal tasks.">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Label> </Label>
<Label layoutX="10.0" layoutY="192.0" text="Weather Forcast:"> </children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
</VBox>
<VBox prefHeight="200.0" prefWidth="100.0" spacing="5.0" style="-fx-background-color: white; -fx-border-color: black;">
<children>
<Label text="Weather Forcast:">
<font> <font>
<Font name="System Bold" size="14.0" /> <Font name="System Bold" size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="212.0" text="- According to the location the weather forcast will crate or delete tasks."> <Label text="- According to the location the weather forcast will crate or delete tasks.">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<Label layoutX="10.0" layoutY="272.0" text="- The user receives notifications that aditional tasks werde created or some tasks were deleted."> <Label text="- The user receives notifications that aditional tasks werde created or some tasks were deleted.">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Label> </Label>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
</VBox>
<VBox prefHeight="200.0" prefWidth="100.0" spacing="15.0" style="-fx-background-color: white; -fx-border-color: black;">
<children>
<Label text="Created by:"> <Label text="Created by:">
<font> <font>
<Font name="System Bold" size="14.0" /> <Font name="System Bold" size="14.0" />
</font> </font>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Label> </Label>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0"> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0">
@ -135,11 +156,16 @@
<Insets right="30.0" /> <Insets right="30.0" />
</HBox.margin> </HBox.margin>
</ImageView> </ImageView>
<Label text="Elias Csomor" /> <Label minWidth="150.0" text="Elias Csomor" />
<Label minWidth="200.0" text="csomoeli@students.zhaw.ch" />
<Label text="Assistent Project Lead/Developer" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets bottom="15.0" /> <Insets />
</VBox.margin> </VBox.margin>
<padding>
<Insets left="50.0" />
</padding>
</HBox> </HBox>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0"> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0">
<children> <children>
@ -148,11 +174,16 @@
<Insets right="30.0" /> <Insets right="30.0" />
</HBox.margin> </HBox.margin>
</ImageView> </ImageView>
<Label text="Philippe Giavarini" /> <Label minWidth="150.0" text="Philippe Giavarini" />
<Label minWidth="200.0" text="giavaphi@students.zhaw.ch" />
<Label text="Project Lead/Developer" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets bottom="15.0" /> <Insets />
</VBox.margin> </VBox.margin>
<padding>
<Insets left="50.0" />
</padding>
</HBox> </HBox>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0"> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0">
<children> <children>
@ -161,11 +192,16 @@
<Insets right="30.0" /> <Insets right="30.0" />
</HBox.margin> </HBox.margin>
</ImageView> </ImageView>
<Label text="David Guler" /> <Label minWidth="150.0" text="David Guler" />
<Label minWidth="200.0" text="gulerdav@students.zhaw.ch" />
<Label text="Developer" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets bottom="15.0" /> <Insets />
</VBox.margin> </VBox.margin>
<padding>
<Insets left="50.0" />
</padding>
</HBox> </HBox>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0"> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0">
<children> <children>
@ -174,11 +210,16 @@
<Insets right="30.0" /> <Insets right="30.0" />
</HBox.margin> </HBox.margin>
</ImageView> </ImageView>
<Label text="Gian-Andrea Hutter" /> <Label minWidth="150.0" text="Gian-Andrea Hutter" />
<Label minWidth="200.0" text="huttergia@students.zhaw.ch" />
<Label text="Developer" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets bottom="15.0" /> <Insets />
</VBox.margin> </VBox.margin>
<padding>
<Insets left="50.0" />
</padding>
</HBox> </HBox>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0"> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0">
<children> <children>
@ -187,24 +228,24 @@
<Insets right="30.0" /> <Insets right="30.0" />
</HBox.margin> </HBox.margin>
</ImageView> </ImageView>
<Label text="Roman Schenk" /> <Label minWidth="150.0" text="Roman Schenk" />
<Label minWidth="200.0" text="schrom01@students.zhaw.ch" />
<Label text="Developer" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets bottom="15.0" /> <Insets />
</VBox.margin> </VBox.margin>
<padding>
<Insets left="50.0" />
</padding>
</HBox> </HBox>
</children> </children>
</VBox>
</children>
<VBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</VBox.margin>
</Pane>
</children>
<padding> <padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding> </padding>
</VBox> </VBox>
</children>
</VBox>
</content> </content>
</ScrollPane> </ScrollPane>
</children> </children>

View File

@ -10,26 +10,26 @@
<AnchorPane fx:id="myGardenRoot" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="655.0" prefWidth="1175.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.MyGardenController"> <AnchorPane fx:id="myGardenRoot" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="655.0" prefWidth="1175.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.MyGardenController">
<children> <children>
<VBox layoutY="49.0" prefHeight="655.0" prefWidth="1175.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <VBox layoutY="49.0" prefHeight="655.0" prefWidth="1175.0" spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children> <children>
<Label text="My Garden"> <Label text="My Garden">
<font> <font>
<Font name="System Bold" size="28.0" /> <Font name="System Bold" size="28.0" />
</font> </font>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Label> </Label>
<ListView fx:id="myGarden_listView" maxHeight="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" /> <ListView fx:id="myGarden_listView" maxHeight="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" />
<Button fx:id="addPlant_button" mnemonicParsing="false" onAction="#addPlant" prefHeight="45.0" prefWidth="155.0" text="Add new Plant"> <Button fx:id="addPlant_button" mnemonicParsing="false" onAction="#addPlant" prefHeight="45.0" prefWidth="155.0" text="Add new Plant">
<VBox.margin> <VBox.margin>
<Insets top="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Button> </Button>
</children> </children>
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
</VBox> </VBox>
</children> </children>
<padding>
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
</padding>
</AnchorPane> </AnchorPane>

View File

@ -5,46 +5,56 @@
<?import javafx.scene.control.ListView?> <?import javafx.scene.control.ListView?>
<?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="572.0" prefWidth="867.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.MyScheduleController"> <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="572.0" prefWidth="867.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.MyScheduleController">
<children> <children>
<Label layoutX="14.0" layoutY="14.0" text="MySchedule"> <VBox prefHeight="200.0" prefWidth="100.0" spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<Label text="MySchedule" VBox.vgrow="NEVER">
<font> <font>
<Font size="24.0" /> <Font size="24.0" />
</font> </font>
</Label> </Label>
<HBox layoutY="31.0" prefHeight="541.0" prefWidth="867.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="50.0"> <HBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="541.0" prefWidth="867.0" spacing="10.0" VBox.vgrow="ALWAYS">
<children> <children>
<ListView fx:id="scheduledPlants_listview" maxWidth="1.7976931348623157E308" prefHeight="522.0" prefWidth="271.0" HBox.hgrow="NEVER"> <ListView fx:id="scheduledPlants_listview" maxWidth="1.7976931348623157E308" prefHeight="522.0" prefWidth="271.0" HBox.hgrow="NEVER">
<HBox.margin> <HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets />
</HBox.margin></ListView> </HBox.margin>
<VBox maxWidth="1.7976931348623157E308" prefHeight="537.0" prefWidth="650.0" HBox.hgrow="ALWAYS"> </ListView>
<VBox maxWidth="1.7976931348623157E308" prefHeight="537.0" prefWidth="650.0" spacing="10.0" HBox.hgrow="ALWAYS">
<children> <children>
<ListView fx:id="week_listView" maxWidth="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS"> <ListView fx:id="week_listView" maxWidth="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</ListView> </ListView>
<Pane prefHeight="131.0" prefWidth="593.0" VBox.vgrow="NEVER"> <VBox prefHeight="131.0" prefWidth="603.0" spacing="5.0" style="-fx-background-color: white; -fx-border-color: black;" VBox.vgrow="NEVER">
<children> <children>
<Label alignment="TOP_LEFT" layoutX="14.0" layoutY="14.0" prefHeight="17.0" prefWidth="550.0" text="Importants Information:" wrapText="true"> <Label alignment="TOP_LEFT" maxWidth="1.7976931348623157E308" prefHeight="17.0" prefWidth="558.0" text="Importants Information:" wrapText="true" VBox.vgrow="NEVER">
<font> <font>
<Font name="System Bold" size="12.0" /> <Font name="System Bold" size="12.0" />
</font> </font>
</Label> </Label>
<Label fx:id="information_label" alignment="TOP_LEFT" layoutX="14.0" layoutY="31.0" maxWidth="1.7976931348623157E308" prefHeight="82.0" prefWidth="550.0" text="Label" wrapText="true" /> <Label fx:id="information_label" alignment="TOP_LEFT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="73.0" prefWidth="550.0" text="Label" wrapText="true" VBox.vgrow="ALWAYS" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</Pane> <padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
</VBox>
</children> </children>
</VBox> </VBox>
</children> </children>
</HBox> </HBox>
</children> </children>
</VBox>
</children>
<padding>
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
</padding>
</AnchorPane> </AnchorPane>

View File

@ -4,59 +4,72 @@
<?import javafx.scene.control.Button?> <?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?> <?import javafx.scene.control.ListView?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.control.TextField?> <?import javafx.scene.control.TextField?>
<?import javafx.scene.control.TitledPane?> <?import javafx.scene.control.TitledPane?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="1000.0" prefHeight="853.0" <AnchorPane fx:id="plantsRoot" maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="1000.0" prefHeight="853.0" prefWidth="1219.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.PlantsController">
prefWidth="1219.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ch.zhaw.gartenverwaltung.PlantsController"
fx:id="plantsRoot">
<children> <children>
<SplitPane dividerPositions="0.7377363661277062" layoutX="539.0" layoutY="266.0" prefHeight="853.0" prefWidth="1219.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <VBox prefHeight="200.0" prefWidth="100.0" spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<items>
<AnchorPane maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children> <children>
<VBox maxWidth="1.7976931348623157E308" prefHeight="850.6666666666666" prefWidth="894.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <Label prefHeight="45.0" prefWidth="903.0" text="Plants" VBox.vgrow="NEVER">
<children>
<Label prefHeight="45.0" prefWidth="903.0" text="Plants">
<font> <font>
<Font name="System Bold" size="30.0" /> <Font name="System Bold" size="30.0" />
</font> </font>
</Label> </Label>
<TextField fx:id="search_plants" promptText="Search for Plant Name" /> <HBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="100.0" prefWidth="200.0" spacing="10.0" VBox.vgrow="ALWAYS">
<HBox alignment="CENTER_LEFT" prefHeight="480.0" prefWidth="881.0" VBox.vgrow="ALWAYS"> <children>
<AnchorPane maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0" HBox.hgrow="ALWAYS">
<children>
<VBox maxWidth="1.7976931348623157E308" prefHeight="850.6666666666666" prefWidth="894.0" spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<TextField fx:id="search_plants" promptText="Search for Plant Name" VBox.vgrow="NEVER" />
<HBox alignment="CENTER_LEFT" minHeight="300.0" prefHeight="480.0" prefWidth="881.0" spacing="10.0" VBox.vgrow="ALWAYS">
<children> <children>
<ListView fx:id="list_plants" maxWidth="1.7976931348623157E308" prefHeight="497.0" prefWidth="400.0" HBox.hgrow="ALWAYS" /> <ListView fx:id="list_plants" maxWidth="1.7976931348623157E308" prefHeight="497.0" prefWidth="400.0" HBox.hgrow="ALWAYS" />
<ImageView fx:id="img_plant" fitWidth="300" pickOnBounds="true" preserveRatio="true" HBox.hgrow="NEVER" /> <Pane maxHeight="1.7976931348623157E308" maxWidth="300.0" minWidth="300.0" prefHeight="200.0" prefWidth="200.0" style="-fx-background-color: white; -fx-border-color: black;" HBox.hgrow="NEVER">
<children>
<ImageView fx:id="img_plant" fitWidth="300" pickOnBounds="true" preserveRatio="true" />
</children>
</Pane>
</children> </children>
</HBox> </HBox>
<Label prefHeight="33.0" prefWidth="919.0" text="Plant Information:"> <VBox maxHeight="1.7976931348623157E308" prefHeight="237.0" prefWidth="879.0" style="-fx-background-color: white; -fx-border-color: black;" VBox.vgrow="ALWAYS">
<children>
<Label maxHeight="1.7976931348623157E308" prefHeight="33.0" prefWidth="919.0" text="Plant Information:" VBox.vgrow="NEVER">
<font> <font>
<Font name="System Bold" size="12.0" /> <Font name="System Bold" size="12.0" />
</font> </font>
<padding>
<Insets top="15.0" />
</padding>
</Label> </Label>
<Label fx:id="description_plant" alignment="TOP_LEFT" maxWidth="1.7976931348623157E308" prefHeight="194.0" prefWidth="893.0" text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." textAlignment="JUSTIFY" wrapText="true"> <Label fx:id="description_plant" alignment="TOP_LEFT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="96.0" prefWidth="879.0" text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." textAlignment="JUSTIFY" wrapText="true" VBox.vgrow="ALWAYS">
<padding> <padding>
<Insets bottom="10.0" top="10.0" /> <Insets bottom="10.0" top="10.0" />
</padding> </padding>
</Label> </Label>
<Button fx:id="selectSowDay_button" alignment="CENTER" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#selectSowDate" prefHeight="38.0" prefWidth="917.0" text="Select Harvest/Sow Day" /> <Button fx:id="selectSowDay_button" alignment="CENTER" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#selectSowDate" prefHeight="38.0" prefWidth="917.0" text="Select Harvest/Sow Day" VBox.vgrow="NEVER" />
</children>
<VBox.margin>
<Insets />
</VBox.margin>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
</VBox>
</children> </children>
</VBox> </VBox>
</children> </children>
<HBox.margin>
<Insets />
</HBox.margin>
</AnchorPane> </AnchorPane>
<AnchorPane maxWidth="300.0" minHeight="0.0" minWidth="300.0" prefHeight="160.0" prefWidth="100.0"> <AnchorPane maxWidth="300.0" minHeight="0.0" minWidth="300.0" prefHeight="160.0" prefWidth="100.0" style="-fx-border-color: black; -fx-background-color: white;">
<children> <children>
<VBox layoutX="38.0" layoutY="100.0" prefHeight="850.6666666666666" prefWidth="316.6666666666667" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <VBox layoutX="38.0" layoutY="100.0" prefHeight="850.6666666666666" prefWidth="316.6666666666667" spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children> <children>
<Label text="Filter"> <Label text="Filter">
<font> <font>
@ -84,11 +97,16 @@
</children> </children>
</VBox> </VBox>
</children> </children>
</AnchorPane>
</items>
<padding> <padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding> </padding>
</SplitPane> </AnchorPane>
</children> </children>
</HBox>
</children>
</VBox>
</children>
<padding>
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
</padding>
</AnchorPane> </AnchorPane>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?> <?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.ComboBox?> <?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.Label?>
@ -8,10 +9,9 @@
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="117.0" prefWidth="374.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.SettingsController">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="80.0" prefWidth="374.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.zhaw.gartenverwaltung.SettingsController">
<children> <children>
<VBox layoutX="14.0" layoutY="14.0" prefHeight="73.0" prefWidth="374.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <VBox layoutX="14.0" layoutY="14.0" prefHeight="73.0" prefWidth="374.0" spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children> <children>
<HBox prefHeight="23.0" prefWidth="334.0"> <HBox prefHeight="23.0" prefWidth="334.0">
<children> <children>
@ -19,7 +19,7 @@
<CheckBox fx:id="showTutorial_checkBox" mnemonicParsing="false" /> <CheckBox fx:id="showTutorial_checkBox" mnemonicParsing="false" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets left="10.0" right="10.0" top="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</HBox> </HBox>
<HBox alignment="CENTER_LEFT" layoutX="20.0" layoutY="20.0" prefHeight="23.0" prefWidth="334.0"> <HBox alignment="CENTER_LEFT" layoutX="20.0" layoutY="20.0" prefHeight="23.0" prefWidth="334.0">
@ -28,10 +28,20 @@
<ComboBox fx:id="selectHardinessZone_comboBox" prefWidth="150.0" promptText="Hardniness Zone" /> <ComboBox fx:id="selectHardinessZone_comboBox" prefWidth="150.0" promptText="Hardniness Zone" />
</children> </children>
<VBox.margin> <VBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets />
</VBox.margin> </VBox.margin>
</HBox> </HBox>
<HBox alignment="CENTER_LEFT" layoutX="20.0" layoutY="53.0" prefHeight="23.0" prefWidth="334.0" spacing="5.0">
<children>
<Label maxWidth="1.7976931348623157E308" text="Set Location" HBox.hgrow="ALWAYS" />
<Label fx:id="location_label" />
<Button fx:id="location_button" mnemonicParsing="false" onAction="#setLocation" />
</children> </children>
</HBox>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
</VBox> </VBox>
</children> </children>
</AnchorPane> </AnchorPane>

View File

@ -1,4 +1,4 @@
/*
#home_button, #myGarden_button, #home_button, #myGarden_button,
#mySchedule_button, #settings_button, #mySchedule_button, #settings_button,
@ -20,6 +20,6 @@
-fx-background-color: darkgreen; -fx-background-color: darkgreen;
} }
.root, .split-pane { .root, .scroll-pane, #homeVBox, #cropDetailVBox {
-fx-background-color: linear-gradient(green 0%, lawngreen 33%, lightgreen 66%, #eee 100%); -fx-background-color: #e6ffe6;
}./ }

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Button?>
<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml"
fx:controller="ch.zhaw.gartenverwaltung.HelloController">
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/>
</padding>
<Label fx:id="welcomeText"/>
<Button text="Hello!" onAction="#onHelloButtonClick"/>
</VBox>

View File

@ -235,7 +235,7 @@
"lifecycle": [ "lifecycle": [
{ {
"startDate": "12-01", "startDate": "12-01",
"endDate": "12-02", "endDate": "12-19",
"type": "SOW", "type": "SOW",
"zone": "ZONE_8A", "zone": "ZONE_8A",
"group": 0, "group": 0,
@ -252,7 +252,7 @@
}, },
{ {
"startDate": "12-03", "startDate": "12-03",
"endDate": "12-15", "endDate": "12-22",
"type": "PLANT", "type": "PLANT",
"zone": "ZONE_8A", "zone": "ZONE_8A",
"group": 0, "group": 0,
@ -268,7 +268,7 @@
}, },
{ {
"startDate": "12-16", "startDate": "12-16",
"endDate": "12-18", "endDate": "12-30",
"type": "HARVEST", "type": "HARVEST",
"zone": "ZONE_8A", "zone": "ZONE_8A",
"group": 0, "group": 0,