refactor: fixed and simplified dayCellFactory even more

Added method to check if a date is within a GrowthPhaseType to plant, thus removing the need for the ugly getMinDate methods and moving knowledge of the phase-internals to the Plant class.

Also removed the need to specify the lifecycle-group to the sowDateFromHarvest method
This commit is contained in:
David Guler
2022-11-15 22:45:01 +01:00
parent 90d2de65de
commit 9ba252b828
3 changed files with 50 additions and 42 deletions
@@ -18,15 +18,15 @@
<children>
<VBox alignment="CENTER_LEFT" prefHeight="88.0" prefWidth="155.0">
<children>
<RadioButton fx:id="sow_radio" mnemonicParsing="false" selected="true" text="Sow" toggleGroup="$group">
<RadioButton fx:id="sow_radio" mnemonicParsing="false" selected="true" text="Sow" toggleGroup="$phase_group">
<VBox.margin>
<Insets bottom="10.0" />
</VBox.margin>
<toggleGroup>
<ToggleGroup fx:id="group" />
<ToggleGroup fx:id="phase_group" />
</toggleGroup>
</RadioButton>
<RadioButton fx:id="harvest_radio" mnemonicParsing="false" text="Harvest" toggleGroup="$group" />
<RadioButton fx:id="harvest_radio" mnemonicParsing="false" text="Harvest" toggleGroup="$phase_group" />
</children>
<HBox.margin>
<Insets top="10.0" />