refactor: renamed everything

This commit is contained in:
David Guler
2022-11-14 13:47:22 +01:00
parent a5e1acc7c3
commit 4f80a0a3e0
24 changed files with 193 additions and 211 deletions
@@ -1,9 +1,9 @@
package ch.zhaw.gartenverwaltung;
import ch.zhaw.gartenverwaltung.gardenplan.Gardenplanmodel;
import ch.zhaw.gartenverwaltung.models.Garden;
import ch.zhaw.gartenverwaltung.io.HardinessZoneNotSetException;
import ch.zhaw.gartenverwaltung.plantList.PlantListModel;
import ch.zhaw.gartenverwaltung.taskList.TaskListModel;
import ch.zhaw.gartenverwaltung.models.PlantListModel;
import ch.zhaw.gartenverwaltung.models.GardenSchedule;
import ch.zhaw.gartenverwaltung.types.Crop;
import ch.zhaw.gartenverwaltung.types.Task;
import javafx.beans.property.ListProperty;
@@ -28,8 +28,8 @@ import java.util.ResourceBundle;
public class MyScheduleController implements Initializable {
private Crop selectedCrop = null;
private final TaskListModel taskListModel = new TaskListModel();
private final Gardenplanmodel gardenplanmodel = new Gardenplanmodel(taskListModel);
private final GardenSchedule gardenSchedule = new GardenSchedule();
private final Garden garden = new Garden(gardenSchedule);
private final PlantListModel plantListModel = new PlantListModel();
private final ListProperty<Crop> cropListProperty = new SimpleListProperty<>(FXCollections.observableArrayList());
@@ -89,7 +89,7 @@ public class MyScheduleController implements Initializable {
public void initialize(URL location, ResourceBundle resources) {
List<Crop> cropList;
try {
cropList = gardenplanmodel.getCrops();
cropList = garden.getCrops();
cropListProperty.addAll(cropList);
} catch (IOException e) {
e.printStackTrace();
@@ -141,7 +141,7 @@ public class MyScheduleController implements Initializable {
setText(null);
} else {
try {
setText(plantListModel.getFilteredPlantListById(Config.getCurrentHardinessZone(), crop.getPlantId()).get(0).name());
setText(plantListModel.getFilteredPlantListById(Settings.getInstance().getCurrentHardinessZone(), crop.getPlantId()).get(0).name());
} catch (HardinessZoneNotSetException | IOException e) {
e.printStackTrace();
}
@@ -153,9 +153,9 @@ public class MyScheduleController implements Initializable {
private void loadTaskList() throws IOException {
List<List<Task>> taskLists = new LinkedList<>();
if (selectedCrop != null) {
taskLists = taskListModel.getTasksUpcomingWeekForCrop(selectedCrop.getCropId().get());
taskLists = gardenSchedule.getTasksUpcomingWeekForCrop(selectedCrop.getCropId().get());
} else {
taskLists = taskListModel.getTasksUpcomingWeek();
taskLists = gardenSchedule.getTasksUpcomingWeek();
}
if (!taskLists.isEmpty()) {
viewTaskListOfDay(day1_pane, taskLists.get(0));