From 6fc320367b53c30cf27e5bb2801f87aacce4ac16 Mon Sep 17 00:00:00 2001 From: Krish Patel Date: Tue, 6 Dec 2022 18:07:40 -0500 Subject: [PATCH 1/3] Comminting untracked files --- .idea/misc.xml | 6 + .../shelved.patch | 190 +++++++++ ...kout_at_2022-12-04_7_48_p_m___Changes_.xml | 4 + .../shelved.patch | 25 ++ .../shelved.patch | 139 +++++++ ...kout_at_2022-12-04_7_50_p_m___Changes_.xml | 4 + ...out_at_2022-12-04_7_50_p_m___Changes_1.xml | 4 + .../model.ser | Bin 0 -> 577 bytes .../model1.ser | Bin 0 -> 577 bytes .../shelved.patch | 35 ++ .../model.ser | Bin 0 -> 577 bytes .../shelved.patch | 63 +++ ...kout_at_2022-12-04_9_37_p_m___Changes_.xml | 4 + ...out_at_2022-12-04_9_37_p_m___Changes_1.xml | 9 + .../model.ser | Bin 0 -> 253 bytes .../shelved.patch | 0 ...kout_at_2022-12-04_9_42_p_m___Changes_.xml | 9 + .../shelved.patch | 38 ++ .../shelved.patch | 0 ...kout_at_2022-12-06_3_35_p_m___Changes_.xml | 4 + .../model.ser | Bin 0 -> 229 bytes .../model1.ser | Bin 0 -> 229 bytes .../shelved.patch | 76 ++++ ...erge_at_2022-12-05_8_36_p_m___Changes_.xml | 14 + .../shelved.patch | 149 +++++++ ...date_at_2022-12-04_9_18_p_m___Changes_.xml | 14 + .../shelved.patch | 36 ++ ...date_at_2022-12-05_3_19_p_m___Changes_.xml | 4 + .../model.ser | Bin 0 -> 229 bytes .../model1.ser | Bin 0 -> 229 bytes .../shelved.patch | 140 +++++++ ...date_at_2022-12-05_9_26_p_m___Changes_.xml | 14 + .../shelved.patch | 3 + ...date_at_2022-12-05_9_28_p_m___Changes_.xml | 4 + .../shelved.patch | 107 +++++ ...date_at_2022-12-06_3_56_p_m___Changes_.xml | 4 + .../shelved.patch | 0 ...date_at_2022-12-06_6_02_p_m___Changes_.xml | 9 + .idea/vcs.xml | 6 + .idea/workspace.xml | 372 ++++++++++++++++++ .../shelved.patch | 190 +++++++++ ...kout_at_2022-12-04_7_48_p_m___Changes_.xml | 4 + .../shelved.patch | 25 ++ .../shelved.patch | 139 +++++++ ...kout_at_2022-12-04_7_50_p_m___Changes_.xml | 4 + ...out_at_2022-12-04_7_50_p_m___Changes_1.xml | 4 + .../model.ser | Bin 0 -> 577 bytes .../model1.ser | Bin 0 -> 577 bytes .../shelved.patch | 35 ++ .../model.ser | Bin 0 -> 577 bytes .../shelved.patch | 63 +++ ...kout_at_2022-12-04_9_37_p_m___Changes_.xml | 4 + ...out_at_2022-12-04_9_37_p_m___Changes_1.xml | 9 + .../model.ser | Bin 0 -> 253 bytes .../shelved.patch | 0 ...kout_at_2022-12-04_9_42_p_m___Changes_.xml | 9 + .../shelved.patch | 38 ++ .../shelved.patch | 0 ...kout_at_2022-12-06_3_35_p_m___Changes_.xml | 4 + .../model.ser | Bin 0 -> 229 bytes .../model1.ser | Bin 0 -> 229 bytes .../shelved.patch | 76 ++++ ...erge_at_2022-12-05_8_36_p_m___Changes_.xml | 14 + .../shelved.patch | 149 +++++++ ...date_at_2022-12-04_9_18_p_m___Changes_.xml | 14 + .../shelved.patch | 36 ++ ...date_at_2022-12-05_3_19_p_m___Changes_.xml | 4 + .../model.ser | Bin 0 -> 229 bytes .../model1.ser | Bin 0 -> 229 bytes .../shelved.patch | 140 +++++++ ...date_at_2022-12-05_9_26_p_m___Changes_.xml | 14 + .../shelved.patch | 3 + ...date_at_2022-12-05_9_28_p_m___Changes_.xml | 4 + .../The-Hamburglars/.idea/workspace.xml | 337 ++++++++++++++++ 74 files changed, 2805 insertions(+) create mode 100644 .idea/misc.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]1/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_1.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model.ser create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model1.ser create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/model.ser create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_1.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/model.ser create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]1/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model.ser create mode 100644 .idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model1.ser create mode 100644 .idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model.ser create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model1.ser create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_3_56_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_3_56_p_m___Changes_.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_6_02_p_m__[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_6_02_p_m___Changes_.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]1/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_1.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model.ser create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model1.ser create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/model.ser create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_1.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/model.ser create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]1/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model.ser create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model1.ser create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model.ser create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model1.ser create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m__[Changes]/shelved.patch create mode 100644 out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m___Changes_.xml create mode 100644 out/production/The-Hamburglars/.idea/workspace.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..fecc75b --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m__[Changes]/shelved.patch @@ -0,0 +1,190 @@ +Index: out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: .idea/libraries/javafx.xml +=================================================================== +diff --git a/.idea/libraries/javafx.xml b/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/.idea/libraries/javafx.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/libraries/javafx.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx.xml b/out/production/The-Hamburglars/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/ColorPick.fxml +=================================================================== +diff --git a/out/production/The-Hamburglars/ColorPick.fxml b/out/production/The-Hamburglars/ColorPick.fxml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/ColorPick.fxml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,12 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +Index: .idea/libraries/javafx_swt.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/libraries/javafx_swt.xml b/.idea/libraries/javafx_swt.xml +new file mode 100644 +--- /dev/null (date 1670196052751) ++++ b/.idea/libraries/javafx_swt.xml (date 1670196052751) +@@ -0,0 +1,16 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: out/production/The-Hamburglars/The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/The-Hamburglars.iml b/out/production/The-Hamburglars/The-Hamburglars.iml +--- a/out/production/The-Hamburglars/The-Hamburglars.iml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ b/out/production/The-Hamburglars/The-Hamburglars.iml (date 1670196179110) +@@ -7,6 +7,23 @@ + + + +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + +\ No newline at end of file +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ b/The-Hamburglars.iml (date 1670196179449) +@@ -7,6 +7,23 @@ + + + +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + +\ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m___Changes_.xml new file mode 100644 index 0000000..d7e7aab --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..7b3b71d --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]/shelved.patch @@ -0,0 +1,25 @@ +Index: .idea/libraries/javafx_graphics.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +=================================================================== +diff --git a/.idea/libraries/javafx_graphics.xml b/.idea/libraries/javafx_graphics.xml +--- a/.idea/libraries/javafx_graphics.xml ++++ b/.idea/libraries/javafx_graphics.xml +@@ -1,15 +1,6 @@ + + +- +- +- +- +- +- +- +- +- +- ++ + + + diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]1/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]1/shelved.patch new file mode 100644 index 0000000..df9f237 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]1/shelved.patch @@ -0,0 +1,139 @@ +Index: out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: .idea/libraries/javafx.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/libraries/javafx.xml b/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/.idea/libraries/javafx.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/libraries/javafx.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx.xml b/out/production/The-Hamburglars/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/ColorPick.fxml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/ColorPick.fxml b/out/production/The-Hamburglars/ColorPick.fxml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/ColorPick.fxml ++++ /dev/null +@@ -1,12 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +Index: .idea/libraries/javafx_swt.xml +=================================================================== +diff --git a/.idea/libraries/javafx_swt.xml b/.idea/libraries/javafx_swt.xml +new file mode 100644 +--- /dev/null ++++ b/.idea/libraries/javafx_swt.xml +@@ -0,0 +1,16 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml ++++ b/The-Hamburglars.iml +@@ -9,5 +9,6 @@ + + + ++ + + +\ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_.xml new file mode 100644 index 0000000..4a98c89 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_1.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_1.xml new file mode 100644 index 0000000..3563947 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_1.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model.ser b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..b3743cd7a09bb06f4db22b048f1ea78f6d01d614 GIT binary patch literal 577 zcmZuuJxfC|6uoU<)!G(85fSMk;^6QeI0>Dq6|Fo)s5mJS`(llx$umjYr-C5(7aSb? z2f8>qIJk6h>*V6xxjfAOt$_iB!=^ zJ9pkf7YT@!z>(w-Mm#Opq%F&x zH{9uBadK$jZ6Xd%3Hn1$m|91)jPHD|`Vd85u#dJG literal 0 HcmV?d00001 diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model1.ser b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model1.ser new file mode 100644 index 0000000000000000000000000000000000000000..b3743cd7a09bb06f4db22b048f1ea78f6d01d614 GIT binary patch literal 577 zcmZuuJxfC|6uoU<)!G(85fSMk;^6QeI0>Dq6|Fo)s5mJS`(llx$umjYr-C5(7aSb? z2f8>qIJk6h>*V6xxjfAOt$_iB!=^ zJ9pkf7YT@!z>(w-Mm#Opq%F&x zH{9uBadK$jZ6Xd%3Hn1$m|91)jPHD|`Vd85u#dJG literal 0 HcmV?d00001 diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..cbfa1df --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/shelved.patch @@ -0,0 +1,35 @@ +Index: out/production/The-Hamburglars/ColorPick.fxml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n +=================================================================== +diff --git a/out/production/The-Hamburglars/ColorPick.fxml b/out/production/The-Hamburglars/ColorPick.fxml +--- a/out/production/The-Hamburglars/ColorPick.fxml ++++ b/out/production/The-Hamburglars/ColorPick.fxml +@@ -3,10 +3,20 @@ + + + ++ + +- ++ + +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/model.ser b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..b3743cd7a09bb06f4db22b048f1ea78f6d01d614 GIT binary patch literal 577 zcmZuuJxfC|6uoU<)!G(85fSMk;^6QeI0>Dq6|Fo)s5mJS`(llx$umjYr-C5(7aSb? z2f8>qIJk6h>*V6xxjfAOt$_iB!=^ zJ9pkf7YT@!z>(w-Mm#Opq%F&x zH{9uBadK$jZ6Xd%3Hn1$m|91)jPHD|`Vd85u#dJG literal 0 HcmV?d00001 diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/shelved.patch new file mode 100644 index 0000000..7d7a382 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/shelved.patch @@ -0,0 +1,63 @@ +Index: out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/libraries/javafx_swt.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_swt.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_swt.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_swt.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/.gitignore +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+># Default ignored files\r\n/shelf/\r\n/workspace.xml\r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/.gitignore b/out/production/The-Hamburglars/.idea/.gitignore +--- a/out/production/The-Hamburglars/.idea/.gitignore ++++ b/out/production/The-Hamburglars/.idea/.gitignore +@@ -1,3 +1,4 @@ + # Default ignored files + /shelf/ + /workspace.xml ++/save/model.ser diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_.xml new file mode 100644 index 0000000..7a0c208 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_1.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_1.xml new file mode 100644 index 0000000..ed7efac --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_1.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/model.ser b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..93907df76c333700b404836af1e7f6f39657896b GIT binary patch literal 253 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osma2ZsX enVF;{8KmmR1Zh0t~?JW2hi3Pyqnd?nmGN literal 0 HcmV?d00001 diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..e69de29 diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m___Changes_.xml new file mode 100644 index 0000000..cfdb292 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m___Changes_.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..d94b05f --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]/shelved.patch @@ -0,0 +1,38 @@ +Index: event/EventTest.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package event;\r\n\r\nimport org.junit.jupiter.api.Test;\r\n\r\n\r\n/**\r\n * A Unit Test Class for Event.java.\r\n */\r\nclass EventTest {\r\n /**\r\n * A Unit Test for Event.complete().\r\n */\r\n @Test\r\n void complete() {\r\n\r\n }\r\n} +=================================================================== +diff --git a/event/EventTest.java b/event/EventTest.java +--- a/event/EventTest.java ++++ b/event/EventTest.java +@@ -1,6 +1,11 @@ + package event; + + import org.junit.jupiter.api.Test; ++import static org.junit.jupiter.api.Assertions.*; ++ ++import java.time.LocalDateTime; ++ ++import timeBehaviour.TimePoint; + + + /** +@@ -11,7 +16,15 @@ + * A Unit Test for Event.complete(). + */ + @Test +- void complete() { ++ void completeTest() { ++ Event e = new Event("Event1", "testing", 100, new TimePoint(LocalDateTime.now())); ++ ++ assertEquals(0, Event.getObserverList().size()); ++ assert(Event.getObserverList().contains(e)); + ++ e.complete(); ++ ++ assertEquals(0, Event.getObserverList().size()); ++ assertFalse(Event.getObserverList().contains(e)); + } + } +\ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]1/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]1/shelved.patch new file mode 100644 index 0000000..e69de29 diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m___Changes_.xml new file mode 100644 index 0000000..29891a2 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model.ser b/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..133c0dba5d6e4fd1be935dd19417b612af5b943c GIT binary patch literal 229 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osT!6oZt4 M0oWZ36@&#U0O?~wBLDyZ literal 0 HcmV?d00001 diff --git a/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model1.ser b/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model1.ser new file mode 100644 index 0000000000000000000000000000000000000000..133c0dba5d6e4fd1be935dd19417b612af5b943c GIT binary patch literal 229 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osT!6oZt4 M0oWZ36@&#U0O?~wBLDyZ literal 0 HcmV?d00001 diff --git a/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..b1a7d3d --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/shelved.patch @@ -0,0 +1,76 @@ +Index: event/EventTest.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/event/EventTest.java b/event/EventTest.java +new file mode 100644 +--- /dev/null (date 1670274282284) ++++ b/event/EventTest.java (date 1670274282284) +@@ -0,0 +1,16 @@ ++package event; ++ ++import org.junit.jupiter.api.Test; ++ ++ ++class EventTest { ++ ++ @Test ++ void complete() { ++ ++ } ++ ++ @Test ++ void addGoal() { ++ } ++} +\ No newline at end of file +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml (revision f96259081562f4e298ef9693cadbfae3e5efc41f) ++++ b/The-Hamburglars.iml (date 1670274282536) +@@ -8,5 +8,37 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + +\ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m___Changes_.xml new file mode 100644 index 0000000..eb98c2e --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m___Changes_.xml @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..a2145ee --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m__[Changes]/shelved.patch @@ -0,0 +1,149 @@ +Index: out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: .idea/libraries/javafx.xml +=================================================================== +diff --git a/.idea/libraries/javafx.xml b/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/.idea/libraries/javafx.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/libraries/javafx.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx.xml b/out/production/The-Hamburglars/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: .idea/libraries/javafx_swt.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/libraries/javafx_swt.xml b/.idea/libraries/javafx_swt.xml +new file mode 100644 +--- /dev/null (date 1670201469353) ++++ b/.idea/libraries/javafx_swt.xml (date 1670201469353) +@@ -0,0 +1,16 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/.name +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/.name b/.idea/.name +new file mode 100644 +--- /dev/null (date 1670196159872) ++++ b/.idea/.name (date 1670196159872) +@@ -0,0 +1,1 @@ ++CalendarView.java +\ No newline at end of file +Index: out/production/The-Hamburglars/The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/The-Hamburglars.iml b/out/production/The-Hamburglars/The-Hamburglars.iml +--- a/out/production/The-Hamburglars/The-Hamburglars.iml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ b/out/production/The-Hamburglars/The-Hamburglars.iml (date 1670201469330) +@@ -7,6 +7,6 @@ + + + +- ++ + + +\ No newline at end of file +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ b/The-Hamburglars.iml (date 1670201469330) +@@ -7,6 +7,6 @@ + + + +- ++ + + +\ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m___Changes_.xml new file mode 100644 index 0000000..fd96a6d --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m___Changes_.xml @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..025e1f2 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m__[Changes]/shelved.patch @@ -0,0 +1,36 @@ +Index: out/production/The-Hamburglars/ColorPick.fxml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/ColorPick.fxml b/out/production/The-Hamburglars/ColorPick.fxml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/ColorPick.fxml (revision cda9a00f1c13d03ac9c0a7285973d8ab40aab48b) ++++ /dev/null (revision cda9a00f1c13d03ac9c0a7285973d8ab40aab48b) +@@ -1,22 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +diff --git a/ColorPick.fxml b/views/ColorPick.fxml +rename from ColorPick.fxml +rename to views/ColorPick.fxml diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m___Changes_.xml new file mode 100644 index 0000000..79392da --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model.ser b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..133c0dba5d6e4fd1be935dd19417b612af5b943c GIT binary patch literal 229 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osT!6oZt4 M0oWZ36@&#U0O?~wBLDyZ literal 0 HcmV?d00001 diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model1.ser b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model1.ser new file mode 100644 index 0000000000000000000000000000000000000000..133c0dba5d6e4fd1be935dd19417b612af5b943c GIT binary patch literal 229 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osT!6oZt4 M0oWZ36@&#U0O?~wBLDyZ literal 0 HcmV?d00001 diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..9a00715 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/shelved.patch @@ -0,0 +1,140 @@ +Index: views/EventCreatorView.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package views;\r\n\r\n\r\nimport event.Event;\r\n\r\n\r\nimport javafx.geometry.Insets;\r\nimport javafx.scene.Scene;\r\nimport javafx.scene.control.Button;\r\nimport javafx.scene.control.DatePicker;\r\nimport javafx.scene.control.Label;\r\nimport javafx.scene.control.TextField;\r\nimport javafx.scene.layout.VBox;\r\nimport javafx.scene.text.Font;\r\nimport javafx.stage.Modality;\r\nimport javafx.stage.Stage;\r\n\r\nimport model.CalendarModel;\r\nimport timeBehaviour.TimeBehaviour;\r\nimport timeBehaviour.TimePoint;\r\nimport timeBehaviour.TimeRange;\r\n\r\nimport java.awt.*;\r\nimport java.time.LocalDate;\r\nimport java.time.LocalDateTime;\r\nimport java.time.format.DateTimeFormatter;\r\nimport java.time.LocalDate;\r\n\r\nimport java.util.regex.Matcher;\r\nimport java.util.regex.Pattern;\r\n\r\n\r\npublic class EventCreatorView {\r\n\r\n CalendarView calendarView;\r\n\r\n// CalendarModel calendarModel;\r\n private Label createEventLabel = new Label(\"Create a new event!\");\r\n private TextField nameTextField = new TextField(\"Name\");\r\n private TextField pointsTextField = new TextField(\"Points\");\r\n private TextField descTextField = new TextField(\"Description\");\r\n private Button changeTimeButton = new Button(\"Choose start/end time\");\r\n private DatePicker pointDatePicker = new DatePicker(LocalDate.now());\r\n private TextField pointTimePicker = new TextField(\"Time (hh:mm)\");\r\n private DatePicker startDatePicker = new DatePicker(LocalDate.now());\r\n private TextField startTimePicker = new TextField(\"Start time (hh:mm)\");\r\n private DatePicker endDatePicker = new DatePicker(LocalDate.now());\r\n private TextField endTimePicker = new TextField(\"End time (hh:mm)\");\r\n private Button saveButton = new Button(\"Save Event\");\r\n private Label errorLabel = new Label(\"\");\r\n\r\n private Paint colour;\r\n\r\n\r\n /**\r\n * Constructor\r\n *\r\n * @param calendarView the application's CalendarView\r\n */\r\n public EventCreatorView(CalendarView calendarView) {\r\n this.calendarView = calendarView;\r\n\r\n// this.calendarModel = this.calendarView.model;\r\n\r\n final Stage dialog = new Stage();\r\n dialog.initModality(Modality.APPLICATION_MODAL);\r\n dialog.initOwner(calendarView.stage);\r\n VBox dialogVbox = new VBox(20);\r\n dialogVbox.setPadding(new Insets(20, 20, 20, 20));\r\n\r\n Font f = new Font(16);\r\n createEventLabel.setFont(f);\r\n nameTextField.setFont(f);\r\n pointsTextField.setFont(f);\r\n descTextField.setFont(f);\r\n changeTimeButton.setFont(f);\r\n pointTimePicker.setFont(f);\r\n startTimePicker.setFont(f);\r\n endTimePicker.setFont(f);\r\n saveButton.setFont(f);\r\n\r\n saveButton.setOnAction(e -> createEvent());\r\n\r\n VBox vbox = new VBox(10, createEventLabel, nameTextField, pointsTextField, descTextField, changeTimeButton, pointDatePicker, pointTimePicker, saveButton, errorLabel);\r\n dialogVbox.getChildren().add(vbox);\r\n Scene scene = new Scene(dialogVbox, 400, 500);\r\n dialog.setScene(scene);\r\n dialog.show();\r\n dialog.setAlwaysOnTop(true);\r\n\r\n changeTimeButton.setOnAction(e -> {\r\n if (vbox.getChildren().contains(pointDatePicker)) {\r\n vbox.getChildren().remove(pointDatePicker);\r\n vbox.getChildren().remove(pointTimePicker);\r\n vbox.getChildren().remove(saveButton);\r\n vbox.getChildren().remove(errorLabel);\r\n pointDatePicker.setValue(LocalDate.now());\r\n pointTimePicker.setText(\"Time (hh:mm)\");\r\n changeTimeButton.setText(\"Choose single time\");\r\n vbox.getChildren().add(startDatePicker);\r\n vbox.getChildren().add(startTimePicker);\r\n vbox.getChildren().add(endDatePicker);\r\n vbox.getChildren().add(endTimePicker);\r\n } else {\r\n vbox.getChildren().remove(startDatePicker);\r\n vbox.getChildren().remove(startTimePicker);\r\n vbox.getChildren().remove(endDatePicker);\r\n vbox.getChildren().remove(endTimePicker);\r\n vbox.getChildren().remove(saveButton);\r\n vbox.getChildren().remove(errorLabel);\r\n startDatePicker.setValue(LocalDate.now());\r\n startTimePicker.setText(\"Start time (hh:mm)\");\r\n endDatePicker.setValue(LocalDate.now());\r\n endTimePicker.setText(\"End time (hh:mm)\");\r\n changeTimeButton.setText(\"Choose start/end time\");\r\n vbox.getChildren().add(pointDatePicker);\r\n vbox.getChildren().add(pointTimePicker);\r\n }\r\n vbox.getChildren().add(saveButton);\r\n vbox.getChildren().add(errorLabel);\r\n\r\n });\r\n\r\n }\r\n\r\n /**\r\n * Create a new Event using the parameters given in the text fields and date pickers.\r\n * Store this new Event in the CalendarModel's list of Events.\r\n */\r\n private void createEvent() throws NumberFormatException {\r\n\r\n // Check if the Event's Name is not empty.\r\n if (this.nameTextField.getText().trim().isEmpty() || this.nameTextField.getText().trim().isBlank()) {\r\n this.errorLabel.setText(\"Please enter the Event Name. It can NOT be Blank!\");\r\n return;\r\n }\r\n else\r\n {\r\n String temp = this.nameTextField.getText().trim();\r\n for(Event i: this.calendarView.model.getAllEvents())\r\n {\r\n if (temp.equals(i.getName()))\r\n {\r\n this.errorLabel.setText(\"Event Name already taken!\");\r\n return;\r\n }\r\n }\r\n }\r\n String event_name = this.nameTextField.getText().trim();\r\n\r\n // Check if the Event's Description is not empty.\r\n if (this.descTextField.getText().trim().isEmpty() || this.descTextField.getText().trim().isBlank()) {\r\n this.errorLabel.setText(\"Please enter the Event's Description. It can NOT be Blank!\");\r\n return;\r\n }\r\n String event_description = this.descTextField.getText().trim();\r\n\r\n\r\n String points = String.valueOf(this.pointsTextField.getText()).trim();\r\n int event_points = 0;\r\n // Check if the Event's associated Points are of integer type.\r\n try {\r\n event_points += Integer.parseInt(points);\r\n } catch (NumberFormatException e) {\r\n this.errorLabel.setText(\"Please enter a Integer value for the points associated with the event.\");\r\n return;\r\n }\r\n\r\n\r\n //Check the type of the time and create time range or time point based on that.\r\n if (this.endTimePicker.getText().trim().isBlank() || this.endTimePicker.getText().trim().isEmpty() || this.startTimePicker.getText().trim().equals(\"Start time (hh:mm)\") || this.endTimePicker.getText().trim().equals(\"End time (hh:mm)\")) {\r\n // Create a new Time Point object based on the deadline of the user.\r\n\r\n String deadline_hours = this.pointTimePicker.getText().trim();\r\n\r\n Pattern pattern = Pattern.compile(\"^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\");\r\n Matcher matcher = pattern.matcher(deadline_hours);\r\n if (matcher.find()) {\r\n // match found, valid deadline HH:mm.\r\n String yyyy_mm_dd = this.pointDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n\r\n // TODO: Consider the case of the where the deadline is a past date.\r\n\r\n String yyyy_mm_dd_HH_mm = yyyy_mm_dd + \" \" + deadline_hours;\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime pointTime = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter);\r\n\r\n\r\n // Create a TimePoint object.\r\n TimeBehaviour tp = new TimePoint(pointTime);\r\n\r\n // Finally, create a new Event with the new TimePoint deadline time of the event.\r\n Event e = new Event(event_name, event_description, event_points, tp);\r\n\r\n\r\n // Add the event to the events list of CalendarView.model.events\r\n this.calendarView.model.addEvent(e);\r\n\r\n this.calendarView.saveModel();\r\n //Success Message!\r\n this.errorLabel.setText(\"Event Added to the Calendar!\");\r\n\r\n }\r\n else\r\n {\r\n // Invalid Format of HH:mm\r\n this.errorLabel.setText(\"Please Re-enter the time of the event. Enter in HH:mm format.\");\r\n return;\r\n }\r\n } else {\r\n // Create a new Time Range object based on the start-time and end-time of the user.\r\n\r\n\r\n String start_time = this.startTimePicker.getText().trim();\r\n String end_time = this.endTimePicker.getText().trim();\r\n\r\n\r\n Pattern pattern = Pattern.compile(\"^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\");\r\n\r\n Matcher matcher = pattern.matcher(start_time);\r\n Matcher matcher1 = pattern.matcher(end_time);\r\n\r\n if (matcher1.find() && matcher.find()) {\r\n // match found, valid deadline HH:mm.\r\n String yyyy_mm_dd = this.startDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n String yyyy_mm_dd2 = this.endDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n\r\n // TODO: Consider the case of the where the deadline is a past date.\r\n\r\n String yyyy_mm_dd_HH_mm = yyyy_mm_dd + \" \" + start_time;\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime start_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter);\r\n\r\n String yyyy_mm_dd_HH_mm2 = yyyy_mm_dd2 + \" \" + end_time;\r\n DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime end_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm2, formatter2);\r\n\r\n System.out.println(start_time_block + \" \" + end_time_block);\r\n\r\n\r\n // Create a TimeRange object.\r\n TimeBehaviour tr = new TimeRange(start_time_block, end_time_block);\r\n\r\n // Finally, create a new Event with the new TimeRange start and end time of the event block.\r\n Event e = new Event(event_name, event_description, event_points, tr);\r\n\r\n\r\n // Add the event to the events list of CalendarView.model.events\r\n this.calendarView.model.addEvent(e);\r\n\r\n this.calendarView.saveModel();\r\n\r\n //Success Message!\r\n this.errorLabel.setText(\"Event Added to the Calendar!\");\r\n } else {\r\n // Invalid Format of HH:mm\r\n this.errorLabel.setText(\"Invalid Start/End time of the event. Enter in HH:mm format.\");\r\n return;\r\n }\r\n\r\n }\r\n }\r\n}\r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/views/EventCreatorView.java b/views/EventCreatorView.java +--- a/views/EventCreatorView.java (revision e720e387022c58cd8397f2300c98470cc5c02a6b) ++++ b/views/EventCreatorView.java (date 1670290635499) +@@ -34,7 +34,6 @@ + + CalendarView calendarView; + +-// CalendarModel calendarModel; + private Label createEventLabel = new Label("Create a new event!"); + private TextField nameTextField = new TextField("Name"); + private TextField pointsTextField = new TextField("Points"); +Index: views/EventEditorView.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package views;\r\n\r\nimport event.Event;\r\nimport javafx.geometry.Insets;\r\nimport javafx.scene.Scene;\r\nimport javafx.scene.control.Button;\r\nimport javafx.scene.control.DatePicker;\r\nimport javafx.scene.control.Label;\r\nimport javafx.scene.control.TextField;\r\nimport javafx.scene.layout.VBox;\r\nimport javafx.scene.text.Font;\r\nimport javafx.stage.Modality;\r\nimport javafx.stage.Stage;\r\nimport timeBehaviour.TimeBehaviour;\r\nimport timeBehaviour.TimePoint;\r\nimport timeBehaviour.TimeRange;\r\n\r\nimport java.time.LocalDate;\r\nimport java.time.LocalDateTime;\r\nimport java.time.format.DateTimeFormatter;\r\nimport java.util.regex.Matcher;\r\nimport java.util.regex.Pattern;\r\n\r\npublic class EventEditorView {\r\n\r\n private CalendarView calendarView;\r\n private Event event;\r\n\r\n private Label editEventLabel = new Label(\"\");\r\n\r\n// private Button completeButton = new Button(\"Complete!\");\r\n private TextField nameTextField = new TextField(\"\");\r\n private TextField pointsTextField = new TextField(\"\");\r\n private TextField descTextField = new TextField(\"\");\r\n private Button changeTimeButton = new Button(\"Choose start/end time\");\r\n private DatePicker pointDatePicker = new DatePicker(LocalDate.now());\r\n private TextField pointTimePicker = new TextField(\"Time (hh:mm)\");\r\n private DatePicker startDatePicker = new DatePicker(LocalDate.now());\r\n private TextField startTimePicker = new TextField(\"Start time (hh:mm)\");\r\n private DatePicker endDatePicker = new DatePicker(LocalDate.now());\r\n private TextField endTimePicker = new TextField(\"End time (hh:mm)\");\r\n private Button saveButton = new Button(\"Save Changes\");\r\n private Label errorLabel = new Label(\"\");\r\n\r\n /**\r\n * Constructor\r\n *\r\n * @param calendarView the application's CalendarView\r\n */\r\n public EventEditorView(CalendarView calendarView, Event event) {\r\n this.calendarView = calendarView;\r\n this.event = event;\r\n\r\n final Stage dialog = new Stage();\r\n dialog.initModality(Modality.APPLICATION_MODAL);\r\n dialog.initOwner(calendarView.stage);\r\n VBox dialogVbox = new VBox(20);\r\n dialogVbox.setPadding(new Insets(20, 20, 20, 20));\r\n\r\n Font f = new Font(16);\r\n editEventLabel.setFont(f);\r\n nameTextField.setFont(f);\r\n pointsTextField.setFont(f);\r\n descTextField.setFont(f);\r\n changeTimeButton.setFont(f);\r\n pointTimePicker.setFont(f);\r\n startTimePicker.setFont(f);\r\n endTimePicker.setFont(f);\r\n saveButton.setFont(f);\r\n errorLabel.setFont(f);\r\n\r\n VBox vbox = new VBox(10, editEventLabel, nameTextField, pointsTextField, descTextField, changeTimeButton, pointDatePicker, pointTimePicker, saveButton, errorLabel);\r\n dialogVbox.getChildren().add(vbox);\r\n Scene scene = new Scene(dialogVbox, 400, 500);\r\n dialog.setScene(scene);\r\n dialog.show();\r\n dialog.setAlwaysOnTop(true);\r\n\r\n saveButton.setOnAction(e -> editEvent());\r\n\r\n changeTimeButton.setOnAction(e -> changeTime(vbox));\r\n\r\n editEventLabel.setText(\"Edit Event: \" + event.getName());\r\n nameTextField.setText(event.getName());\r\n pointsTextField.setText(String.valueOf(event.getPointValue()));\r\n descTextField.setText(event.getDescription());\r\n\r\n\r\n //If event has a time point:\r\n if(event.getTimeBehaviour() instanceof TimePoint)\r\n {\r\n TimePoint tp = (TimePoint) event.getTimeBehaviour();\r\n\r\n //set values of pointDatePicker and pointTimePicker to event's time\r\n this.pointDatePicker.setValue(tp.getTime().toLocalDate());\r\n this.pointTimePicker.setText(tp.getTime().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\")).substring(11,16));\r\n }\r\n\r\n\r\n //If event has a time range:\r\n else {\r\n changeTime(vbox);\r\n\r\n //set values of startDatePicker, startTimePicker, endDatePicker and endTimePicker\r\n TimeRange tr = (TimeRange) event.getTimeBehaviour();\r\n\r\n this.startDatePicker.setValue(tr.getStartTime().toLocalDate());\r\n this.endDatePicker.setValue(tr.getEndTime().toLocalDate());\r\n\r\n this.startTimePicker.setText(tr.getStartTime().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\")).substring(11,16));\r\n this.endTimePicker.setText(tr.getEndTime().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\")).substring(11,16));\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Edit the details of the event and save accordingly.\r\n */\r\n private void editEvent() {\r\n\r\n // Check if the Event's Name is not empty.\r\n if (this.nameTextField.getText().trim().isEmpty() || this.nameTextField.getText().trim().isBlank()) {\r\n this.errorLabel.setText(\"Please enter the Event Name. It can NOT be Blank!\");\r\n return;\r\n }\r\n // Check if the event name is already in the events list.\r\n else\r\n {\r\n String temp = this.nameTextField.getText().trim();\r\n for(Event i: this.calendarView.model.getAllEvents())\r\n {\r\n if (temp.equals(i.getName()))\r\n {\r\n this.errorLabel.setText(\"Event Name already taken!\");\r\n return;\r\n }\r\n }\r\n }\r\n this.event.setName(this.nameTextField.getText().trim());\r\n\r\n\r\n // Check if the Event's Description is not empty.\r\n if (this.descTextField.getText().trim().isEmpty() || this.descTextField.getText().trim().isBlank()) {\r\n this.errorLabel.setText(\"Please enter the Event's Description. It can NOT be Blank!\");\r\n return;\r\n }\r\n this.event.setDescription(this.descTextField.getText().trim());\r\n\r\n\r\n String points = String.valueOf(this.pointsTextField.getText()).trim();\r\n int event_points = 0;\r\n // Check if the Event's associated Points are of integer type.\r\n try {\r\n event_points += Integer.parseInt(points);\r\n } catch (NumberFormatException e) {\r\n this.errorLabel.setText(\"Please enter a Integer value for the points associated with the event.\");\r\n return;\r\n }\r\n this.event.setPointValue(event_points);\r\n\r\n\r\n\r\n\r\n if (this.endTimePicker.getText().trim().isBlank() || this.endTimePicker.getText().trim().isEmpty() || this.startTimePicker.getText().trim().equals(\"Start time (hh:mm)\") || this.endTimePicker.getText().trim().equals(\"End time (hh:mm)\")) {\r\n // Create a new Time Point object based on the deadline of the user.\r\n\r\n String deadline_hours = this.pointTimePicker.getText().trim();\r\n\r\n Pattern pattern = Pattern.compile(\"^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\");\r\n Matcher matcher = pattern.matcher(deadline_hours);\r\n if (matcher.find()) {\r\n // match found, valid deadline HH:mm.\r\n String yyyy_mm_dd = this.pointDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n\r\n // TODO: Consider the case of the where the deadline is a past date.\r\n\r\n String yyyy_mm_dd_HH_mm = yyyy_mm_dd + \" \" + deadline_hours;\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime pointTime = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter);\r\n\r\n\r\n // Create a TimePoint object.\r\n TimeBehaviour tp = new TimePoint(pointTime);\r\n\r\n this.event.setTimeBehaviour(tp);\r\n\r\n// this.calendarView.saveModel();\r\n\r\n //Success Message!\r\n this.errorLabel.setText(\"Event Added to the Calendar!\");\r\n this.calendarView.saveModel();\r\n } else {\r\n // Invalid Format of HH:mm\r\n this.errorLabel.setText(\"Please Re-enter the time of the event. Enter in HH:mm format.\");\r\n return;\r\n }\r\n } else {\r\n // Create a new Time Range object based on the start-time and end-time of the user.\r\n\r\n String start_time = this.startTimePicker.getText().trim();\r\n String end_time = this.endTimePicker.getText().trim();\r\n\r\n\r\n Pattern pattern = Pattern.compile(\"^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\");\r\n\r\n Matcher matcher = pattern.matcher(start_time);\r\n Matcher matcher1 = pattern.matcher(end_time);\r\n\r\n if (matcher1.find() && matcher.find()) {\r\n // match found, valid deadline HH:mm.\r\n String yyyy_mm_dd = this.startDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n String yyyy_mm_dd2 = this.endDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n\r\n // TODO: Consider the case of the where the deadline is a past date.\r\n\r\n String yyyy_mm_dd_HH_mm = yyyy_mm_dd + \" \" + start_time;\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime start_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter);\r\n\r\n String yyyy_mm_dd_HH_mm2 = yyyy_mm_dd2 + \" \" + end_time;\r\n DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime end_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm2, formatter2);\r\n\r\n System.out.println(start_time_block + \" \" + end_time_block);\r\n\r\n\r\n // Create a TimeRange object.\r\n TimeBehaviour tr = new TimeRange(start_time_block, end_time_block);\r\n\r\n this.event.setTimeBehaviour(tr);\r\n// this.calendarView.saveModel();\r\n\r\n //Success Message!\r\n this.errorLabel.setText(\"Event Added to the Calendar!\");\r\n\r\n this.calendarView.saveModel();\r\n } else {\r\n // Invalid Format of HH:mm\r\n this.errorLabel.setText(\"Invalid Start/End time of the event. Enter in HH:mm format.\");\r\n return;\r\n }\r\n\r\n }\r\n }\r\n\r\n /**\r\n * Switches between displaying input for time points/time ranges\r\n *\r\n * @param vbox\r\n */\r\n private void changeTime(VBox vbox) {\r\n {\r\n if (vbox.getChildren().contains(pointDatePicker)) {\r\n vbox.getChildren().remove(pointDatePicker);\r\n vbox.getChildren().remove(pointTimePicker);\r\n vbox.getChildren().remove(saveButton);\r\n vbox.getChildren().remove(errorLabel);\r\n pointDatePicker.setValue(LocalDate.now());\r\n pointTimePicker.setText(\"Time (hh:mm)\");\r\n changeTimeButton.setText(\"Choose single time\");\r\n vbox.getChildren().add(startDatePicker);\r\n vbox.getChildren().add(startTimePicker);\r\n vbox.getChildren().add(endDatePicker);\r\n vbox.getChildren().add(endTimePicker);\r\n } else {\r\n vbox.getChildren().remove(startDatePicker);\r\n vbox.getChildren().remove(startTimePicker);\r\n vbox.getChildren().remove(endDatePicker);\r\n vbox.getChildren().remove(endTimePicker);\r\n vbox.getChildren().remove(saveButton);\r\n vbox.getChildren().remove(errorLabel);\r\n startDatePicker.setValue(LocalDate.now());\r\n startTimePicker.setText(\"Start time (hh:mm)\");\r\n endDatePicker.setValue(LocalDate.now());\r\n endTimePicker.setText(\"End time (hh:mm)\");\r\n changeTimeButton.setText(\"Choose start/end time\");\r\n vbox.getChildren().add(pointDatePicker);\r\n vbox.getChildren().add(pointTimePicker);\r\n }\r\n vbox.getChildren().add(saveButton);\r\n vbox.getChildren().add(errorLabel);\r\n }\r\n }\r\n}\r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/views/EventEditorView.java b/views/EventEditorView.java +--- a/views/EventEditorView.java (revision e720e387022c58cd8397f2300c98470cc5c02a6b) ++++ b/views/EventEditorView.java (date 1670290676360) +@@ -1,6 +1,7 @@ + package views; + + import event.Event; ++ + import javafx.geometry.Insets; + import javafx.scene.Scene; + import javafx.scene.control.Button; +@@ -11,6 +12,7 @@ + import javafx.scene.text.Font; + import javafx.stage.Modality; + import javafx.stage.Stage; ++ + import timeBehaviour.TimeBehaviour; + import timeBehaviour.TimePoint; + import timeBehaviour.TimeRange; +@@ -18,9 +20,11 @@ + import java.time.LocalDate; + import java.time.LocalDateTime; + import java.time.format.DateTimeFormatter; ++ + import java.util.regex.Matcher; + import java.util.regex.Pattern; + ++ + public class EventEditorView { + + private CalendarView calendarView; +@@ -28,7 +32,6 @@ + + private Label editEventLabel = new Label(""); + +-// private Button completeButton = new Button("Complete!"); + private TextField nameTextField = new TextField(""); + private TextField pointsTextField = new TextField(""); + private TextField descTextField = new TextField(""); +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml (revision e720e387022c58cd8397f2300c98470cc5c02a6b) ++++ b/The-Hamburglars.iml (date 1670290593033) +@@ -8,5 +8,37 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + +\ No newline at end of file +Index: event/EventTest.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/event/EventTest.java b/event/EventTest.java +new file mode 100644 +--- /dev/null (date 1670290593001) ++++ b/event/EventTest.java (date 1670290593001) +@@ -0,0 +1,16 @@ ++package event; ++ ++import org.junit.jupiter.api.Test; ++ ++ ++class EventTest { ++ ++ @Test ++ void complete() { ++ ++ } ++ ++ @Test ++ void addGoal() { ++ } ++} +\ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m___Changes_.xml new file mode 100644 index 0000000..5b77c35 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m___Changes_.xml @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..db3dab8 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m__[Changes]/shelved.patch @@ -0,0 +1,3 @@ +diff --git a/ColorPick.fxml b/views/ColorPick.fxml +rename from ColorPick.fxml +rename to views/ColorPick.fxml diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m___Changes_.xml new file mode 100644 index 0000000..bf46aae --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_3_56_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_3_56_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..5eb27e7 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_3_56_p_m__[Changes]/shelved.patch @@ -0,0 +1,107 @@ +Index: model/CalendarModel.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package model;\r\n\r\nimport event.Event;\r\nimport observer.EventObserver;\r\n\r\nimport java.time.LocalDateTime;\r\nimport java.io.Serializable;\r\nimport java.util.ArrayList;\r\n\r\n// Class to store app information behind the scene\r\npublic class CalendarModel implements Serializable {\r\n\r\n // list of events\r\n ArrayList events;\r\n\r\n // color settings\r\n public String colour;\r\n public String colour_font;\r\n\r\n // list of goals that remain the same\r\n private static ArrayList completedGoals = new ArrayList<>();\r\n\r\n\r\n // Constructor for no events\r\n public CalendarModel()\r\n {\r\n this.events = new ArrayList();\r\n }\r\n\r\n // Constructor if some events are there\r\n public CalendarModel(ArrayList events){\r\n this.events = events;\r\n }\r\n\r\n // get list of completed goals\r\n public static ArrayList getCompletedGoals() {\r\n return completedGoals;\r\n }\r\n\r\n // set completed goals\r\n public static void setCompletedGoals(ArrayList oList) {completedGoals = oList;}\r\n\r\n // add an event to the calendar\r\n public void addEvent(Event e)\r\n {\r\n this.events.add(e);\r\n }\r\n\r\n // get the list of all events\r\n public ArrayList getAllEvents(){\r\n return this.events;\r\n }\r\n\r\n // get events filtered by a date\r\n public ArrayList getEventsInTime(LocalDateTime time)\r\n {\r\n ArrayList filteredEvents = new ArrayList<>();\r\n for (Event e: this.events)\r\n if (e.getTimeBehaviour().inTime(time))\r\n {\r\n System.out.println(e.getName());\r\n filteredEvents.add(e);\r\n }\r\n return filteredEvents;\r\n }\r\n}\r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/model/CalendarModel.java b/model/CalendarModel.java +--- a/model/CalendarModel.java (revision f2cf53451c55d8db395986bc1d2605377a89ff82) ++++ b/model/CalendarModel.java (date 1670360126300) +@@ -51,7 +51,9 @@ + return this.events; + } + +- // get events filtered by a date ++ /** ++ * get events filtered by a date ++ */ + public ArrayList getEventsInTime(LocalDateTime time) + { + ArrayList filteredEvents = new ArrayList<>(); +Index: views/CalendarView.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package views;\r\n\r\nimport event.Event;\r\nimport javafx.fxml.FXML;\r\nimport javafx.collections.FXCollections;\r\nimport javafx.collections.ObservableList;\r\nimport javafx.fxml.FXMLLoader;\r\nimport javafx.geometry.Insets;\r\nimport javafx.geometry.Pos;\r\nimport javafx.scene.Node;\r\nimport javafx.scene.Parent;\r\nimport javafx.scene.Scene;\r\nimport javafx.scene.control.*;\r\nimport javafx.scene.control.Button;\r\nimport javafx.scene.control.DatePicker;\r\nimport javafx.scene.control.Label;\r\nimport javafx.scene.control.ListView;\r\nimport javafx.scene.control.skin.DatePickerSkin;\r\nimport javafx.scene.paint.Paint;\r\nimport javafx.scene.shape.Circle;\r\nimport javafx.scene.text.Font;\r\nimport javafx.stage.Modality;\r\nimport javafx.scene.layout.*;\r\nimport javafx.stage.Stage;\r\nimport model.CalendarModel;\r\nimport observer.EventObserver;\r\nimport javafx.scene.layout.*;\r\nimport javafx.stage.StageStyle;\r\n\r\n\r\nimport java.io.*;\r\nimport java.time.LocalDate;\r\nimport java.time.LocalDateTime;\r\nimport java.util.ArrayList;\r\n\r\n\r\npublic class CalendarView {\r\n\r\n //Below defines all the components we'll need\r\n\r\n //The main root\r\n Stage stage;\r\n\r\n //The model that stores event information\r\n CalendarModel model;\r\n\r\n //The sublayout that contains our calendar\r\n AnchorPane calendarLayout;\r\n\r\n //The overall layout that contains everything\r\n BorderPane realLayout;\r\n\r\n //Buttons used for functionality\r\n Button makeEventButton;\r\n Button makeGoalButton;\r\n Button changeThemeButton;\r\n Button viewGoalButton;\r\n\r\n //The calendar used to access events\r\n DatePicker calendar;\r\n\r\n //A wrapper class used to help display the calendar in a better way\r\n DatePickerSkin calendarSkin;\r\n\r\n // A node that takes the calendar and makes it always visible\r\n Node calendarDisplay;\r\n Button editButton;\r\n\r\n //Label showing the selected date\r\n Label dateDisplay;\r\n Button completeEventButton;\r\n\r\n //Variables for getting the background and text color to change window theme\r\n static Paint colour = javafx.scene.paint.Color.valueOf(\"#FFFFFF\") ;;\r\n static Paint colour_font = javafx.scene.paint.Color.valueOf(\"#000000\") ;\r\n\r\n // ListView to display event names for a specific date\r\n ListView eventsView = new ListView<>();\r\n\r\n // List to store events for a given date\r\n ArrayList events = new ArrayList<>();\r\n\r\n // static instance\r\n static CalendarView instance;\r\n\r\n //Method to implement singleton design pattern\r\n public static CalendarView getView(CalendarModel model, Stage stage){\r\n if (instance == null){\r\n instance = new CalendarView(model, stage);\r\n }\r\n return instance;\r\n }\r\n\r\n private CalendarView(CalendarModel model, Stage stage){\r\n // Get a model\r\n this.model = model;\r\n\r\n // load stored model info\r\n loadModel();\r\n this.stage = stage;\r\n\r\n // Set up the layouts\r\n this.calendarLayout = new AnchorPane();\r\n this.realLayout = new BorderPane();\r\n\r\n // Create the UI\r\n initUI();\r\n }\r\n\r\n public void loadModel() {\r\n File folder = new File(\"save/\");\r\n if (!folder.exists()) {\r\n return;\r\n }\r\n File[] fileList = folder.listFiles();\r\n assert fileList != null;\r\n for (File f : fileList) {\r\n if (f.isFile() && f.getName().equals(\"model.ser\")) {\r\n try {\r\n FileInputStream file = new FileInputStream(\"save/model.ser\");\r\n ObjectInputStream in = new ObjectInputStream(file);\r\n ArrayList loadList = (ArrayList) in.readObject();\r\n this.model = (CalendarModel) loadList.get(0);\r\n Event.setObserverList((ArrayList) loadList.get(1));\r\n CalendarModel.setCompletedGoals((ArrayList) loadList.get(2));\r\n CalendarView.colour = javafx.scene.paint.Color.valueOf(this.model.colour);\r\n CalendarView.colour_font = javafx.scene.paint.Color.valueOf(this.model.colour_font);\r\n } catch (FileNotFoundException e) {\r\n throw new RuntimeException(e);\r\n } catch (IOException e) {\r\n throw new RuntimeException(e);\r\n } catch (ClassNotFoundException e) {\r\n throw new RuntimeException(e);\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n public void saveModel() {\r\n this.model.colour = colour.toString();\r\n this.model.colour_font = colour_font.toString();\r\n File folder = new File(\"save/\");\r\n if (!folder.exists()) {\r\n folder.mkdir();\r\n }\r\n File fModel = new File(\"save/model.ser\");\r\n ArrayList saveList = new ArrayList<>();\r\n try {\r\n saveList.add(this.model);\r\n saveList.add(Event.getObserverList());\r\n saveList.add(CalendarModel.getCompletedGoals());\r\n FileOutputStream fout = new FileOutputStream(fModel);\r\n ObjectOutputStream oos = new ObjectOutputStream(fout);\r\n oos.writeObject(saveList);\r\n } catch (FileNotFoundException e) {\r\n throw new RuntimeException(e);\r\n } catch (IOException e) {\r\n throw new RuntimeException(e);\r\n }\r\n\r\n }\r\n\r\n private void initUI(){\r\n\r\n // set the title of the screen\r\n this.stage.setTitle(\"Chronos\");\r\n\r\n\r\n //Make core screen\r\n this.calendarLayout = new AnchorPane();\r\n this.realLayout = new BorderPane();\r\n\r\n //make a DatePicker for our calendar, and then set up a display that keeps\r\n // the calendar always active\r\n calendar = new DatePicker(LocalDate.now());\r\n calendarSkin = new DatePickerSkin(calendar);\r\n calendarDisplay = calendarSkin.getPopupContent();\r\n calendarDisplay.setScaleX(1.5);\r\n calendarDisplay.setScaleY(1.5);\r\n calendarDisplay.setLayoutX(100);\r\n calendarDisplay.setLayoutY(100);\r\n calendarLayout.getChildren().add(calendarDisplay);\r\n calendarLayout.setPrefSize(400, 400);\r\n calendarLayout.setBackground(new Background(new BackgroundFill(colour,null,null)));\r\n\r\n //Create the label to display the date\r\n this.dateDisplay = new Label(calendar.getValue().toString());\r\n dateDisplay.setTextFill(colour_font);\r\n dateDisplay.setFont(new Font(20));\r\n dateDisplay.setAlignment(Pos.TOP_CENTER);\r\n //When a date is selected, update our list of events in the below\r\n calendar.setOnAction(e ->{\r\n dateDisplay.setText(calendar.getValue().toString());\r\n this.displayEvents(calendar.getValue().atStartOfDay());\r\n });\r\n\r\n //Create the button to make events\r\n this.makeEventButton = new Button(\"Make Event\");\r\n makeEventButton.setScaleX(1.15);\r\n makeEventButton.setScaleY(1.15);\r\n makeEventButton.setTextFill(colour_font);\r\n makeEventButton.setOnAction(e -> {\r\n EventCreatorView ecv = new EventCreatorView(this);\r\n this.displayEvents(calendar.getValue().atStartOfDay());\r\n });\r\n\r\n //Create the button to make goals\r\n this.makeGoalButton = new Button(\"Make Goal\");\r\n makeGoalButton.setScaleX(1.15);\r\n makeGoalButton.setScaleY(1.15);\r\n makeGoalButton.setTextFill(colour_font);\r\n makeGoalButton.setOnAction(e -> {\r\n NewGoalView ngv = new NewGoalView(this);\r\n });\r\n\r\n //Create the button to view\r\n this.viewGoalButton = new Button(\"View Goal\");\r\n viewGoalButton.setScaleX(1.15);\r\n viewGoalButton.setScaleY(1.15);\r\n viewGoalButton.setTextFill(colour_font);\r\n viewGoalButton.setOnAction(e -> {\r\n GoalListView glv = new GoalListView(this);\r\n });\r\n\r\n //Create Button for changing the theme\r\n this.changeThemeButton = new Button(\"Change Theme\");\r\n changeThemeButton.setTextFill(colour_font);\r\n changeThemeButton.setScaleX(1.15);\r\n changeThemeButton.setScaleY(1.15);\r\n changeThemeButton.setOnAction(e -> {\r\n // Configure the Color\r\n FXMLLoader fxmlLoader = new FXMLLoader(CalendarView.class.getResource(\"ColorPick.fxml\"));\r\n Scene scene = null;\r\n try {\r\n// scene = new Scene(fxmlLoader.load());\r\n\r\n Parent root1 = (Parent) fxmlLoader.load(); // TODO: Error Source\r\n Stage stage = new Stage();\r\n// stage.initModality(Modality.APPLICATION_MODAL);\r\n// stage.initStyle(StageStyle.UNDECORATED);\r\n stage.setTitle(\"Chronos\");\r\n stage.setScene(new Scene(root1));\r\n stage.show();\r\n } catch (IOException ex) {\r\n throw new RuntimeException(ex);\r\n }\r\n Color.cv = this;\r\n });\r\n\r\n //Create button bar\r\n HBox buttons = new HBox(10);\r\n buttons.setPadding(new Insets(30));\r\n buttons.getChildren().addAll(makeEventButton, makeGoalButton, viewGoalButton, changeThemeButton);\r\n buttons.setPadding(new Insets(20));\r\n\r\n //Create buttons for editing and completing events\r\n this.editButton = new Button(\"Edit Event\");\r\n this.editButton.setTextFill(colour_font);\r\n editButton.setOnAction(e -> {\r\n if (this.eventsView.getSelectionModel().getSelectedItem() != null){\r\n\r\n for(Event i: this.events)\r\n {\r\n if(i.getName().equals(this.eventsView.getSelectionModel().getSelectedItem()))\r\n {\r\n EventEditorView editorView = new EventEditorView(this, i);\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n System.out.println(\"Need to select an item\");\r\n }\r\n });\r\n\r\n this.completeEventButton = new Button(\"Complete Event\");\r\n this.completeEventButton.setTextFill(colour_font);\r\n completeEventButton.setOnAction(e -> {\r\n String eventName = this.eventsView.getSelectionModel().getSelectedItem();\r\n if (eventName == null){\r\n return;\r\n }\r\n //int index = 0;\r\n Event completed = null;\r\n for (Event event: this.events){\r\n if (event.getName() == eventName){\r\n completed = event;\r\n completed.complete();\r\n break;\r\n }\r\n }\r\n if (!(completed == null)){\r\n this.events.remove(completed);\r\n this.model.getAllEvents().remove(completed);\r\n this.saveModel();\r\n }\r\n });\r\n\r\n //Create bar for editing and completing events\r\n HBox eventsManaging = new HBox();\r\n eventsManaging.getChildren().addAll(editButton, completeEventButton);\r\n eventsManaging.setPadding(new Insets(20));\r\n\r\n //Create view for events\r\n VBox eventDisplay = new VBox();\r\n eventDisplay.setPadding(new Insets(20));\r\n this.displayEvents(LocalDateTime.now());\r\n eventDisplay.getChildren().addAll(dateDisplay, eventsView, eventsManaging);\r\n\r\n\r\n //put everything together\r\n realLayout.setCenter(calendarLayout);\r\n realLayout.setBottom(buttons);\r\n realLayout.setRight(eventDisplay);\r\n realLayout.setBackground(new Background(new BackgroundFill(colour,null,null)));\r\n\r\n\r\n\r\n //Finally, display everything\r\n Scene scene = new Scene(realLayout);\r\n this.stage.setScene(scene);\r\n this.stage.show();\r\n\r\n }\r\n\r\n //Method to display events in the event list\r\n private void displayEvents(LocalDateTime time)\r\n {\r\n //Get events that match the date\r\n this.events = this.model.getEventsInTime(time);\r\n\r\n //Get their names\r\n ArrayList eventNames = new ArrayList<>();\r\n for (Event e: this.events){\r\n eventNames.add(e.getName());\r\n }\r\n\r\n //Set the ListView to contain those names\r\n ObservableList namesToDisplay = FXCollections.observableArrayList(eventNames);\r\n this.eventsView.setItems(namesToDisplay);\r\n }\r\n\r\n}\r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/views/CalendarView.java b/views/CalendarView.java +--- a/views/CalendarView.java (revision f2cf53451c55d8db395986bc1d2605377a89ff82) ++++ b/views/CalendarView.java (date 1670360126311) +@@ -1,7 +1,6 @@ + package views; + + import event.Event; +-import javafx.fxml.FXML; + import javafx.collections.FXCollections; + import javafx.collections.ObservableList; + import javafx.fxml.FXMLLoader; +@@ -10,22 +9,17 @@ + import javafx.scene.Node; + import javafx.scene.Parent; + import javafx.scene.Scene; +-import javafx.scene.control.*; + import javafx.scene.control.Button; + import javafx.scene.control.DatePicker; + import javafx.scene.control.Label; + import javafx.scene.control.ListView; + import javafx.scene.control.skin.DatePickerSkin; + import javafx.scene.paint.Paint; +-import javafx.scene.shape.Circle; + import javafx.scene.text.Font; +-import javafx.stage.Modality; + import javafx.scene.layout.*; + import javafx.stage.Stage; + import model.CalendarModel; + import observer.EventObserver; +-import javafx.scene.layout.*; +-import javafx.stage.StageStyle; + + + import java.io.*; +@@ -71,7 +65,7 @@ + Button completeEventButton; + + //Variables for getting the background and text color to change window theme +- static Paint colour = javafx.scene.paint.Color.valueOf("#FFFFFF") ;; ++ static Paint colour = javafx.scene.paint.Color.valueOf("#FFFFFF"); + static Paint colour_font = javafx.scene.paint.Color.valueOf("#000000") ; + + // ListView to display event names for a specific date +@@ -125,11 +119,7 @@ + CalendarModel.setCompletedGoals((ArrayList) loadList.get(2)); + CalendarView.colour = javafx.scene.paint.Color.valueOf(this.model.colour); + CalendarView.colour_font = javafx.scene.paint.Color.valueOf(this.model.colour_font); +- } catch (FileNotFoundException e) { +- throw new RuntimeException(e); +- } catch (IOException e) { +- throw new RuntimeException(e); +- } catch (ClassNotFoundException e) { ++ } catch (IOException | ClassNotFoundException e) { + throw new RuntimeException(e); + } + +@@ -153,8 +143,6 @@ + FileOutputStream fout = new FileOutputStream(fModel); + ObjectOutputStream oos = new ObjectOutputStream(fout); + oos.writeObject(saveList); +- } catch (FileNotFoundException e) { +- throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); + } +@@ -233,12 +221,8 @@ + FXMLLoader fxmlLoader = new FXMLLoader(CalendarView.class.getResource("ColorPick.fxml")); + Scene scene = null; + try { +-// scene = new Scene(fxmlLoader.load()); +- +- Parent root1 = (Parent) fxmlLoader.load(); // TODO: Error Source ++ Parent root1 = (Parent) fxmlLoader.load(); + Stage stage = new Stage(); +-// stage.initModality(Modality.APPLICATION_MODAL); +-// stage.initStyle(StageStyle.UNDECORATED); + stage.setTitle("Chronos"); + stage.setScene(new Scene(root1)); + stage.show(); diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_3_56_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_3_56_p_m___Changes_.xml new file mode 100644 index 0000000..5c41dd8 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_3_56_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_6_02_p_m__[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_6_02_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..e69de29 diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_6_02_p_m___Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_6_02_p_m___Changes_.xml new file mode 100644 index 0000000..811986a --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-06_6_02_p_m___Changes_.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..e0e7cfc --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "keyToString": { + "ASKED_ADD_EXTERNAL_FILES": "true", + "Downloaded.Files.Path.Enabled": "true", + "Git.Branch.Popup.ShowAllRemotes": "true", + "OverrideImplement.generate.javadoc": "true", + "Repository.Attach.Annotations": "false", + "Repository.Attach.JavaDocs": "true", + "Repository.Attach.Sources": "true", + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "SHARE_PROJECT_CONFIGURATION_FILES": "true", + "com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary": "JUnit5", + "com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit5": "", + "create.test.in.the.same.root": "true", + "last_opened_file_path": "C:/Program Files/Java/javafx-sdk-19/lib/javafx.web.jar", + "project.structure.last.edited": "Libraries", + "project.structure.proportion": "0.15", + "project.structure.side.proportion": "0.2" + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1670196080350 + + + 1670196204060 + + + 1670206682055 + + + 1670206705213 + + + 1670207851422 + + + 1670208160992 + + + 1670208221179 + + + 1670271801156 + + + 1670293721600 + + + 1670294233740 + + + 1670294261598 + + + 1670294270682 + + + 1670296532056 + + + 1670296634352 + + + 1670298185503 + + + 1670298414800 + + + 1670300088349 + + + 1670300193277 + + + 1670300361479 + + + 1670301402985 + + + 1670301546025 + + + 1670301613680 + + + 1670301687358 + + + 1670357759550 + + + 1670357974075 + + + 1670358230141 + + + 1670358811724 + + + 1670358989758 + + + 1670359664365 + + + 1670360201072 + + + 1670360314822 + + + + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..fecc75b --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m__[Changes]/shelved.patch @@ -0,0 +1,190 @@ +Index: out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: .idea/libraries/javafx.xml +=================================================================== +diff --git a/.idea/libraries/javafx.xml b/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/.idea/libraries/javafx.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/libraries/javafx.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx.xml b/out/production/The-Hamburglars/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/ColorPick.fxml +=================================================================== +diff --git a/out/production/The-Hamburglars/ColorPick.fxml b/out/production/The-Hamburglars/ColorPick.fxml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/ColorPick.fxml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,12 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +Index: .idea/libraries/javafx_swt.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/libraries/javafx_swt.xml b/.idea/libraries/javafx_swt.xml +new file mode 100644 +--- /dev/null (date 1670196052751) ++++ b/.idea/libraries/javafx_swt.xml (date 1670196052751) +@@ -0,0 +1,16 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: out/production/The-Hamburglars/The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/The-Hamburglars.iml b/out/production/The-Hamburglars/The-Hamburglars.iml +--- a/out/production/The-Hamburglars/The-Hamburglars.iml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ b/out/production/The-Hamburglars/The-Hamburglars.iml (date 1670196179110) +@@ -7,6 +7,23 @@ + + + +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + +\ No newline at end of file +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ b/The-Hamburglars.iml (date 1670196179449) +@@ -7,6 +7,23 @@ + + + +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + +\ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m___Changes_.xml new file mode 100644 index 0000000..d7e7aab --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_48_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..7b3b71d --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]/shelved.patch @@ -0,0 +1,25 @@ +Index: .idea/libraries/javafx_graphics.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +=================================================================== +diff --git a/.idea/libraries/javafx_graphics.xml b/.idea/libraries/javafx_graphics.xml +--- a/.idea/libraries/javafx_graphics.xml ++++ b/.idea/libraries/javafx_graphics.xml +@@ -1,15 +1,6 @@ + + +- +- +- +- +- +- +- +- +- +- ++ + + + diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]1/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]1/shelved.patch new file mode 100644 index 0000000..df9f237 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m__[Changes]1/shelved.patch @@ -0,0 +1,139 @@ +Index: out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: .idea/libraries/javafx.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/libraries/javafx.xml b/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/.idea/libraries/javafx.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/libraries/javafx.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx.xml b/out/production/The-Hamburglars/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/ColorPick.fxml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/ColorPick.fxml b/out/production/The-Hamburglars/ColorPick.fxml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/ColorPick.fxml ++++ /dev/null +@@ -1,12 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +Index: .idea/libraries/javafx_swt.xml +=================================================================== +diff --git a/.idea/libraries/javafx_swt.xml b/.idea/libraries/javafx_swt.xml +new file mode 100644 +--- /dev/null ++++ b/.idea/libraries/javafx_swt.xml +@@ -0,0 +1,16 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml ++++ b/The-Hamburglars.iml +@@ -9,5 +9,6 @@ + + + ++ + + +\ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_.xml new file mode 100644 index 0000000..4a98c89 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_1.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_1.xml new file mode 100644 index 0000000..3563947 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_7_50_p_m___Changes_1.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model.ser b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..b3743cd7a09bb06f4db22b048f1ea78f6d01d614 GIT binary patch literal 577 zcmZuuJxfC|6uoU<)!G(85fSMk;^6QeI0>Dq6|Fo)s5mJS`(llx$umjYr-C5(7aSb? z2f8>qIJk6h>*V6xxjfAOt$_iB!=^ zJ9pkf7YT@!z>(w-Mm#Opq%F&x zH{9uBadK$jZ6Xd%3Hn1$m|91)jPHD|`Vd85u#dJG literal 0 HcmV?d00001 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model1.ser b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/model1.ser new file mode 100644 index 0000000000000000000000000000000000000000..b3743cd7a09bb06f4db22b048f1ea78f6d01d614 GIT binary patch literal 577 zcmZuuJxfC|6uoU<)!G(85fSMk;^6QeI0>Dq6|Fo)s5mJS`(llx$umjYr-C5(7aSb? z2f8>qIJk6h>*V6xxjfAOt$_iB!=^ zJ9pkf7YT@!z>(w-Mm#Opq%F&x zH{9uBadK$jZ6Xd%3Hn1$m|91)jPHD|`Vd85u#dJG literal 0 HcmV?d00001 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..cbfa1df --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]/shelved.patch @@ -0,0 +1,35 @@ +Index: out/production/The-Hamburglars/ColorPick.fxml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n +=================================================================== +diff --git a/out/production/The-Hamburglars/ColorPick.fxml b/out/production/The-Hamburglars/ColorPick.fxml +--- a/out/production/The-Hamburglars/ColorPick.fxml ++++ b/out/production/The-Hamburglars/ColorPick.fxml +@@ -3,10 +3,20 @@ + + + ++ + +- ++ + +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/model.ser b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..b3743cd7a09bb06f4db22b048f1ea78f6d01d614 GIT binary patch literal 577 zcmZuuJxfC|6uoU<)!G(85fSMk;^6QeI0>Dq6|Fo)s5mJS`(llx$umjYr-C5(7aSb? z2f8>qIJk6h>*V6xxjfAOt$_iB!=^ zJ9pkf7YT@!z>(w-Mm#Opq%F&x zH{9uBadK$jZ6Xd%3Hn1$m|91)jPHD|`Vd85u#dJG literal 0 HcmV?d00001 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/shelved.patch new file mode 100644 index 0000000..7d7a382 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m__[Changes]1/shelved.patch @@ -0,0 +1,63 @@ +Index: out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/libraries/javafx_swt.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_swt.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_swt.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_swt.xml ++++ /dev/null +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/.gitignore +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+># Default ignored files\r\n/shelf/\r\n/workspace.xml\r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/.gitignore b/out/production/The-Hamburglars/.idea/.gitignore +--- a/out/production/The-Hamburglars/.idea/.gitignore ++++ b/out/production/The-Hamburglars/.idea/.gitignore +@@ -1,3 +1,4 @@ + # Default ignored files + /shelf/ + /workspace.xml ++/save/model.ser diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_.xml new file mode 100644 index 0000000..7a0c208 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_1.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_1.xml new file mode 100644 index 0000000..ed7efac --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_37_p_m___Changes_1.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/model.ser b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..93907df76c333700b404836af1e7f6f39657896b GIT binary patch literal 253 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osma2ZsX enVF;{8KmmR1Zh0t~?JW2hi3Pyqnd?nmGN literal 0 HcmV?d00001 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..e69de29 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m___Changes_.xml new file mode 100644 index 0000000..cfdb292 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-04_9_42_p_m___Changes_.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..d94b05f --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]/shelved.patch @@ -0,0 +1,38 @@ +Index: event/EventTest.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package event;\r\n\r\nimport org.junit.jupiter.api.Test;\r\n\r\n\r\n/**\r\n * A Unit Test Class for Event.java.\r\n */\r\nclass EventTest {\r\n /**\r\n * A Unit Test for Event.complete().\r\n */\r\n @Test\r\n void complete() {\r\n\r\n }\r\n} +=================================================================== +diff --git a/event/EventTest.java b/event/EventTest.java +--- a/event/EventTest.java ++++ b/event/EventTest.java +@@ -1,6 +1,11 @@ + package event; + + import org.junit.jupiter.api.Test; ++import static org.junit.jupiter.api.Assertions.*; ++ ++import java.time.LocalDateTime; ++ ++import timeBehaviour.TimePoint; + + + /** +@@ -11,7 +16,15 @@ + * A Unit Test for Event.complete(). + */ + @Test +- void complete() { ++ void completeTest() { ++ Event e = new Event("Event1", "testing", 100, new TimePoint(LocalDateTime.now())); ++ ++ assertEquals(0, Event.getObserverList().size()); ++ assert(Event.getObserverList().contains(e)); + ++ e.complete(); ++ ++ assertEquals(0, Event.getObserverList().size()); ++ assertFalse(Event.getObserverList().contains(e)); + } + } +\ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]1/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m__[Changes]1/shelved.patch new file mode 100644 index 0000000..e69de29 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m___Changes_.xml new file mode 100644 index 0000000..29891a2 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Checkout_at_2022-12-06_3_35_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model.ser b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..133c0dba5d6e4fd1be935dd19417b612af5b943c GIT binary patch literal 229 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osT!6oZt4 M0oWZ36@&#U0O?~wBLDyZ literal 0 HcmV?d00001 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model1.ser b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/model1.ser new file mode 100644 index 0000000000000000000000000000000000000000..133c0dba5d6e4fd1be935dd19417b612af5b943c GIT binary patch literal 229 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osT!6oZt4 M0oWZ36@&#U0O?~wBLDyZ literal 0 HcmV?d00001 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..b1a7d3d --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m__[Changes]/shelved.patch @@ -0,0 +1,76 @@ +Index: event/EventTest.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/event/EventTest.java b/event/EventTest.java +new file mode 100644 +--- /dev/null (date 1670274282284) ++++ b/event/EventTest.java (date 1670274282284) +@@ -0,0 +1,16 @@ ++package event; ++ ++import org.junit.jupiter.api.Test; ++ ++ ++class EventTest { ++ ++ @Test ++ void complete() { ++ ++ } ++ ++ @Test ++ void addGoal() { ++ } ++} +\ No newline at end of file +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml (revision f96259081562f4e298ef9693cadbfae3e5efc41f) ++++ b/The-Hamburglars.iml (date 1670274282536) +@@ -8,5 +8,37 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + +\ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m___Changes_.xml new file mode 100644 index 0000000..eb98c2e --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Merge_at_2022-12-05_8_36_p_m___Changes_.xml @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..a2145ee --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m__[Changes]/shelved.patch @@ -0,0 +1,149 @@ +Index: out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml b/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx_web.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: .idea/libraries/javafx.xml +=================================================================== +diff --git a/.idea/libraries/javafx.xml b/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/.idea/libraries/javafx.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: out/production/The-Hamburglars/.idea/libraries/javafx.xml +=================================================================== +diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx.xml b/out/production/The-Hamburglars/.idea/libraries/javafx.xml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/.idea/libraries/javafx.xml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ /dev/null (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) +@@ -1,16 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +Index: .idea/libraries/javafx_swt.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/libraries/javafx_swt.xml b/.idea/libraries/javafx_swt.xml +new file mode 100644 +--- /dev/null (date 1670201469353) ++++ b/.idea/libraries/javafx_swt.xml (date 1670201469353) +@@ -0,0 +1,16 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/.name +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/.name b/.idea/.name +new file mode 100644 +--- /dev/null (date 1670196159872) ++++ b/.idea/.name (date 1670196159872) +@@ -0,0 +1,1 @@ ++CalendarView.java +\ No newline at end of file +Index: out/production/The-Hamburglars/The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/The-Hamburglars.iml b/out/production/The-Hamburglars/The-Hamburglars.iml +--- a/out/production/The-Hamburglars/The-Hamburglars.iml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ b/out/production/The-Hamburglars/The-Hamburglars.iml (date 1670201469330) +@@ -7,6 +7,6 @@ + + + +- ++ + + +\ No newline at end of file +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml (revision 89597aef84464d73e7e456bf0ef497a46ecde8ec) ++++ b/The-Hamburglars.iml (date 1670201469330) +@@ -7,6 +7,6 @@ + + + +- ++ + + +\ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m___Changes_.xml new file mode 100644 index 0000000..fd96a6d --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-04_9_18_p_m___Changes_.xml @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..025e1f2 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m__[Changes]/shelved.patch @@ -0,0 +1,36 @@ +Index: out/production/The-Hamburglars/ColorPick.fxml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/out/production/The-Hamburglars/ColorPick.fxml b/out/production/The-Hamburglars/ColorPick.fxml +deleted file mode 100644 +--- a/out/production/The-Hamburglars/ColorPick.fxml (revision cda9a00f1c13d03ac9c0a7285973d8ab40aab48b) ++++ /dev/null (revision cda9a00f1c13d03ac9c0a7285973d8ab40aab48b) +@@ -1,22 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +\ No newline at end of file +diff --git a/ColorPick.fxml b/views/ColorPick.fxml +rename from ColorPick.fxml +rename to views/ColorPick.fxml diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m___Changes_.xml new file mode 100644 index 0000000..79392da --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_3_19_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model.ser b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..133c0dba5d6e4fd1be935dd19417b612af5b943c GIT binary patch literal 229 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osT!6oZt4 M0oWZ36@&#U0O?~wBLDyZ literal 0 HcmV?d00001 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model1.ser b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/model1.ser new file mode 100644 index 0000000000000000000000000000000000000000..133c0dba5d6e4fd1be935dd19417b612af5b943c GIT binary patch literal 229 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osT!6oZt4 M0oWZ36@&#U0O?~wBLDyZ literal 0 HcmV?d00001 diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..9a00715 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m__[Changes]/shelved.patch @@ -0,0 +1,140 @@ +Index: views/EventCreatorView.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package views;\r\n\r\n\r\nimport event.Event;\r\n\r\n\r\nimport javafx.geometry.Insets;\r\nimport javafx.scene.Scene;\r\nimport javafx.scene.control.Button;\r\nimport javafx.scene.control.DatePicker;\r\nimport javafx.scene.control.Label;\r\nimport javafx.scene.control.TextField;\r\nimport javafx.scene.layout.VBox;\r\nimport javafx.scene.text.Font;\r\nimport javafx.stage.Modality;\r\nimport javafx.stage.Stage;\r\n\r\nimport model.CalendarModel;\r\nimport timeBehaviour.TimeBehaviour;\r\nimport timeBehaviour.TimePoint;\r\nimport timeBehaviour.TimeRange;\r\n\r\nimport java.awt.*;\r\nimport java.time.LocalDate;\r\nimport java.time.LocalDateTime;\r\nimport java.time.format.DateTimeFormatter;\r\nimport java.time.LocalDate;\r\n\r\nimport java.util.regex.Matcher;\r\nimport java.util.regex.Pattern;\r\n\r\n\r\npublic class EventCreatorView {\r\n\r\n CalendarView calendarView;\r\n\r\n// CalendarModel calendarModel;\r\n private Label createEventLabel = new Label(\"Create a new event!\");\r\n private TextField nameTextField = new TextField(\"Name\");\r\n private TextField pointsTextField = new TextField(\"Points\");\r\n private TextField descTextField = new TextField(\"Description\");\r\n private Button changeTimeButton = new Button(\"Choose start/end time\");\r\n private DatePicker pointDatePicker = new DatePicker(LocalDate.now());\r\n private TextField pointTimePicker = new TextField(\"Time (hh:mm)\");\r\n private DatePicker startDatePicker = new DatePicker(LocalDate.now());\r\n private TextField startTimePicker = new TextField(\"Start time (hh:mm)\");\r\n private DatePicker endDatePicker = new DatePicker(LocalDate.now());\r\n private TextField endTimePicker = new TextField(\"End time (hh:mm)\");\r\n private Button saveButton = new Button(\"Save Event\");\r\n private Label errorLabel = new Label(\"\");\r\n\r\n private Paint colour;\r\n\r\n\r\n /**\r\n * Constructor\r\n *\r\n * @param calendarView the application's CalendarView\r\n */\r\n public EventCreatorView(CalendarView calendarView) {\r\n this.calendarView = calendarView;\r\n\r\n// this.calendarModel = this.calendarView.model;\r\n\r\n final Stage dialog = new Stage();\r\n dialog.initModality(Modality.APPLICATION_MODAL);\r\n dialog.initOwner(calendarView.stage);\r\n VBox dialogVbox = new VBox(20);\r\n dialogVbox.setPadding(new Insets(20, 20, 20, 20));\r\n\r\n Font f = new Font(16);\r\n createEventLabel.setFont(f);\r\n nameTextField.setFont(f);\r\n pointsTextField.setFont(f);\r\n descTextField.setFont(f);\r\n changeTimeButton.setFont(f);\r\n pointTimePicker.setFont(f);\r\n startTimePicker.setFont(f);\r\n endTimePicker.setFont(f);\r\n saveButton.setFont(f);\r\n\r\n saveButton.setOnAction(e -> createEvent());\r\n\r\n VBox vbox = new VBox(10, createEventLabel, nameTextField, pointsTextField, descTextField, changeTimeButton, pointDatePicker, pointTimePicker, saveButton, errorLabel);\r\n dialogVbox.getChildren().add(vbox);\r\n Scene scene = new Scene(dialogVbox, 400, 500);\r\n dialog.setScene(scene);\r\n dialog.show();\r\n dialog.setAlwaysOnTop(true);\r\n\r\n changeTimeButton.setOnAction(e -> {\r\n if (vbox.getChildren().contains(pointDatePicker)) {\r\n vbox.getChildren().remove(pointDatePicker);\r\n vbox.getChildren().remove(pointTimePicker);\r\n vbox.getChildren().remove(saveButton);\r\n vbox.getChildren().remove(errorLabel);\r\n pointDatePicker.setValue(LocalDate.now());\r\n pointTimePicker.setText(\"Time (hh:mm)\");\r\n changeTimeButton.setText(\"Choose single time\");\r\n vbox.getChildren().add(startDatePicker);\r\n vbox.getChildren().add(startTimePicker);\r\n vbox.getChildren().add(endDatePicker);\r\n vbox.getChildren().add(endTimePicker);\r\n } else {\r\n vbox.getChildren().remove(startDatePicker);\r\n vbox.getChildren().remove(startTimePicker);\r\n vbox.getChildren().remove(endDatePicker);\r\n vbox.getChildren().remove(endTimePicker);\r\n vbox.getChildren().remove(saveButton);\r\n vbox.getChildren().remove(errorLabel);\r\n startDatePicker.setValue(LocalDate.now());\r\n startTimePicker.setText(\"Start time (hh:mm)\");\r\n endDatePicker.setValue(LocalDate.now());\r\n endTimePicker.setText(\"End time (hh:mm)\");\r\n changeTimeButton.setText(\"Choose start/end time\");\r\n vbox.getChildren().add(pointDatePicker);\r\n vbox.getChildren().add(pointTimePicker);\r\n }\r\n vbox.getChildren().add(saveButton);\r\n vbox.getChildren().add(errorLabel);\r\n\r\n });\r\n\r\n }\r\n\r\n /**\r\n * Create a new Event using the parameters given in the text fields and date pickers.\r\n * Store this new Event in the CalendarModel's list of Events.\r\n */\r\n private void createEvent() throws NumberFormatException {\r\n\r\n // Check if the Event's Name is not empty.\r\n if (this.nameTextField.getText().trim().isEmpty() || this.nameTextField.getText().trim().isBlank()) {\r\n this.errorLabel.setText(\"Please enter the Event Name. It can NOT be Blank!\");\r\n return;\r\n }\r\n else\r\n {\r\n String temp = this.nameTextField.getText().trim();\r\n for(Event i: this.calendarView.model.getAllEvents())\r\n {\r\n if (temp.equals(i.getName()))\r\n {\r\n this.errorLabel.setText(\"Event Name already taken!\");\r\n return;\r\n }\r\n }\r\n }\r\n String event_name = this.nameTextField.getText().trim();\r\n\r\n // Check if the Event's Description is not empty.\r\n if (this.descTextField.getText().trim().isEmpty() || this.descTextField.getText().trim().isBlank()) {\r\n this.errorLabel.setText(\"Please enter the Event's Description. It can NOT be Blank!\");\r\n return;\r\n }\r\n String event_description = this.descTextField.getText().trim();\r\n\r\n\r\n String points = String.valueOf(this.pointsTextField.getText()).trim();\r\n int event_points = 0;\r\n // Check if the Event's associated Points are of integer type.\r\n try {\r\n event_points += Integer.parseInt(points);\r\n } catch (NumberFormatException e) {\r\n this.errorLabel.setText(\"Please enter a Integer value for the points associated with the event.\");\r\n return;\r\n }\r\n\r\n\r\n //Check the type of the time and create time range or time point based on that.\r\n if (this.endTimePicker.getText().trim().isBlank() || this.endTimePicker.getText().trim().isEmpty() || this.startTimePicker.getText().trim().equals(\"Start time (hh:mm)\") || this.endTimePicker.getText().trim().equals(\"End time (hh:mm)\")) {\r\n // Create a new Time Point object based on the deadline of the user.\r\n\r\n String deadline_hours = this.pointTimePicker.getText().trim();\r\n\r\n Pattern pattern = Pattern.compile(\"^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\");\r\n Matcher matcher = pattern.matcher(deadline_hours);\r\n if (matcher.find()) {\r\n // match found, valid deadline HH:mm.\r\n String yyyy_mm_dd = this.pointDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n\r\n // TODO: Consider the case of the where the deadline is a past date.\r\n\r\n String yyyy_mm_dd_HH_mm = yyyy_mm_dd + \" \" + deadline_hours;\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime pointTime = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter);\r\n\r\n\r\n // Create a TimePoint object.\r\n TimeBehaviour tp = new TimePoint(pointTime);\r\n\r\n // Finally, create a new Event with the new TimePoint deadline time of the event.\r\n Event e = new Event(event_name, event_description, event_points, tp);\r\n\r\n\r\n // Add the event to the events list of CalendarView.model.events\r\n this.calendarView.model.addEvent(e);\r\n\r\n this.calendarView.saveModel();\r\n //Success Message!\r\n this.errorLabel.setText(\"Event Added to the Calendar!\");\r\n\r\n }\r\n else\r\n {\r\n // Invalid Format of HH:mm\r\n this.errorLabel.setText(\"Please Re-enter the time of the event. Enter in HH:mm format.\");\r\n return;\r\n }\r\n } else {\r\n // Create a new Time Range object based on the start-time and end-time of the user.\r\n\r\n\r\n String start_time = this.startTimePicker.getText().trim();\r\n String end_time = this.endTimePicker.getText().trim();\r\n\r\n\r\n Pattern pattern = Pattern.compile(\"^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\");\r\n\r\n Matcher matcher = pattern.matcher(start_time);\r\n Matcher matcher1 = pattern.matcher(end_time);\r\n\r\n if (matcher1.find() && matcher.find()) {\r\n // match found, valid deadline HH:mm.\r\n String yyyy_mm_dd = this.startDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n String yyyy_mm_dd2 = this.endDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n\r\n // TODO: Consider the case of the where the deadline is a past date.\r\n\r\n String yyyy_mm_dd_HH_mm = yyyy_mm_dd + \" \" + start_time;\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime start_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter);\r\n\r\n String yyyy_mm_dd_HH_mm2 = yyyy_mm_dd2 + \" \" + end_time;\r\n DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime end_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm2, formatter2);\r\n\r\n System.out.println(start_time_block + \" \" + end_time_block);\r\n\r\n\r\n // Create a TimeRange object.\r\n TimeBehaviour tr = new TimeRange(start_time_block, end_time_block);\r\n\r\n // Finally, create a new Event with the new TimeRange start and end time of the event block.\r\n Event e = new Event(event_name, event_description, event_points, tr);\r\n\r\n\r\n // Add the event to the events list of CalendarView.model.events\r\n this.calendarView.model.addEvent(e);\r\n\r\n this.calendarView.saveModel();\r\n\r\n //Success Message!\r\n this.errorLabel.setText(\"Event Added to the Calendar!\");\r\n } else {\r\n // Invalid Format of HH:mm\r\n this.errorLabel.setText(\"Invalid Start/End time of the event. Enter in HH:mm format.\");\r\n return;\r\n }\r\n\r\n }\r\n }\r\n}\r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/views/EventCreatorView.java b/views/EventCreatorView.java +--- a/views/EventCreatorView.java (revision e720e387022c58cd8397f2300c98470cc5c02a6b) ++++ b/views/EventCreatorView.java (date 1670290635499) +@@ -34,7 +34,6 @@ + + CalendarView calendarView; + +-// CalendarModel calendarModel; + private Label createEventLabel = new Label("Create a new event!"); + private TextField nameTextField = new TextField("Name"); + private TextField pointsTextField = new TextField("Points"); +Index: views/EventEditorView.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package views;\r\n\r\nimport event.Event;\r\nimport javafx.geometry.Insets;\r\nimport javafx.scene.Scene;\r\nimport javafx.scene.control.Button;\r\nimport javafx.scene.control.DatePicker;\r\nimport javafx.scene.control.Label;\r\nimport javafx.scene.control.TextField;\r\nimport javafx.scene.layout.VBox;\r\nimport javafx.scene.text.Font;\r\nimport javafx.stage.Modality;\r\nimport javafx.stage.Stage;\r\nimport timeBehaviour.TimeBehaviour;\r\nimport timeBehaviour.TimePoint;\r\nimport timeBehaviour.TimeRange;\r\n\r\nimport java.time.LocalDate;\r\nimport java.time.LocalDateTime;\r\nimport java.time.format.DateTimeFormatter;\r\nimport java.util.regex.Matcher;\r\nimport java.util.regex.Pattern;\r\n\r\npublic class EventEditorView {\r\n\r\n private CalendarView calendarView;\r\n private Event event;\r\n\r\n private Label editEventLabel = new Label(\"\");\r\n\r\n// private Button completeButton = new Button(\"Complete!\");\r\n private TextField nameTextField = new TextField(\"\");\r\n private TextField pointsTextField = new TextField(\"\");\r\n private TextField descTextField = new TextField(\"\");\r\n private Button changeTimeButton = new Button(\"Choose start/end time\");\r\n private DatePicker pointDatePicker = new DatePicker(LocalDate.now());\r\n private TextField pointTimePicker = new TextField(\"Time (hh:mm)\");\r\n private DatePicker startDatePicker = new DatePicker(LocalDate.now());\r\n private TextField startTimePicker = new TextField(\"Start time (hh:mm)\");\r\n private DatePicker endDatePicker = new DatePicker(LocalDate.now());\r\n private TextField endTimePicker = new TextField(\"End time (hh:mm)\");\r\n private Button saveButton = new Button(\"Save Changes\");\r\n private Label errorLabel = new Label(\"\");\r\n\r\n /**\r\n * Constructor\r\n *\r\n * @param calendarView the application's CalendarView\r\n */\r\n public EventEditorView(CalendarView calendarView, Event event) {\r\n this.calendarView = calendarView;\r\n this.event = event;\r\n\r\n final Stage dialog = new Stage();\r\n dialog.initModality(Modality.APPLICATION_MODAL);\r\n dialog.initOwner(calendarView.stage);\r\n VBox dialogVbox = new VBox(20);\r\n dialogVbox.setPadding(new Insets(20, 20, 20, 20));\r\n\r\n Font f = new Font(16);\r\n editEventLabel.setFont(f);\r\n nameTextField.setFont(f);\r\n pointsTextField.setFont(f);\r\n descTextField.setFont(f);\r\n changeTimeButton.setFont(f);\r\n pointTimePicker.setFont(f);\r\n startTimePicker.setFont(f);\r\n endTimePicker.setFont(f);\r\n saveButton.setFont(f);\r\n errorLabel.setFont(f);\r\n\r\n VBox vbox = new VBox(10, editEventLabel, nameTextField, pointsTextField, descTextField, changeTimeButton, pointDatePicker, pointTimePicker, saveButton, errorLabel);\r\n dialogVbox.getChildren().add(vbox);\r\n Scene scene = new Scene(dialogVbox, 400, 500);\r\n dialog.setScene(scene);\r\n dialog.show();\r\n dialog.setAlwaysOnTop(true);\r\n\r\n saveButton.setOnAction(e -> editEvent());\r\n\r\n changeTimeButton.setOnAction(e -> changeTime(vbox));\r\n\r\n editEventLabel.setText(\"Edit Event: \" + event.getName());\r\n nameTextField.setText(event.getName());\r\n pointsTextField.setText(String.valueOf(event.getPointValue()));\r\n descTextField.setText(event.getDescription());\r\n\r\n\r\n //If event has a time point:\r\n if(event.getTimeBehaviour() instanceof TimePoint)\r\n {\r\n TimePoint tp = (TimePoint) event.getTimeBehaviour();\r\n\r\n //set values of pointDatePicker and pointTimePicker to event's time\r\n this.pointDatePicker.setValue(tp.getTime().toLocalDate());\r\n this.pointTimePicker.setText(tp.getTime().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\")).substring(11,16));\r\n }\r\n\r\n\r\n //If event has a time range:\r\n else {\r\n changeTime(vbox);\r\n\r\n //set values of startDatePicker, startTimePicker, endDatePicker and endTimePicker\r\n TimeRange tr = (TimeRange) event.getTimeBehaviour();\r\n\r\n this.startDatePicker.setValue(tr.getStartTime().toLocalDate());\r\n this.endDatePicker.setValue(tr.getEndTime().toLocalDate());\r\n\r\n this.startTimePicker.setText(tr.getStartTime().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\")).substring(11,16));\r\n this.endTimePicker.setText(tr.getEndTime().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\")).substring(11,16));\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Edit the details of the event and save accordingly.\r\n */\r\n private void editEvent() {\r\n\r\n // Check if the Event's Name is not empty.\r\n if (this.nameTextField.getText().trim().isEmpty() || this.nameTextField.getText().trim().isBlank()) {\r\n this.errorLabel.setText(\"Please enter the Event Name. It can NOT be Blank!\");\r\n return;\r\n }\r\n // Check if the event name is already in the events list.\r\n else\r\n {\r\n String temp = this.nameTextField.getText().trim();\r\n for(Event i: this.calendarView.model.getAllEvents())\r\n {\r\n if (temp.equals(i.getName()))\r\n {\r\n this.errorLabel.setText(\"Event Name already taken!\");\r\n return;\r\n }\r\n }\r\n }\r\n this.event.setName(this.nameTextField.getText().trim());\r\n\r\n\r\n // Check if the Event's Description is not empty.\r\n if (this.descTextField.getText().trim().isEmpty() || this.descTextField.getText().trim().isBlank()) {\r\n this.errorLabel.setText(\"Please enter the Event's Description. It can NOT be Blank!\");\r\n return;\r\n }\r\n this.event.setDescription(this.descTextField.getText().trim());\r\n\r\n\r\n String points = String.valueOf(this.pointsTextField.getText()).trim();\r\n int event_points = 0;\r\n // Check if the Event's associated Points are of integer type.\r\n try {\r\n event_points += Integer.parseInt(points);\r\n } catch (NumberFormatException e) {\r\n this.errorLabel.setText(\"Please enter a Integer value for the points associated with the event.\");\r\n return;\r\n }\r\n this.event.setPointValue(event_points);\r\n\r\n\r\n\r\n\r\n if (this.endTimePicker.getText().trim().isBlank() || this.endTimePicker.getText().trim().isEmpty() || this.startTimePicker.getText().trim().equals(\"Start time (hh:mm)\") || this.endTimePicker.getText().trim().equals(\"End time (hh:mm)\")) {\r\n // Create a new Time Point object based on the deadline of the user.\r\n\r\n String deadline_hours = this.pointTimePicker.getText().trim();\r\n\r\n Pattern pattern = Pattern.compile(\"^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\");\r\n Matcher matcher = pattern.matcher(deadline_hours);\r\n if (matcher.find()) {\r\n // match found, valid deadline HH:mm.\r\n String yyyy_mm_dd = this.pointDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n\r\n // TODO: Consider the case of the where the deadline is a past date.\r\n\r\n String yyyy_mm_dd_HH_mm = yyyy_mm_dd + \" \" + deadline_hours;\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime pointTime = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter);\r\n\r\n\r\n // Create a TimePoint object.\r\n TimeBehaviour tp = new TimePoint(pointTime);\r\n\r\n this.event.setTimeBehaviour(tp);\r\n\r\n// this.calendarView.saveModel();\r\n\r\n //Success Message!\r\n this.errorLabel.setText(\"Event Added to the Calendar!\");\r\n this.calendarView.saveModel();\r\n } else {\r\n // Invalid Format of HH:mm\r\n this.errorLabel.setText(\"Please Re-enter the time of the event. Enter in HH:mm format.\");\r\n return;\r\n }\r\n } else {\r\n // Create a new Time Range object based on the start-time and end-time of the user.\r\n\r\n String start_time = this.startTimePicker.getText().trim();\r\n String end_time = this.endTimePicker.getText().trim();\r\n\r\n\r\n Pattern pattern = Pattern.compile(\"^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\");\r\n\r\n Matcher matcher = pattern.matcher(start_time);\r\n Matcher matcher1 = pattern.matcher(end_time);\r\n\r\n if (matcher1.find() && matcher.find()) {\r\n // match found, valid deadline HH:mm.\r\n String yyyy_mm_dd = this.startDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n String yyyy_mm_dd2 = this.endDatePicker.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\r\n\r\n // TODO: Consider the case of the where the deadline is a past date.\r\n\r\n String yyyy_mm_dd_HH_mm = yyyy_mm_dd + \" \" + start_time;\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime start_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter);\r\n\r\n String yyyy_mm_dd_HH_mm2 = yyyy_mm_dd2 + \" \" + end_time;\r\n DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\r\n LocalDateTime end_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm2, formatter2);\r\n\r\n System.out.println(start_time_block + \" \" + end_time_block);\r\n\r\n\r\n // Create a TimeRange object.\r\n TimeBehaviour tr = new TimeRange(start_time_block, end_time_block);\r\n\r\n this.event.setTimeBehaviour(tr);\r\n// this.calendarView.saveModel();\r\n\r\n //Success Message!\r\n this.errorLabel.setText(\"Event Added to the Calendar!\");\r\n\r\n this.calendarView.saveModel();\r\n } else {\r\n // Invalid Format of HH:mm\r\n this.errorLabel.setText(\"Invalid Start/End time of the event. Enter in HH:mm format.\");\r\n return;\r\n }\r\n\r\n }\r\n }\r\n\r\n /**\r\n * Switches between displaying input for time points/time ranges\r\n *\r\n * @param vbox\r\n */\r\n private void changeTime(VBox vbox) {\r\n {\r\n if (vbox.getChildren().contains(pointDatePicker)) {\r\n vbox.getChildren().remove(pointDatePicker);\r\n vbox.getChildren().remove(pointTimePicker);\r\n vbox.getChildren().remove(saveButton);\r\n vbox.getChildren().remove(errorLabel);\r\n pointDatePicker.setValue(LocalDate.now());\r\n pointTimePicker.setText(\"Time (hh:mm)\");\r\n changeTimeButton.setText(\"Choose single time\");\r\n vbox.getChildren().add(startDatePicker);\r\n vbox.getChildren().add(startTimePicker);\r\n vbox.getChildren().add(endDatePicker);\r\n vbox.getChildren().add(endTimePicker);\r\n } else {\r\n vbox.getChildren().remove(startDatePicker);\r\n vbox.getChildren().remove(startTimePicker);\r\n vbox.getChildren().remove(endDatePicker);\r\n vbox.getChildren().remove(endTimePicker);\r\n vbox.getChildren().remove(saveButton);\r\n vbox.getChildren().remove(errorLabel);\r\n startDatePicker.setValue(LocalDate.now());\r\n startTimePicker.setText(\"Start time (hh:mm)\");\r\n endDatePicker.setValue(LocalDate.now());\r\n endTimePicker.setText(\"End time (hh:mm)\");\r\n changeTimeButton.setText(\"Choose start/end time\");\r\n vbox.getChildren().add(pointDatePicker);\r\n vbox.getChildren().add(pointTimePicker);\r\n }\r\n vbox.getChildren().add(saveButton);\r\n vbox.getChildren().add(errorLabel);\r\n }\r\n }\r\n}\r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/views/EventEditorView.java b/views/EventEditorView.java +--- a/views/EventEditorView.java (revision e720e387022c58cd8397f2300c98470cc5c02a6b) ++++ b/views/EventEditorView.java (date 1670290676360) +@@ -1,6 +1,7 @@ + package views; + + import event.Event; ++ + import javafx.geometry.Insets; + import javafx.scene.Scene; + import javafx.scene.control.Button; +@@ -11,6 +12,7 @@ + import javafx.scene.text.Font; + import javafx.stage.Modality; + import javafx.stage.Stage; ++ + import timeBehaviour.TimeBehaviour; + import timeBehaviour.TimePoint; + import timeBehaviour.TimeRange; +@@ -18,9 +20,11 @@ + import java.time.LocalDate; + import java.time.LocalDateTime; + import java.time.format.DateTimeFormatter; ++ + import java.util.regex.Matcher; + import java.util.regex.Pattern; + ++ + public class EventEditorView { + + private CalendarView calendarView; +@@ -28,7 +32,6 @@ + + private Label editEventLabel = new Label(""); + +-// private Button completeButton = new Button("Complete!"); + private TextField nameTextField = new TextField(""); + private TextField pointsTextField = new TextField(""); + private TextField descTextField = new TextField(""); +Index: The-Hamburglars.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml +--- a/The-Hamburglars.iml (revision e720e387022c58cd8397f2300c98470cc5c02a6b) ++++ b/The-Hamburglars.iml (date 1670290593033) +@@ -8,5 +8,37 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + +\ No newline at end of file +Index: event/EventTest.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/event/EventTest.java b/event/EventTest.java +new file mode 100644 +--- /dev/null (date 1670290593001) ++++ b/event/EventTest.java (date 1670290593001) +@@ -0,0 +1,16 @@ ++package event; ++ ++import org.junit.jupiter.api.Test; ++ ++ ++class EventTest { ++ ++ @Test ++ void complete() { ++ ++ } ++ ++ @Test ++ void addGoal() { ++ } ++} +\ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m___Changes_.xml new file mode 100644 index 0000000..5b77c35 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_26_p_m___Changes_.xml @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m__[Changes]/shelved.patch b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m__[Changes]/shelved.patch new file mode 100644 index 0000000..db3dab8 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m__[Changes]/shelved.patch @@ -0,0 +1,3 @@ +diff --git a/ColorPick.fxml b/views/ColorPick.fxml +rename from ColorPick.fxml +rename to views/ColorPick.fxml diff --git a/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m___Changes_.xml b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m___Changes_.xml new file mode 100644 index 0000000..bf46aae --- /dev/null +++ b/out/production/The-Hamburglars/.idea/shelf/Uncommitted_changes_before_Update_at_2022-12-05_9_28_p_m___Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/workspace.xml b/out/production/The-Hamburglars/.idea/workspace.xml new file mode 100644 index 0000000..40f1ee7 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/workspace.xml @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1670196080350 + + + 1670196204060 + + + 1670206682055 + + + 1670206705213 + + + 1670207851422 + + + 1670208160992 + + + 1670208221179 + + + 1670271801156 + + + 1670293721600 + + + 1670294233740 + + + 1670294261598 + + + 1670294270682 + + + 1670296532056 + + + 1670296634352 + + + 1670298185503 + + + 1670298414800 + + + 1670300088349 + + + 1670300193277 + + + 1670300361479 + + + 1670301402985 + + + 1670301546025 + + + 1670301613680 + + + 1670301687358 + + + 1670357759550 + + + 1670357974075 + + + 1670358230141 + + + 1670358811724 + + + 1670358989758 + + + + + \ No newline at end of file From c6663ed38cb17a1561603125bb0030426a4ff566 Mon Sep 17 00:00:00 2001 From: Krish Patel <65433817+KrishPatel13@users.noreply.github.com> Date: Tue, 6 Dec 2022 18:14:04 -0500 Subject: [PATCH 2/3] Revert "Chronos v1.0 complete!!!" --- .gitignore | 7 - .idea/.gitignore | 4 - .idea/libraries/javafx.xml | 16 - .idea/misc.xml | 12 - .idea/uiDesigner.xml | 124 ------- Main.java | 37 -- The-Hamburglars.iml | 60 ---- event/Event.java | 167 --------- event/EventTest.java | 28 -- model/CalendarModel.java | 68 ---- observer/EventObserver.java | 15 - observer/Goal.java | 64 ---- observer/GoalTests.java | 34 -- out/production/The-Hamburglars/.gitignore | 30 -- .../The-Hamburglars/.idea/.gitignore | 4 - .../.idea/libraries/javafx.xml | 16 - out/production/The-Hamburglars/.idea/misc.xml | 12 - .../The-Hamburglars/.idea/uiDesigner.xml | 124 ------- .../The-Hamburglars/The-Hamburglars.iml | 63 ---- out/production/The-Hamburglars/save/model.ser | Bin 669 -> 0 bytes .../The-Hamburglars/views/ColorPick.fxml | 22 -- save/model.ser | Bin 376 -> 0 bytes timeBehaviour/TimeBehaviour.java | 28 -- timeBehaviour/TimePoint.java | 48 --- timeBehaviour/TimeRange.java | 78 ----- views/CalendarView.java | 331 ------------------ views/Color.java | 92 ----- views/ColorPick.fxml | 22 -- views/EventCreatorView.java | 270 -------------- views/EventEditorView.java | 307 ---------------- views/GoalCompleteView.java | 56 --- views/GoalListView.java | 85 ----- views/NewGoalView.java | 109 ------ 33 files changed, 2333 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/libraries/javafx.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/uiDesigner.xml delete mode 100644 Main.java delete mode 100644 The-Hamburglars.iml delete mode 100644 event/Event.java delete mode 100644 event/EventTest.java delete mode 100644 model/CalendarModel.java delete mode 100644 observer/EventObserver.java delete mode 100644 observer/Goal.java delete mode 100644 observer/GoalTests.java delete mode 100644 out/production/The-Hamburglars/.gitignore delete mode 100644 out/production/The-Hamburglars/.idea/.gitignore delete mode 100644 out/production/The-Hamburglars/.idea/libraries/javafx.xml delete mode 100644 out/production/The-Hamburglars/.idea/misc.xml delete mode 100644 out/production/The-Hamburglars/.idea/uiDesigner.xml delete mode 100644 out/production/The-Hamburglars/The-Hamburglars.iml delete mode 100644 out/production/The-Hamburglars/save/model.ser delete mode 100644 out/production/The-Hamburglars/views/ColorPick.fxml delete mode 100644 save/model.ser delete mode 100644 timeBehaviour/TimeBehaviour.java delete mode 100644 timeBehaviour/TimePoint.java delete mode 100644 timeBehaviour/TimeRange.java delete mode 100644 views/CalendarView.java delete mode 100644 views/Color.java delete mode 100644 views/ColorPick.fxml delete mode 100644 views/EventCreatorView.java delete mode 100644 views/EventEditorView.java delete mode 100644 views/GoalCompleteView.java delete mode 100644 views/GoalListView.java delete mode 100644 views/NewGoalView.java diff --git a/.gitignore b/.gitignore index 1cdb928..a1c2a23 100644 --- a/.gitignore +++ b/.gitignore @@ -21,10 +21,3 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* - -.out/ -.idea/ - -*.name - -*iml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 6073398..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -/save/model.ser diff --git a/.idea/libraries/javafx.xml b/.idea/libraries/javafx.xml deleted file mode 100644 index 12d7e02..0000000 --- a/.idea/libraries/javafx.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 3b29b6e..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index 2b63946..0000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Main.java b/Main.java deleted file mode 100644 index e791bd0..0000000 --- a/Main.java +++ /dev/null @@ -1,37 +0,0 @@ -import javafx.application.Application; -import javafx.stage.Stage; -import model.CalendarModel; -import views.CalendarView; - - -/** - * Main Class for the Application. - */ -public class Main extends Application -{ - CalendarView view; // the calendar view to render for the application. - - /** - * The Main function of the class. - * - * The launcher for JavaFx application. - * @param args arguments - */ - public static void main(String[] args) - { - launch(args); - } - - - /** - * To Start the application. - * - * @param primaryStage the stage for the JavaFx application. - * @throws Exception any exception that is to be thrown - */ - @Override - public void start(Stage primaryStage) throws Exception - { - this.view = CalendarView.getView(new CalendarModel(),primaryStage); - } -} diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml deleted file mode 100644 index 6bd887c..0000000 --- a/The-Hamburglars.iml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/event/Event.java b/event/Event.java deleted file mode 100644 index 5aa1695..0000000 --- a/event/Event.java +++ /dev/null @@ -1,167 +0,0 @@ -package event; - -import observer.*; -import timeBehaviour.*; -import model.CalendarModel; -import views.GoalCompleteView; - -import java.io.Serializable; -import java.util.ArrayList; - - -/** - * An event class that stores the data of an Event. - */ -public class Event implements Serializable -{ - private String name; // name of the event, this shows on the calendar. - private String description; // detailed description of the event. - private int pointValue; // the points are awarded upon completion. - private TimeBehaviour timeBehaviour; // the TimeBehaviour of the event. - private static ArrayList observerList = new ArrayList<>(); // the list of EventObservers for a particular event. - - - /** - * Constructor for a new Event. A new event requires a name, description, points and a timeBehaviour. - * - * @param name the name of the new Event - * @param timeBehaviour the Event's time behaviour. Contains the Event's time or start/end times - * @param description the description of the new Event - * @param points the points associated with the new Event - */ - public Event(String name, String description, int points, TimeBehaviour timeBehaviour) - { - this.name = name; - this.description = description; - this.pointValue = points; - this.timeBehaviour = timeBehaviour; - } - - - /** - * Set this Event as "completed", and notify observers. - */ - public void complete() - { - ArrayList completed = new ArrayList<>(); - for (EventObserver o : observerList) - if (o.addPoints(this.pointValue)) - { - GoalCompleteView gcv = new GoalCompleteView((Goal) o); - CalendarModel.getCompletedGoals().add(o); - completed.add(o); - } - for (EventObserver o : completed) - observerList.remove(o); - } - - - /** - * Get the list of observers for events. - * - * @return observerList - */ - public static ArrayList getObserverList() - { - return observerList; - } - - - /** - * Get the Event's name. - * - * @return name - */ - public String getName() - { - return this.name; - } - - - /** - * Get the Event's description. - * - * @return description - */ - public String getDescription() - { - return this.description; - } - - - /** - * Get the Event's associated points. - * - * @return pointValue - */ - public int getPointValue() - { - return this.pointValue; - } - - - /** - * Get the Event's timebehaviour. - * - * @return timeBehaviour - */ - public TimeBehaviour getTimeBehaviour() - { - return this.timeBehaviour; - } - - - /** - * Set the list of observers for events. Useful for loading files. - * - * @param oList the list of observers - */ - public static void setObserverList(ArrayList oList) - { - observerList = oList; - } - - - /** - * Set the Event's name to a new name. - * - * @param name the new Event's name - */ - public void setName(String name) - { - this.name = name; - } - - - /** - * Set the Event's description to a new description. - * - * @param description the new Event's description - */ - public void setDescription(String description) - { - this.description = description; - } - - - /** - * Set the Event's associated points to a new pointValue - * - * @param pointValue the new Event's associated points - */ - public void setPointValue(int pointValue) - { - this.pointValue = pointValue; - } - - - /** - * Change this Event's time with a new time-behaviour. - * - * @param timeBehaviour the new timeBehaviour to set for the event. - */ - public void setTimeBehaviour(TimeBehaviour timeBehaviour) - { - this.timeBehaviour = timeBehaviour; - } -} diff --git a/event/EventTest.java b/event/EventTest.java deleted file mode 100644 index 671c2c7..0000000 --- a/event/EventTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package event; - -import org.junit.jupiter.api.Test; -import timeBehaviour.TimePoint; - -import java.time.LocalDateTime; - -import static org.junit.jupiter.api.Assertions.assertEquals; - - -/** - * A Unit Test Class for Event.java. - */ -class EventTest -{ - /** - * A Unit Test for Event.complete(). - */ - @Test - void completeTest() - { - Event e = new Event("Event1", "testing", 100, new TimePoint(LocalDateTime.now())); - - e.complete(); - - assertEquals(0, Event.getObserverList().size()); - } -} diff --git a/model/CalendarModel.java b/model/CalendarModel.java deleted file mode 100644 index 2640765..0000000 --- a/model/CalendarModel.java +++ /dev/null @@ -1,68 +0,0 @@ -package model; - -import event.Event; -import observer.EventObserver; - -import java.time.LocalDateTime; -import java.io.Serializable; -import java.util.ArrayList; - -// Class to store app information behind the scene -public class CalendarModel implements Serializable { - - // list of events - ArrayList events; - - // color settings - public String colour; - public String colour_font; - - // list of goals that remain the same - private static ArrayList completedGoals = new ArrayList<>(); - - - // Constructor for no events - public CalendarModel() - { - this.events = new ArrayList(); - } - - // Constructor if some events are there - public CalendarModel(ArrayList events){ - this.events = events; - } - - // get list of completed goals - public static ArrayList getCompletedGoals() { - return completedGoals; - } - - // set completed goals - public static void setCompletedGoals(ArrayList oList) {completedGoals = oList;} - - // add an event to the calendar - public void addEvent(Event e) - { - this.events.add(e); - } - - // get the list of all events - public ArrayList getAllEvents(){ - return this.events; - } - - /** - * get events filtered by a date - */ - public ArrayList getEventsInTime(LocalDateTime time) - { - ArrayList filteredEvents = new ArrayList<>(); - for (Event e: this.events) - if (e.getTimeBehaviour().inTime(time)) - { - System.out.println(e.getName()); - filteredEvents.add(e); - } - return filteredEvents; - } -} diff --git a/observer/EventObserver.java b/observer/EventObserver.java deleted file mode 100644 index fd0203e..0000000 --- a/observer/EventObserver.java +++ /dev/null @@ -1,15 +0,0 @@ -package observer; - -/** - * Interface for Event Observers. Event Observers must be able to add an Event's points to themselves when they are - * notified that and Event is complete. - */ -public interface EventObserver { - - /** - * Add points to this observer's current point total. - * - * @param points the amount of points to be added - */ - boolean addPoints(int points); -} diff --git a/observer/Goal.java b/observer/Goal.java deleted file mode 100644 index 271dbfc..0000000 --- a/observer/Goal.java +++ /dev/null @@ -1,64 +0,0 @@ -package observer; - -import java.io.Serializable; - -/** - * Class for the user's goals, which act as concrete Event Observers. A goal contains a name, amount of points currently - * gained, and amount of points needed. - */ -public class Goal implements EventObserver, Serializable { - - private String name; // The goal's name - private int currentPoints; // The amount of points the user has currently earned toward this goal - private final int pointsToBadge; // The amount of points that are required to complete this goal - - /** - * Constructor for the Goal class. Takes a name and a point value. - * - * @param name the name of the Goal - * @param p the amount of points required for completion - */ - public Goal(String name, int p) { - this.name = name; - this.pointsToBadge = p; - this.currentPoints = 0; - } - - - /** - * Add points to this observer's current point total. - * - * @param points the amount of points to be added - * @return true if the goal is complete, or false otherwise - */ - @Override - public boolean addPoints(int points) { - this.currentPoints += points; - return this.currentPoints >= this.pointsToBadge; - } - - /** - * Get this Goal's name - * - * @return this.name - */ - public String getName() {return this.name;} - - - /** - * Get the string representation of this goal. If the goal is incomplete, its string representation looks like this: - * name: currentPoints/pointsToBadge - * If the goal is complete, its string representation is only the name of the goal. - * - * @return the string representation of this goal - */ - @Override - public String toString() { - if (this.currentPoints >= this.pointsToBadge) { - return this.name; - } - else { - return this.name + ": " + this.currentPoints + "/" + this.pointsToBadge; - } - } -} diff --git a/observer/GoalTests.java b/observer/GoalTests.java deleted file mode 100644 index acb5c36..0000000 --- a/observer/GoalTests.java +++ /dev/null @@ -1,34 +0,0 @@ -package observer; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - -public class GoalTests { - - @Test - public void addPointsTest() { - Goal goalA = new Goal("goalA", 50); - goalA.addPoints(30); - goalA.addPoints(5); - assertEquals("goalA: 35/50", goalA.toString()); - } - - @Test - public void goalCompleteTest() { - Goal goalB = new Goal("goalB", 60); - assertEquals(true, goalB.addPoints(60)); - } - - @Test - public void testGoalToString() { - Goal goalC = new Goal("goalC", 100); - assertEquals("goalC: 0/100", goalC.toString()); - goalC.addPoints(50); - assertEquals("goalC: 50/100", goalC.toString()); - goalC.addPoints(50); - assertEquals("goalC", goalC.toString()); - goalC.addPoints(50); - assertEquals("goalC", goalC.toString()); - } -} diff --git a/out/production/The-Hamburglars/.gitignore b/out/production/The-Hamburglars/.gitignore deleted file mode 100644 index 1cdb928..0000000 --- a/out/production/The-Hamburglars/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -.out/ -.idea/ - -*.name - -*iml diff --git a/out/production/The-Hamburglars/.idea/.gitignore b/out/production/The-Hamburglars/.idea/.gitignore deleted file mode 100644 index 6073398..0000000 --- a/out/production/The-Hamburglars/.idea/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -/save/model.ser diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx.xml b/out/production/The-Hamburglars/.idea/libraries/javafx.xml deleted file mode 100644 index 12d7e02..0000000 --- a/out/production/The-Hamburglars/.idea/libraries/javafx.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/misc.xml b/out/production/The-Hamburglars/.idea/misc.xml deleted file mode 100644 index 3b29b6e..0000000 --- a/out/production/The-Hamburglars/.idea/misc.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/uiDesigner.xml b/out/production/The-Hamburglars/.idea/uiDesigner.xml deleted file mode 100644 index 2b63946..0000000 --- a/out/production/The-Hamburglars/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/out/production/The-Hamburglars/The-Hamburglars.iml b/out/production/The-Hamburglars/The-Hamburglars.iml deleted file mode 100644 index 5d52380..0000000 --- a/out/production/The-Hamburglars/The-Hamburglars.iml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<<<<<<< HEAD - - - - - - - - - - - - - - - - -======= ->>>>>>> e4b52f77b1e1669b3b2bf81452780ef1c69c30fe - - \ No newline at end of file diff --git a/out/production/The-Hamburglars/save/model.ser b/out/production/The-Hamburglars/save/model.ser deleted file mode 100644 index c0489c790c65c67ee5c537ff4a263267a0c21331..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 669 zcmY*WJx?1!5FMXQFklA}gb+fOBFYqZl#!q@!~w%0SpiWciZ=GzEIQvFyJLF;5)u+c z{y>Tpp`nF_l9Gm=iY9H+K!K1_q{_~o31N!U&BuHD=FQ113}^-8+pNp{4vNSxE5$yC zLZdmjDt)_T-?NaZLQacaZV~{<_Hy(kP+K;5tlUzw1FZglBab z$&NyJ5fXn8vA7kiqY`mzE`*V^`>`ow+<|=u;9VZ0MwmzeBq;bNXwD=E!?UK@50}ik zXf`!bP-L9GjMX>d*!&7{=5LOV=3kEg@*r1*;Y5lUH(Au-Rz`#Cx)KQr8TV!6V%FyU z|00SuU*KD;E8Hrj@JS)q_`huxS_Ml8-m*Z**JNvPi?tK0W%3EiC)7LZ2A3u&%?t%! zJn%vov_4V?VJh99KtU+$EPBI`Q_K1`q>(A4gd~m{qA$Ap(YU|P)z=S)=hHLGX9WP0 z^zs7$gFg$;?~U_l?4eNjZPE(4<~i3qqLQC9S6#0BCCQ>c7x(4sSEqaSo>eH;J4#tI zYh<6cx${wP$OYDDSt}oXb3PF7TZGK2dv}6T8x>nAKR*0$F4~1gD(Q$ - - - - - - - - - - - - - - - - - diff --git a/save/model.ser b/save/model.ser deleted file mode 100644 index ced79fe174c493eb8834c775acb03dc8d148092b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 376 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osma2Zsj zK>?U!00wDk#ULZV0PH@73fuw+AMoZU6{i-Jr55SA=O^a;I`rA`hSu6@pxZqec#}(u zihzy@$j=122*@u0GeYv65>wJseHd8s5_40*&IX5yE6{4!5(cJ#60p78K(0FwyOl67 OdZUN{6)`$iQ~&^)8EP^B diff --git a/timeBehaviour/TimeBehaviour.java b/timeBehaviour/TimeBehaviour.java deleted file mode 100644 index 5b7dc49..0000000 --- a/timeBehaviour/TimeBehaviour.java +++ /dev/null @@ -1,28 +0,0 @@ -package timeBehaviour; - -import java.io.Serializable; -import java.time.LocalDateTime; - - -/** - * A TimeBehaviour interface. - */ -public interface TimeBehaviour extends Serializable -{ - - /** - * To get the time of the TimeBehaviour object. - * - * @return LocalDateTime time - */ - LocalDateTime getTime(); - - - /** - * To check if the timebehaviour is still in-time or not. - * - * @param time the time to check of the timeBehaviour is still in time or not. - * @return boolean true if the timebehaviour is still within the deadline, false otherwise. - */ - boolean inTime(LocalDateTime time); -} diff --git a/timeBehaviour/TimePoint.java b/timeBehaviour/TimePoint.java deleted file mode 100644 index 9a24726..0000000 --- a/timeBehaviour/TimePoint.java +++ /dev/null @@ -1,48 +0,0 @@ -package timeBehaviour; - -import java.time.LocalDateTime; - - -/** - * A TimePoint Class, a concrete class for TimeBehaviour with deadline. - */ -public class TimePoint implements TimeBehaviour -{ - private final LocalDateTime deadlineTime; // the deadline of the TimeBehaviour object. - - - /** - * Constructor for initializing the TimePoint timebehavior with the given deadline time. - * - * @param time LocalDateTime - */ - public TimePoint(LocalDateTime time) - { - this.deadlineTime = time; - } - - - /** - * To get the deadline time of an TimeBehaviour object. - * - * @return LocalDateTime deadline of the event. - */ - @Override - public LocalDateTime getTime() - { - return this.deadlineTime; - } - - - /** - * To check if the timebehaviour is still in-time or not. - * - * @param time the time to check of the timeBehaviour is still in time or not. - * @return boolean true if the timebehaviour is still within the deadline, false otherwise. - */ - @Override - public boolean inTime(LocalDateTime time) - { - return this.deadlineTime.toLocalDate().equals(time.toLocalDate()); - } -} diff --git a/timeBehaviour/TimeRange.java b/timeBehaviour/TimeRange.java deleted file mode 100644 index e71c121..0000000 --- a/timeBehaviour/TimeRange.java +++ /dev/null @@ -1,78 +0,0 @@ -package timeBehaviour; - -import java.time.LocalDateTime; - - -/** - * A TimeRange Class, a concrete class for TimeBehaviour with a range of start time and end time. - */ -public class TimeRange implements TimeBehaviour -{ - private final LocalDateTime startTime; // the start time of the TimeBehaviour object. - - private final LocalDateTime endTime; // the end time of the TimeBehaviour object. - - - /** - * Constructor for initializing a TimeRange timebehaviour with given range of time. - * - * @param start_time_block the start time of the range. - * @param end_time_block the end time of the range. - */ - public TimeRange(LocalDateTime start_time_block, LocalDateTime end_time_block) - { - this.startTime = start_time_block; - this.endTime = end_time_block; - } - - - /** - * To get the Start time of the timebehaviour instance. - * - * @return startTime - */ - public LocalDateTime getStartTime() - { - return this.startTime; - } - - - /** - * To get the End Time of the timebehaviour instance. - * - * @return endTime - */ - public LocalDateTime getEndTime() - { - return this.endTime; - } - - - /** - * To get the time of the TimeBehaviour object. - * - * @return LocalDateTime time - */ - @Override - public LocalDateTime getTime() - { - return this.startTime; - } - - - /** - * To check if the timebehaviour is still in-time or not. - * - * @param time the time to check of the timeBehaviour is still in time or not. - * @return boolean true if the timebehaviour is still within the deadline, false otherwise. - */ - @Override - public boolean inTime(LocalDateTime time) - { - System.out.println(this.startTime.isBefore(time)); - System.out.println(this.endTime.isAfter(time)); - return (this.startTime.isBefore(time) && this.endTime.isAfter(time)) || - this.startTime.toLocalDate().equals(time.toLocalDate()) || - this.endTime.toLocalDate().equals(time.toLocalDate()); - } -} diff --git a/views/CalendarView.java b/views/CalendarView.java deleted file mode 100644 index b0788e0..0000000 --- a/views/CalendarView.java +++ /dev/null @@ -1,331 +0,0 @@ -package views; - -import event.Event; -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; -import javafx.fxml.FXMLLoader; -import javafx.geometry.Insets; -import javafx.geometry.Pos; -import javafx.scene.Node; -import javafx.scene.Parent; -import javafx.scene.Scene; -import javafx.scene.control.Button; -import javafx.scene.control.DatePicker; -import javafx.scene.control.Label; -import javafx.scene.control.ListView; -import javafx.scene.control.skin.DatePickerSkin; -import javafx.scene.paint.Paint; -import javafx.scene.text.Font; -import javafx.scene.layout.*; -import javafx.stage.Stage; -import model.CalendarModel; -import observer.EventObserver; - - -import java.io.*; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.ArrayList; - - -public class CalendarView { - - //Below defines all the components we'll need - - //The main root - Stage stage; - - //The model that stores event information - CalendarModel model; - - //The sublayout that contains our calendar - AnchorPane calendarLayout; - - //The overall layout that contains everything - BorderPane realLayout; - - //Buttons used for functionality - Button makeEventButton; - Button makeGoalButton; - Button changeThemeButton; - Button viewGoalButton; - - //The calendar used to access events - DatePicker calendar; - - //A wrapper class used to help display the calendar in a better way - DatePickerSkin calendarSkin; - - // A node that takes the calendar and makes it always visible - Node calendarDisplay; - Button editButton; - - //Label showing the selected date - Label dateDisplay; - Button completeEventButton; - - //Variables for getting the background and text color to change window theme - static Paint colour = javafx.scene.paint.Color.valueOf("#FFFFFF"); - static Paint colour_font = javafx.scene.paint.Color.valueOf("#000000") ; - - // ListView to display event names for a specific date - ListView eventsView = new ListView<>(); - - // List to store events for a given date - ArrayList events = new ArrayList<>(); - - // static instance - static CalendarView instance; - - //Method to implement singleton design pattern - public static CalendarView getView(CalendarModel model, Stage stage){ - if (instance == null){ - instance = new CalendarView(model, stage); - } - return instance; - } - - // private constructor to enforce Singleton - private CalendarView(CalendarModel model, Stage stage){ - // Get a model - this.model = model; - - // load stored model info - loadModel(); - this.stage = stage; - - // Set up the layouts - this.calendarLayout = new AnchorPane(); - this.realLayout = new BorderPane(); - - // Create the UI - initUI(); - } - - // load stored info - public void loadModel() { - File folder = new File("save/"); - if (!folder.exists()) { - return; - } - File[] fileList = folder.listFiles(); - assert fileList != null; - for (File f : fileList) { - if (f.isFile() && f.getName().equals("model.ser")) { - try { - FileInputStream file = new FileInputStream("save/model.ser"); - ObjectInputStream in = new ObjectInputStream(file); - ArrayList loadList = (ArrayList) in.readObject(); - this.model = (CalendarModel) loadList.get(0); - Event.setObserverList((ArrayList) loadList.get(1)); - CalendarModel.setCompletedGoals((ArrayList) loadList.get(2)); - CalendarView.colour = javafx.scene.paint.Color.valueOf(this.model.colour); - CalendarView.colour_font = javafx.scene.paint.Color.valueOf(this.model.colour_font); - } catch (IOException | ClassNotFoundException e) { - throw new RuntimeException(e); - } - - } - } - } - - // Save our model - public void saveModel() { - this.model.colour = colour.toString(); - this.model.colour_font = colour_font.toString(); - File folder = new File("save/"); - if (!folder.exists()) { - folder.mkdir(); - } - File fModel = new File("save/model.ser"); - ArrayList saveList = new ArrayList<>(); - try { - saveList.add(this.model); - saveList.add(Event.getObserverList()); - saveList.add(CalendarModel.getCompletedGoals()); - FileOutputStream fout = new FileOutputStream(fModel); - ObjectOutputStream oos = new ObjectOutputStream(fout); - oos.writeObject(saveList); - } catch (IOException e) { - throw new RuntimeException(e); - } - - } - - private void initUI(){ - - // set the title of the screen - this.stage.setTitle("Chronos"); - - - //Make core screen - this.calendarLayout = new AnchorPane(); - this.realLayout = new BorderPane(); - - //make a DatePicker for our calendar, and then set up a display that keeps - // the calendar always active - calendar = new DatePicker(LocalDate.now()); - calendarSkin = new DatePickerSkin(calendar); - calendarDisplay = calendarSkin.getPopupContent(); - calendarDisplay.setScaleX(1.5); - calendarDisplay.setScaleY(1.5); - calendarDisplay.setLayoutX(100); - calendarDisplay.setLayoutY(100); - calendarLayout.getChildren().add(calendarDisplay); - calendarLayout.setPrefSize(400, 400); - calendarLayout.setBackground(new Background(new BackgroundFill(colour,null,null))); - - //Create the label to display the date - this.dateDisplay = new Label(calendar.getValue().toString()); - dateDisplay.setTextFill(colour_font); - dateDisplay.setFont(new Font(20)); - dateDisplay.setAlignment(Pos.TOP_CENTER); - //When a date is selected, update our list of events in the below - calendar.setOnAction(e ->{ - dateDisplay.setText(calendar.getValue().toString()); - this.displayEvents(calendar.getValue().atStartOfDay()); - }); - - //Create the button to make events - this.makeEventButton = new Button("Make Event"); - makeEventButton.setScaleX(1.15); - makeEventButton.setScaleY(1.15); - makeEventButton.setTextFill(colour_font); - makeEventButton.setOnAction(e -> { - EventCreatorView ecv = new EventCreatorView(this); - this.displayEvents(calendar.getValue().atStartOfDay()); - }); - - //Create the button to make goals - this.makeGoalButton = new Button("Make Goal"); - makeGoalButton.setScaleX(1.15); - makeGoalButton.setScaleY(1.15); - makeGoalButton.setTextFill(colour_font); - makeGoalButton.setOnAction(e -> { - NewGoalView ngv = new NewGoalView(this); - }); - - //Create the button to view - this.viewGoalButton = new Button("View Goal"); - viewGoalButton.setScaleX(1.15); - viewGoalButton.setScaleY(1.15); - viewGoalButton.setTextFill(colour_font); - viewGoalButton.setOnAction(e -> { - GoalListView glv = new GoalListView(this); - }); - - //Create Button for changing the theme - this.changeThemeButton = new Button("Change Theme"); - changeThemeButton.setTextFill(colour_font); - changeThemeButton.setScaleX(1.15); - changeThemeButton.setScaleY(1.15); - changeThemeButton.setOnAction(e -> { - // Configure the Color - FXMLLoader fxmlLoader = new FXMLLoader(CalendarView.class.getResource("ColorPick.fxml")); - Scene scene = null; - try { - Parent root1 = (Parent) fxmlLoader.load(); - Stage stage = new Stage(); - stage.setTitle("Chronos"); - stage.setScene(new Scene(root1)); - stage.show(); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - Color.cv = this; - }); - - //Create button bar - HBox buttons = new HBox(10); - buttons.setPadding(new Insets(30)); - buttons.getChildren().addAll(makeEventButton, makeGoalButton, viewGoalButton, changeThemeButton); - buttons.setPadding(new Insets(20)); - - //Create buttons for editing and completing events - this.editButton = new Button("Edit Event"); - this.editButton.setTextFill(colour_font); - editButton.setOnAction(e -> { - if (this.eventsView.getSelectionModel().getSelectedItem() != null){ - - for(Event i: this.events) - { - if(i.getName().equals(this.eventsView.getSelectionModel().getSelectedItem())) - { - EventEditorView editorView = new EventEditorView(this, i); - break; - } - } - } - else{ - System.out.println("Need to select an item"); - } - }); - - this.completeEventButton = new Button("Complete Event"); - this.completeEventButton.setTextFill(colour_font); - completeEventButton.setOnAction(e -> { - String eventName = this.eventsView.getSelectionModel().getSelectedItem(); - if (eventName == null){ - return; - } - //int index = 0; - Event completed = null; - for (Event event: this.events){ - if (event.getName() == eventName){ - completed = event; - completed.complete(); - break; - } - } - if (!(completed == null)){ - this.events.remove(completed); - this.model.getAllEvents().remove(completed); - this.saveModel(); - } - }); - - //Create bar for editing and completing events - HBox eventsManaging = new HBox(); - eventsManaging.getChildren().addAll(editButton, completeEventButton); - eventsManaging.setPadding(new Insets(20)); - - //Create view for events - VBox eventDisplay = new VBox(); - eventDisplay.setPadding(new Insets(20)); - this.displayEvents(LocalDateTime.now()); - eventDisplay.getChildren().addAll(dateDisplay, eventsView, eventsManaging); - - - //put everything together - realLayout.setCenter(calendarLayout); - realLayout.setBottom(buttons); - realLayout.setRight(eventDisplay); - realLayout.setBackground(new Background(new BackgroundFill(colour,null,null))); - - - - //Finally, display everything - Scene scene = new Scene(realLayout); - this.stage.setScene(scene); - this.stage.show(); - - } - - //Method to display events in the event list - private void displayEvents(LocalDateTime time) - { - //Get events that match the date - this.events = this.model.getEventsInTime(time); - - //Get their names - ArrayList eventNames = new ArrayList<>(); - for (Event e: this.events){ - eventNames.add(e.getName()); - } - - //Set the ListView to contain those names - ObservableList namesToDisplay = FXCollections.observableArrayList(eventNames); - this.eventsView.setItems(namesToDisplay); - } - -} diff --git a/views/Color.java b/views/Color.java deleted file mode 100644 index 46ab8f0..0000000 --- a/views/Color.java +++ /dev/null @@ -1,92 +0,0 @@ -package views; - -import javafx.event.ActionEvent; -import javafx.fxml.FXML; -import javafx.fxml.Initializable; -import javafx.scene.control.ColorPicker; -import javafx.scene.layout.AnchorPane; -import javafx.scene.layout.Background; -import javafx.scene.layout.BackgroundFill; -import javafx.scene.shape.Circle; -import javafx.scene.text.Text; - -import java.net.URL; -import java.util.ResourceBundle; - - -/** - * Color class for handling color picker to choose background and font color as per user's choice - * - */ -public class Color implements Initializable -{ - public AnchorPane myPane2; // color picker for font change pane - public Circle circle2; // chosen color reflected shape for font - public Text text1; // text in color picker window - public Text text2; // text in color picker window - public AnchorPane myPane; // color picker for background change pane - @FXML - private Circle circle; // chosen color reflected shape for background - @FXML - private ColorPicker cp; // chosen color for background - @FXML - private ColorPicker cp2; // chosen color for font - @FXML - static CalendarView cv; // calendar view access - - - /** - * Choose a background theme for the application as per choice of user. - * - * @param actionEvent application's response if the user chooses his desired background color. - */ - public void handleColorPicker(ActionEvent actionEvent) - { - // Change the fill color for the circle when you pick a new color and get color value from user to change - // the background color for calendar's background and border layout. - circle.setFill(cp.getValue()); - cv.calendarLayout.setBackground(new Background(new BackgroundFill(cp.getValue(),null,null))); - cv.realLayout.setBackground(new Background(new BackgroundFill(cp.getValue(),null,null))); - - //Change the fill color for the circle when you pick a new color and get color value from the user to - // change background color for color picker window. - CalendarView.colour = cp.getValue(); - myPane.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); - cv.saveModel(); - } - - - /** - * Choose a font color for the application as per choice of user. - * - * @param actionEvent application's response if user chooses his desired font color. - */ - public void handleFontColor(ActionEvent actionEvent) { - // Colour Picker UI - circle2.setFill(cp2.getValue()); - CalendarView.colour_font = cp2.getValue(); - cv.makeEventButton.setTextFill(cp2.getValue()); - cv.makeGoalButton.setTextFill(cp2.getValue()); - cv.viewGoalButton.setTextFill(cp2.getValue()); - cv.changeThemeButton.setTextFill(cp2.getValue()); - cv.editButton.setTextFill(cp2.getValue()); - cv.completeEventButton.setTextFill(cp2.getValue()); - cv.dateDisplay.setTextFill(cp2.getValue()); - text1.setFill(cp2.getValue()); - text2.setFill(cp2.getValue()); - cv.saveModel(); - } - - /** - * Change the style of color picker - * - * @param url The location used to resolve relative paths for the root object, or null if the location is not known. - * @param resourceBundle The resources used to localize the root object,or null if the root object was not localized. - */ - @Override - public void initialize(URL url, ResourceBundle resourceBundle) - { - cp.getStyleClass().add(ColorPicker.STYLE_CLASS_SPLIT_BUTTON); - myPane.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); - } -} diff --git a/views/ColorPick.fxml b/views/ColorPick.fxml deleted file mode 100644 index a78f9a5..0000000 --- a/views/ColorPick.fxml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/views/EventCreatorView.java b/views/EventCreatorView.java deleted file mode 100644 index f83c7ec..0000000 --- a/views/EventCreatorView.java +++ /dev/null @@ -1,270 +0,0 @@ -package views; - -import event.Event; -import timeBehaviour.TimeBehaviour; -import timeBehaviour.TimePoint; -import timeBehaviour.TimeRange; - -import javafx.geometry.Insets; -import javafx.scene.Scene; -import javafx.scene.control.Button; -import javafx.scene.control.DatePicker; -import javafx.scene.control.Label; -import javafx.scene.control.TextField; -import javafx.scene.layout.Background; -import javafx.scene.layout.BackgroundFill; -import javafx.scene.layout.VBox; -import javafx.scene.text.Font; -import javafx.stage.Modality; -import javafx.stage.Stage; - -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - -/** - * A EventCreatorView class for handling the creation of events. - */ -public class EventCreatorView { - private final CalendarView calendarView; // the calendar view - private final TextField nameTextField = new TextField("Name"); // the name of the event - private final TextField pointsTextField = new TextField("Points"); // the points associated with the event - private final TextField descTextField = new TextField("Description"); // the description of the event - private final Button changeTimeButton = new Button("Choose start/end time"); // Button for changing the type of time of the event - private final DatePicker pointDatePicker = new DatePicker(LocalDate.now()); // DatePicker for TimePoint event - private final TextField pointTimePicker = new TextField("Time (hh:mm)"); // Deadline time for TimePoint event - private final DatePicker startDatePicker = new DatePicker(LocalDate.now()); // Start time DatePicker for TimeRange event - private final TextField startTimePicker = new TextField("Start time (hh:mm)"); // Start time for TimeRange event - private final DatePicker endDatePicker = new DatePicker(LocalDate.now()); // End time DatePicker for TimeRange event - private final TextField endTimePicker = new TextField("End time (hh:mm)"); // End time for TimeRange event - private final Button saveButton = new Button("Save Changes"); // Button for Saving the edited event - private final Label errorLabel = new Label(""); // the error message to display - - /** - * Constructor for the EventCreatorView Class. - * - * @param calendarView the application's CalendarView - */ - public EventCreatorView(CalendarView calendarView) { - this.calendarView = calendarView; - - - // Set up the stage - final Stage dialog = new Stage(); - dialog.initModality(Modality.APPLICATION_MODAL); - dialog.initOwner(calendarView.stage); - VBox dialogVbox = new VBox(20); - dialogVbox.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); - dialogVbox.setPadding(new Insets(20, 20, 20, 20)); - - - - // Font UI - Font f = new Font(16); - Label createEventLabel = new Label("Create a new event!"); - createEventLabel.setFont(f); - nameTextField.setFont(f); - pointsTextField.setFont(f); - descTextField.setFont(f); - changeTimeButton.setFont(f); - pointTimePicker.setFont(f); - pointDatePicker.setValue(this.calendarView.calendar.getValue()); - startTimePicker.setFont(f); - startDatePicker.setValue(this.calendarView.calendar.getValue()); - endDatePicker.setValue(this.calendarView.calendar.getValue()); - endTimePicker.setFont(f); - saveButton.setFont(f); - - - - // Buttons, TextFields, and Labels UI. - createEventLabel.setTextFill(CalendarView.colour_font); - changeTimeButton.setTextFill(CalendarView.colour_font); - saveButton.setTextFill(CalendarView.colour_font); - VBox vbox = new VBox(10, createEventLabel, nameTextField, pointsTextField, descTextField, changeTimeButton, pointDatePicker, pointTimePicker, saveButton, errorLabel); - dialogVbox.getChildren().add(vbox); - Scene scene = new Scene(dialogVbox, 400, 500); - dialog.setScene(scene); - dialog.show(); - dialog.setAlwaysOnTop(true); - - - - // On Action Function Calls. - saveButton.setOnAction(e -> createEvent()); - changeTimeButton.setOnAction(e -> { - if (vbox.getChildren().contains(pointDatePicker)) { - vbox.getChildren().remove(pointDatePicker); - vbox.getChildren().remove(pointTimePicker); - vbox.getChildren().remove(saveButton); - vbox.getChildren().remove(errorLabel); - pointDatePicker.setValue(this.calendarView.calendar.getValue()); - pointTimePicker.setText("Time (hh:mm)"); - changeTimeButton.setText("Choose single time"); - vbox.getChildren().add(startDatePicker); - vbox.getChildren().add(startTimePicker); - vbox.getChildren().add(endDatePicker); - vbox.getChildren().add(endTimePicker); - } else { - vbox.getChildren().remove(startDatePicker); - vbox.getChildren().remove(startTimePicker); - vbox.getChildren().remove(endDatePicker); - vbox.getChildren().remove(endTimePicker); - vbox.getChildren().remove(saveButton); - vbox.getChildren().remove(errorLabel); - startDatePicker.setValue(this.calendarView.calendar.getValue()); - startTimePicker.setText("Start time (hh:mm)"); - endDatePicker.setValue(this.calendarView.calendar.getValue()); - endTimePicker.setText("End time (hh:mm)"); - changeTimeButton.setText("Choose start/end time"); - vbox.getChildren().add(pointDatePicker); - vbox.getChildren().add(pointTimePicker); - } - vbox.getChildren().add(saveButton); - vbox.getChildren().add(errorLabel); - - }); - - } - - /** - * Create a new Event using the parameters given in the text fields and date pickers. - * Store this new Event in the CalendarModel's list of Events. - * - * @throws NumberFormatException for invalid input of integer in points field. - */ - private void createEvent() throws NumberFormatException { - - // Check if the Event's Name is not empty. - if (this.nameTextField.getText().trim().isEmpty() || this.nameTextField.getText().trim().isBlank()) { - this.errorLabel.setText("Please enter the Event Name. It can NOT be Blank!"); - return; - } - // Check if the event name is already in the events list. - else - { - String temp = this.nameTextField.getText().trim(); - for(Event i: this.calendarView.model.getAllEvents()) - { - if (temp.equals(i.getName())) - { - this.errorLabel.setText("Event Name already taken!"); - return; - } - } - } - // store the valid name - String event_name = this.nameTextField.getText().trim(); - - - // Check if the Event's Description is not empty. - if (this.descTextField.getText().trim().isEmpty() || this.descTextField.getText().trim().isBlank()) { - this.errorLabel.setText("Please enter the Event's Description. It can NOT be Blank!"); - return; - } - //Store the valid description - String event_description = this.descTextField.getText().trim(); - - - String points = String.valueOf(this.pointsTextField.getText()).trim(); - int event_points = 0; - // Check if the Event's associated Points are of integer type. - try { - event_points += Integer.parseInt(points); // store the valid points associated with the event. - } - catch (NumberFormatException e) - { - this.errorLabel.setText("Please enter a Integer value for the points associated with the event."); - return; - } - - - //Check the type of the time and create time range or time point based on that. - if (this.endTimePicker.getText().trim().isBlank() || this.endTimePicker.getText().trim().isEmpty() || this.startTimePicker.getText().trim().equals("Start time (hh:mm)") || this.endTimePicker.getText().trim().equals("End time (hh:mm)")) { - // Create a new Time Point object based on the deadline of the user. - - String deadline_hours = this.pointTimePicker.getText().trim(); - - Pattern pattern = Pattern.compile("^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"); - Matcher matcher = pattern.matcher(deadline_hours); - if (matcher.find()) { - // match found, valid deadline HH:mm. - String yyyy_mm_dd = this.pointDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); - String yyyy_mm_dd_HH_mm = yyyy_mm_dd + " " + deadline_hours; - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); - LocalDateTime pointTime = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter); - - - // Create a TimePoint object. - TimeBehaviour tp = new TimePoint(pointTime); - - // Finally, create a new Event with the new TimePoint deadline time of the event. - Event e = new Event(event_name, event_description, event_points, tp); - - - // Add the event to the events list of CalendarView.model.events - this.calendarView.model.addEvent(e); - - // Save the event - this.calendarView.saveModel(); - - - //Success Message! - this.errorLabel.setText("Event Added to the Calendar!"); - } - else // Invalid Format of HH:mm - this.errorLabel.setText("Please Re-enter the time of the event. Enter in HH:mm format."); - } - else - { - // Create a new Time Range object based on the start-time and end-time of the user. - - String start_time = this.startTimePicker.getText().trim(); - String end_time = this.endTimePicker.getText().trim(); - - - Pattern pattern = Pattern.compile("^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"); - Matcher matcher = pattern.matcher(start_time); - Matcher matcher1 = pattern.matcher(end_time); - - if (matcher1.find() && matcher.find()) - { - // match found, valid deadline HH:mm. - String yyyy_mm_dd = this.startDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); - String yyyy_mm_dd2 = this.endDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); - String yyyy_mm_dd_HH_mm = yyyy_mm_dd + " " + start_time; - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); - LocalDateTime start_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter); - - String yyyy_mm_dd_HH_mm2 = yyyy_mm_dd2 + " " + end_time; - DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); - LocalDateTime end_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm2, formatter2); - - System.out.println(start_time_block + " " + end_time_block); - - - // Create a TimeRange object. - TimeBehaviour tr = new TimeRange(start_time_block, end_time_block); - - // Finally, create a new Event with the new TimeRange start and end time of the event block. - Event e = new Event(event_name, event_description, event_points, tr); - - - // Add the event to the events list of CalendarView.model.events - this.calendarView.model.addEvent(e); - - // Save the event - this.calendarView.saveModel(); - - //Success Message! - this.errorLabel.setText("Event Added to the Calendar!"); - } - else // Invalid Format of HH:mm - this.errorLabel.setText("Invalid Start/End time of the event. Enter in HH:mm format."); - } - } -} diff --git a/views/EventEditorView.java b/views/EventEditorView.java deleted file mode 100644 index b799e11..0000000 --- a/views/EventEditorView.java +++ /dev/null @@ -1,307 +0,0 @@ -package views; - -import event.Event; -import timeBehaviour.TimeBehaviour; -import timeBehaviour.TimePoint; -import timeBehaviour.TimeRange; -import static views.CalendarView.colour; - -import javafx.geometry.Insets; -import javafx.scene.Scene; -import javafx.scene.control.Button; -import javafx.scene.control.DatePicker; -import javafx.scene.control.Label; -import javafx.scene.control.TextField; -import javafx.scene.layout.Background; -import javafx.scene.layout.BackgroundFill; -import javafx.scene.layout.VBox; -import javafx.scene.text.Font; -import javafx.stage.Modality; -import javafx.stage.Stage; - -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - -/** - * A EventEditorView class for handling the editing of events. - */ -public class EventEditorView -{ - private final CalendarView calendarView; // the calendar view - private final Event event; // the event to edit - private final TextField nameTextField = new TextField("Name"); // the name of the event - private final TextField pointsTextField = new TextField("Points"); // the points associated with the event - private final TextField descTextField = new TextField("Description"); // the description of the event - private final Button changeTimeButton = new Button("Choose start/end time"); // Button for changing the type of time of the event - private final DatePicker pointDatePicker = new DatePicker(LocalDate.now()); // DatePicker for TimePoint event - private final TextField pointTimePicker = new TextField("Time (hh:mm)"); // Deadline time for TimePoint event - private final DatePicker startDatePicker = new DatePicker(LocalDate.now()); // Start time DatePicker for TimeRange event - private final TextField startTimePicker = new TextField("Start time (hh:mm)"); // Start time for TimeRange event - private final DatePicker endDatePicker = new DatePicker(LocalDate.now()); // End time DatePicker for TimeRange event - private final TextField endTimePicker = new TextField("End time (hh:mm)"); // End time for TimeRange event - private final Button saveButton = new Button("Save Changes"); // Button for Saving the edited event - private final Label errorLabel = new Label(""); // the error message to display - - - /** - * Constructor for the EventEditorView Class. - * - * @param calendarView the application's CalendarView - * @param event the event to edit - */ - public EventEditorView(CalendarView calendarView, Event event) - { - this.calendarView = calendarView; - this.event = event; - - - - // Set up the stage - final Stage dialog = new Stage(); - dialog.initModality(Modality.APPLICATION_MODAL); - dialog.initOwner(calendarView.stage); - VBox dialogVbox = new VBox(20); - dialogVbox.setPadding(new Insets(20, 20, 20, 20)); - - - - // Font UI - Font f = new Font(16); - Label editEventLabel = new Label(""); - editEventLabel.setFont(f); - nameTextField.setFont(f); - pointsTextField.setFont(f); - descTextField.setFont(f); - changeTimeButton.setFont(f); - pointTimePicker.setFont(f); - startTimePicker.setFont(f); - endTimePicker.setFont(f); - saveButton.setFont(f); - errorLabel.setFont(f); - - - - // Buttons, TextFields, and Labels UI. - saveButton.setTextFill(CalendarView.colour_font); - editEventLabel.setTextFill(CalendarView.colour_font); - changeTimeButton.setTextFill(CalendarView.colour_font); - errorLabel.setTextFill(CalendarView.colour_font); - editEventLabel.setText("Edit Event: " + event.getName()); - nameTextField.setText(event.getName()); - pointsTextField.setText(String.valueOf(event.getPointValue())); - descTextField.setText(event.getDescription()); - dialogVbox.setBackground(new Background(new BackgroundFill(colour,null,null))); - VBox vbox = new VBox(10, editEventLabel, nameTextField, pointsTextField, descTextField, changeTimeButton, pointDatePicker, pointTimePicker, saveButton, errorLabel); - dialogVbox.getChildren().add(vbox); - Scene scene = new Scene(dialogVbox, 400, 500); - dialog.setScene(scene); - dialog.show(); - dialog.setAlwaysOnTop(true); - - - - // On Action Function Calls. - saveButton.setOnAction(e -> editEvent()); - changeTimeButton.setOnAction(e -> changeTime(vbox)); - - - - //If event has a time point: - if(event.getTimeBehaviour() instanceof TimePoint tp) - { - //set values of pointDatePicker and pointTimePicker to event's time - this.pointDatePicker.setValue(tp.getTime().toLocalDate()); - this.pointTimePicker.setText(tp.getTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")).substring(11,16)); - } - - //If event has a time range: - else - { - this.changeTime(vbox); - - //set values of startDatePicker, startTimePicker, endDatePicker and endTimePicker - TimeRange tr = (TimeRange) event.getTimeBehaviour(); - - this.startDatePicker.setValue(tr.getStartTime().toLocalDate()); - this.endDatePicker.setValue(tr.getEndTime().toLocalDate()); - - this.startTimePicker.setText(tr.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")).substring(11,16)); - this.endTimePicker.setText(tr.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")).substring(11,16)); - } - } - - - /** - * Edit the details of the event and save accordingly. - */ - private void editEvent() { - - // Check if the Event's Name is not empty. - if (this.nameTextField.getText().trim().isEmpty() || this.nameTextField.getText().trim().isBlank()) { - this.errorLabel.setText("Please enter the Event Name. It can NOT be Blank!"); - return; - } - // Check if the event name is already in the events list. - else - { - String temp = this.nameTextField.getText().trim(); - for(Event i: this.calendarView.model.getAllEvents()) - { - if (temp.equals(i.getName())) - { - this.errorLabel.setText("Event Name already taken!"); - return; - } - } - } - this.event.setName(this.nameTextField.getText().trim()); // edit name - - - // Check if the Event's Description is not empty. - if (this.descTextField.getText().trim().isEmpty() || this.descTextField.getText().trim().isBlank()) { - this.errorLabel.setText("Please enter the Event's Description. It can NOT be Blank!"); - return; - } - this.event.setDescription(this.descTextField.getText().trim()); // edit the description - - - String points = String.valueOf(this.pointsTextField.getText()).trim(); - int event_points = 0; - // Check if the Event's associated Points are of integer type. - try { - event_points += Integer.parseInt(points); - } catch (NumberFormatException e) { - this.errorLabel.setText("Please enter a Integer value for the points associated with the event."); - return; - } - this.event.setPointValue(event_points); // edit the points associated - - - - - if (this.endTimePicker.getText().trim().isBlank() || this.endTimePicker.getText().trim().isEmpty() || this.startTimePicker.getText().trim().equals("Start time (hh:mm)") || this.endTimePicker.getText().trim().equals("End time (hh:mm)")) - { - // Create a new Time Point object based on the deadline of the user. - String deadline_hours = this.pointTimePicker.getText().trim(); - - Pattern pattern = Pattern.compile("^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"); - Matcher matcher = pattern.matcher(deadline_hours); - - if (matcher.find()) - { - // match found, valid deadline HH:mm. - String yyyy_mm_dd = this.pointDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); - - String yyyy_mm_dd_HH_mm = yyyy_mm_dd + " " + deadline_hours; - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); - LocalDateTime pointTime = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter); - - - // Create a TimePoint object. - TimeBehaviour tp = new TimePoint(pointTime); - this.event.setTimeBehaviour(tp); // edit the new deadline with timepoint object - - - //Success Message - this.errorLabel.setText("Event Added to the Calendar!"); - - // Save the event - this.calendarView.saveModel(); - } - - else // Invalid Format of HH:mm - this.errorLabel.setText("Please Re-enter the time of the event. Enter in HH:mm format."); - } - - else - { - // Create a new Time Range object based on the start-time and end-time of the user. - - String start_time = this.startTimePicker.getText().trim(); - String end_time = this.endTimePicker.getText().trim(); - - - Pattern pattern = Pattern.compile("^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"); - Matcher matcher = pattern.matcher(start_time); - Matcher matcher1 = pattern.matcher(end_time); - - if (matcher1.find() && matcher.find()) - { - // match found, valid deadline HH:mm. - String yyyy_mm_dd = this.startDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); - String yyyy_mm_dd2 = this.endDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); - - String yyyy_mm_dd_HH_mm = yyyy_mm_dd + " " + start_time; - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); - LocalDateTime start_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter); - - String yyyy_mm_dd_HH_mm2 = yyyy_mm_dd2 + " " + end_time; - DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); - LocalDateTime end_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm2, formatter2); - - System.out.println(start_time_block + " " + end_time_block); - - // Create a TimeRange object. - TimeBehaviour tr = new TimeRange(start_time_block, end_time_block); - - this.event.setTimeBehaviour(tr); // edit the timerange of the event. - - //Success Message! - this.errorLabel.setText("Event Added to the Calendar!"); - - // Save the event - this.calendarView.saveModel(); - } - - else // Invalid Format of HH:mm - this.errorLabel.setText("Invalid Start/End time of the event. Enter in HH:mm format."); - } - } - - - /** - * Switches between displaying input for time points/time ranges - * - * @param vbox a Vertical JavaFx Box - */ - private void changeTime(VBox vbox) - { - if (vbox.getChildren().contains(pointDatePicker)) - { - vbox.getChildren().remove(pointDatePicker); - vbox.getChildren().remove(pointTimePicker); - vbox.getChildren().remove(saveButton); - vbox.getChildren().remove(errorLabel); - pointDatePicker.setValue(LocalDate.now()); - pointTimePicker.setText("Time (hh:mm)"); - changeTimeButton.setText("Choose single time"); - vbox.getChildren().add(startDatePicker); - vbox.getChildren().add(startTimePicker); - vbox.getChildren().add(endDatePicker); - vbox.getChildren().add(endTimePicker); - } - else // Switch to Time-Range entry field. - { - vbox.getChildren().remove(startDatePicker); - vbox.getChildren().remove(startTimePicker); - vbox.getChildren().remove(endDatePicker); - vbox.getChildren().remove(endTimePicker); - vbox.getChildren().remove(saveButton); - vbox.getChildren().remove(errorLabel); - startDatePicker.setValue(LocalDate.now()); - startTimePicker.setText("Start time (hh:mm)"); - endDatePicker.setValue(LocalDate.now()); - endTimePicker.setText("End time (hh:mm)"); - changeTimeButton.setText("Choose start/end time"); - vbox.getChildren().add(pointDatePicker); - vbox.getChildren().add(pointTimePicker); - } - vbox.getChildren().add(saveButton); - vbox.getChildren().add(errorLabel); - } -} diff --git a/views/GoalCompleteView.java b/views/GoalCompleteView.java deleted file mode 100644 index 8b5e4e0..0000000 --- a/views/GoalCompleteView.java +++ /dev/null @@ -1,56 +0,0 @@ -package views; - -import javafx.geometry.Insets; -import javafx.scene.Scene; -import javafx.scene.control.Button; -import javafx.scene.control.Label; -import javafx.scene.layout.Background; -import javafx.scene.layout.BackgroundFill; -import javafx.scene.layout.VBox; -import javafx.scene.text.Font; -import javafx.stage.Stage; -import observer.EventObserver; -import observer.Goal; - -import static views.CalendarView.colour; - -/** - * A window that notifies the user when they have completed one of their goals. - */ -public class GoalCompleteView { - - private Label completeLabel = new Label(""); // Message that tells the user which goal has been completed - private Button okButton = new Button("OK"); // Button to close this window - - /** - * Constructor - * - * @param o the goal which has been completed - */ - public GoalCompleteView(Goal o) { - final Stage dialog = new Stage(); - VBox dialogVbox = new VBox(20); - dialogVbox.setPadding(new Insets(20, 20, 20, 20)); - dialogVbox.setBackground(new Background(new BackgroundFill(colour,null,null))); - completeLabel.setText("Congratulations! You completed your goal: " + o.getName()); - Font f = new Font(16); - completeLabel.setFont(f); - completeLabel.setTextFill(CalendarView.colour_font); - okButton.setFont(f); - okButton.setTextFill(CalendarView.colour_font); - - - okButton.setOnAction(e -> { - dialog.close(); - }); - - VBox vbox = new VBox(10, completeLabel, okButton); - dialogVbox.getChildren().add(vbox); - Scene scene = new Scene(dialogVbox, 400, 100); - dialog.setScene(scene); - dialog.show(); - dialog.setAlwaysOnTop(true); - } - - -} \ No newline at end of file diff --git a/views/GoalListView.java b/views/GoalListView.java deleted file mode 100644 index 173c373..0000000 --- a/views/GoalListView.java +++ /dev/null @@ -1,85 +0,0 @@ -package views; - -import javafx.scene.layout.Background; -import javafx.scene.layout.BackgroundFill; -import javafx.scene.paint.Paint; -import model.CalendarModel; -import event.Event; -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; -import javafx.geometry.Insets; -import javafx.scene.Scene; -import javafx.scene.control.Label; -import javafx.scene.control.ListView; -import javafx.scene.layout.HBox; -import javafx.scene.layout.VBox; -import javafx.scene.text.Font; -import javafx.stage.Stage; -import observer.EventObserver; - -import java.util.ArrayList; - -import static views.CalendarView.colour; - -/** - * GUI for the user to view their existing Goals. Shows ongoing Goals and completed Goals separately. - */ -public class GoalListView { - - CalendarView calendarView; // The application's CalendarView - private Paint colour; // The background colour - - /** - * Constructor - * - * @param calendarView the application's CalendarView - */ - public GoalListView(CalendarView calendarView) { - this.calendarView = calendarView; - this.colour = CalendarView.colour; - - final Stage dialog = new Stage(); - Label labelOngoing = new Label("Ongoing goals:"); - labelOngoing.setFont(new Font(16)); - labelOngoing.setTextFill(CalendarView.colour_font); - Label labelComplete = new Label("Completed goals:"); - labelComplete.setFont(new Font(16)); - labelComplete.setTextFill(CalendarView.colour_font); - - ArrayList goalsOngoingList = new ArrayList<>(); - for (EventObserver o : Event.getObserverList()) { - goalsOngoingList.add(o.toString()); - } - ObservableList goalsOngoing = FXCollections.observableArrayList(goalsOngoingList); - ListView listViewOngoing = new ListView<>(goalsOngoing); - listViewOngoing.setMaxSize(200, 200); - - ArrayList goalsCompleteList = new ArrayList<>(); - for (EventObserver o : CalendarModel.getCompletedGoals()) { - goalsCompleteList.add(o.toString()); - } - ObservableList goalsComplete = FXCollections.observableArrayList(goalsCompleteList); - ListView listViewComplete = new ListView<>(goalsComplete); - listViewComplete.setMaxSize(200, 200); - - VBox vboxOngoing = new VBox(20); - vboxOngoing.setPadding(new Insets(20, 20, 20, 20)); - vboxOngoing.getChildren().addAll(labelOngoing, listViewOngoing); - vboxOngoing.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); - - VBox vboxComplete = new VBox(20); - vboxComplete.setPadding(new Insets(20, 20, 20, 20)); - vboxComplete.getChildren().addAll(labelComplete, listViewComplete); - vboxComplete.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); - - HBox hbox = new HBox(20); - hbox.setPadding(new Insets(20, 20, 20, 20)); - hbox.getChildren().addAll(vboxOngoing, vboxComplete); - hbox.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); - - Scene scene = new Scene(hbox, 400, 400); - dialog.setScene(scene); - dialog.show(); - dialog.setAlwaysOnTop(true); - } -} diff --git a/views/NewGoalView.java b/views/NewGoalView.java deleted file mode 100644 index de83a6d..0000000 --- a/views/NewGoalView.java +++ /dev/null @@ -1,109 +0,0 @@ -package views; - -import event.Event; -import javafx.geometry.Insets; -import javafx.scene.Scene; -import javafx.scene.control.Button; -import javafx.scene.control.Label; -import javafx.scene.control.TextField; -import javafx.scene.layout.Background; -import javafx.scene.layout.BackgroundFill; -import javafx.scene.layout.VBox; -import javafx.scene.paint.Paint; -import javafx.scene.text.Font; -import javafx.stage.Modality; -import javafx.stage.Stage; -import observer.Goal; - -import static views.CalendarView.colour; - -/** - * GUI for the user to create new Goals. Allows the user to choose a name and amount of points required to complete the - * goal. - */ -public class NewGoalView { - - CalendarView calendarView; // The application's CalendarView - private Paint colour; // The background colour - private Label createGoalLabel = new Label("Create a new goal! Enter a name and point value."); // Text label at the top of the window - private TextField goalNameTextField = new TextField("Name"); // Text field to enter the new goal's name - private TextField goalPointsTextField = new TextField("Points"); // Text field to enter a number of points - private Label errorLabel = new Label(""); // Label to display whether the goal was created successfully or not - private Button saveButton = new Button("Save Goal"); // Button to create and save the new goal - - /** - * Constructor - * - * @param calendarView the application's CalendarView - */ - public NewGoalView(CalendarView calendarView) { - this.calendarView = calendarView; - this.colour = CalendarView.colour; - - final Stage dialog = new Stage(); - dialog.initModality(Modality.APPLICATION_MODAL); - dialog.initOwner(calendarView.stage); - VBox dialogVbox = new VBox(20); - dialogVbox.setPadding(new Insets(20, 20, 20, 20)); - - createGoalLabel.setId("createGoalLabel"); - createGoalLabel.setTextFill(CalendarView.colour_font); - createGoalLabel.setFont(new Font(16)); - createGoalLabel.setTextFill(CalendarView.colour_font); - goalNameTextField.setId("goalNameTextField"); - goalNameTextField.setFont(new Font(16)); - goalPointsTextField.setId("goalPointsTextField"); - goalPointsTextField.setFont(new Font(16)); - errorLabel.setId("errorLabel"); - errorLabel.setTextFill(CalendarView.colour_font); - errorLabel.setFont(new Font(16)); - saveButton.setId("saveButton"); - saveButton.setTextFill(CalendarView.colour_font); - saveButton.setFont(new Font(16)); - dialogVbox.setBackground(new Background(new BackgroundFill(colour,null,null))); - - saveButton.setOnAction(e -> createGoal()); - errorLabel.setTextFill(CalendarView.colour_font); - - VBox createGoalBox = new VBox(10, createGoalLabel, goalNameTextField, goalPointsTextField, errorLabel, saveButton); - createGoalBox.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); - - - dialogVbox.getChildren().add(createGoalBox); - dialogVbox.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); - Scene dialogScene = new Scene(dialogVbox, 400, 400); - dialog.setScene(dialogScene); - dialog.show(); - dialog.setAlwaysOnTop(true); - } - - - /** - * Create a new Goal using the configurations given in goalNameTextField and goalPointsTextField. Add the new Goal - * to the observerLists of all Events. - */ - private void createGoal() { - try { - int points = Integer.parseInt(goalPointsTextField.getText()); - - String name; - if (!goalNameTextField.getText().isEmpty()) { - name = goalNameTextField.getText(); - } - else { - errorLabel.setText("Enter a name for the goal!"); - return; - } - - Goal goal = new Goal(name, points); - Event.getObserverList().add(goal); - this.calendarView.saveModel(); - errorLabel.setText("Goal " + "\"" + goal.getName() + "\"" + " created!"); - - } - catch (NumberFormatException e) { - errorLabel.setText("Invalid number of points!"); - } - - } -} \ No newline at end of file From 904ca86a338d821ca9abe989f7ce8d50fa8a4620 Mon Sep 17 00:00:00 2001 From: RealityAdmin <58146870+RealityAdmin@users.noreply.github.com> Date: Tue, 6 Dec 2022 18:28:08 -0500 Subject: [PATCH 3/3] Revert "Revert "Chronos v1.0 complete!!!"" --- .gitignore | 7 + .idea/.gitignore | 4 + .idea/libraries/javafx.xml | 16 + .idea/misc.xml | 12 + .idea/uiDesigner.xml | 124 +++++++ Main.java | 37 ++ The-Hamburglars.iml | 60 ++++ event/Event.java | 167 +++++++++ event/EventTest.java | 28 ++ model/CalendarModel.java | 68 ++++ observer/EventObserver.java | 15 + observer/Goal.java | 64 ++++ observer/GoalTests.java | 34 ++ out/production/The-Hamburglars/.gitignore | 30 ++ .../The-Hamburglars/.idea/.gitignore | 4 + .../.idea/libraries/javafx.xml | 16 + out/production/The-Hamburglars/.idea/misc.xml | 12 + .../The-Hamburglars/.idea/uiDesigner.xml | 124 +++++++ .../The-Hamburglars/The-Hamburglars.iml | 63 ++++ out/production/The-Hamburglars/save/model.ser | Bin 0 -> 669 bytes .../The-Hamburglars/views/ColorPick.fxml | 22 ++ save/model.ser | Bin 0 -> 376 bytes timeBehaviour/TimeBehaviour.java | 28 ++ timeBehaviour/TimePoint.java | 48 +++ timeBehaviour/TimeRange.java | 78 +++++ views/CalendarView.java | 331 ++++++++++++++++++ views/Color.java | 92 +++++ views/ColorPick.fxml | 22 ++ views/EventCreatorView.java | 270 ++++++++++++++ views/EventEditorView.java | 307 ++++++++++++++++ views/GoalCompleteView.java | 56 +++ views/GoalListView.java | 85 +++++ views/NewGoalView.java | 109 ++++++ 33 files changed, 2333 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/libraries/javafx.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/uiDesigner.xml create mode 100644 Main.java create mode 100644 The-Hamburglars.iml create mode 100644 event/Event.java create mode 100644 event/EventTest.java create mode 100644 model/CalendarModel.java create mode 100644 observer/EventObserver.java create mode 100644 observer/Goal.java create mode 100644 observer/GoalTests.java create mode 100644 out/production/The-Hamburglars/.gitignore create mode 100644 out/production/The-Hamburglars/.idea/.gitignore create mode 100644 out/production/The-Hamburglars/.idea/libraries/javafx.xml create mode 100644 out/production/The-Hamburglars/.idea/misc.xml create mode 100644 out/production/The-Hamburglars/.idea/uiDesigner.xml create mode 100644 out/production/The-Hamburglars/The-Hamburglars.iml create mode 100644 out/production/The-Hamburglars/save/model.ser create mode 100644 out/production/The-Hamburglars/views/ColorPick.fxml create mode 100644 save/model.ser create mode 100644 timeBehaviour/TimeBehaviour.java create mode 100644 timeBehaviour/TimePoint.java create mode 100644 timeBehaviour/TimeRange.java create mode 100644 views/CalendarView.java create mode 100644 views/Color.java create mode 100644 views/ColorPick.fxml create mode 100644 views/EventCreatorView.java create mode 100644 views/EventEditorView.java create mode 100644 views/GoalCompleteView.java create mode 100644 views/GoalListView.java create mode 100644 views/NewGoalView.java diff --git a/.gitignore b/.gitignore index a1c2a23..1cdb928 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,10 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* + +.out/ +.idea/ + +*.name + +*iml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..6073398 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,4 @@ +# Default ignored files +/shelf/ +/workspace.xml +/save/model.ser diff --git a/.idea/libraries/javafx.xml b/.idea/libraries/javafx.xml new file mode 100644 index 0000000..12d7e02 --- /dev/null +++ b/.idea/libraries/javafx.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..3b29b6e --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..e791bd0 --- /dev/null +++ b/Main.java @@ -0,0 +1,37 @@ +import javafx.application.Application; +import javafx.stage.Stage; +import model.CalendarModel; +import views.CalendarView; + + +/** + * Main Class for the Application. + */ +public class Main extends Application +{ + CalendarView view; // the calendar view to render for the application. + + /** + * The Main function of the class. + * + * The launcher for JavaFx application. + * @param args arguments + */ + public static void main(String[] args) + { + launch(args); + } + + + /** + * To Start the application. + * + * @param primaryStage the stage for the JavaFx application. + * @throws Exception any exception that is to be thrown + */ + @Override + public void start(Stage primaryStage) throws Exception + { + this.view = CalendarView.getView(new CalendarModel(),primaryStage); + } +} diff --git a/The-Hamburglars.iml b/The-Hamburglars.iml new file mode 100644 index 0000000..6bd887c --- /dev/null +++ b/The-Hamburglars.iml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/event/Event.java b/event/Event.java new file mode 100644 index 0000000..5aa1695 --- /dev/null +++ b/event/Event.java @@ -0,0 +1,167 @@ +package event; + +import observer.*; +import timeBehaviour.*; +import model.CalendarModel; +import views.GoalCompleteView; + +import java.io.Serializable; +import java.util.ArrayList; + + +/** + * An event class that stores the data of an Event. + */ +public class Event implements Serializable +{ + private String name; // name of the event, this shows on the calendar. + private String description; // detailed description of the event. + private int pointValue; // the points are awarded upon completion. + private TimeBehaviour timeBehaviour; // the TimeBehaviour of the event. + private static ArrayList observerList = new ArrayList<>(); // the list of EventObservers for a particular event. + + + /** + * Constructor for a new Event. A new event requires a name, description, points and a timeBehaviour. + * + * @param name the name of the new Event + * @param timeBehaviour the Event's time behaviour. Contains the Event's time or start/end times + * @param description the description of the new Event + * @param points the points associated with the new Event + */ + public Event(String name, String description, int points, TimeBehaviour timeBehaviour) + { + this.name = name; + this.description = description; + this.pointValue = points; + this.timeBehaviour = timeBehaviour; + } + + + /** + * Set this Event as "completed", and notify observers. + */ + public void complete() + { + ArrayList completed = new ArrayList<>(); + for (EventObserver o : observerList) + if (o.addPoints(this.pointValue)) + { + GoalCompleteView gcv = new GoalCompleteView((Goal) o); + CalendarModel.getCompletedGoals().add(o); + completed.add(o); + } + for (EventObserver o : completed) + observerList.remove(o); + } + + + /** + * Get the list of observers for events. + * + * @return observerList + */ + public static ArrayList getObserverList() + { + return observerList; + } + + + /** + * Get the Event's name. + * + * @return name + */ + public String getName() + { + return this.name; + } + + + /** + * Get the Event's description. + * + * @return description + */ + public String getDescription() + { + return this.description; + } + + + /** + * Get the Event's associated points. + * + * @return pointValue + */ + public int getPointValue() + { + return this.pointValue; + } + + + /** + * Get the Event's timebehaviour. + * + * @return timeBehaviour + */ + public TimeBehaviour getTimeBehaviour() + { + return this.timeBehaviour; + } + + + /** + * Set the list of observers for events. Useful for loading files. + * + * @param oList the list of observers + */ + public static void setObserverList(ArrayList oList) + { + observerList = oList; + } + + + /** + * Set the Event's name to a new name. + * + * @param name the new Event's name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Set the Event's description to a new description. + * + * @param description the new Event's description + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Set the Event's associated points to a new pointValue + * + * @param pointValue the new Event's associated points + */ + public void setPointValue(int pointValue) + { + this.pointValue = pointValue; + } + + + /** + * Change this Event's time with a new time-behaviour. + * + * @param timeBehaviour the new timeBehaviour to set for the event. + */ + public void setTimeBehaviour(TimeBehaviour timeBehaviour) + { + this.timeBehaviour = timeBehaviour; + } +} diff --git a/event/EventTest.java b/event/EventTest.java new file mode 100644 index 0000000..671c2c7 --- /dev/null +++ b/event/EventTest.java @@ -0,0 +1,28 @@ +package event; + +import org.junit.jupiter.api.Test; +import timeBehaviour.TimePoint; + +import java.time.LocalDateTime; + +import static org.junit.jupiter.api.Assertions.assertEquals; + + +/** + * A Unit Test Class for Event.java. + */ +class EventTest +{ + /** + * A Unit Test for Event.complete(). + */ + @Test + void completeTest() + { + Event e = new Event("Event1", "testing", 100, new TimePoint(LocalDateTime.now())); + + e.complete(); + + assertEquals(0, Event.getObserverList().size()); + } +} diff --git a/model/CalendarModel.java b/model/CalendarModel.java new file mode 100644 index 0000000..2640765 --- /dev/null +++ b/model/CalendarModel.java @@ -0,0 +1,68 @@ +package model; + +import event.Event; +import observer.EventObserver; + +import java.time.LocalDateTime; +import java.io.Serializable; +import java.util.ArrayList; + +// Class to store app information behind the scene +public class CalendarModel implements Serializable { + + // list of events + ArrayList events; + + // color settings + public String colour; + public String colour_font; + + // list of goals that remain the same + private static ArrayList completedGoals = new ArrayList<>(); + + + // Constructor for no events + public CalendarModel() + { + this.events = new ArrayList(); + } + + // Constructor if some events are there + public CalendarModel(ArrayList events){ + this.events = events; + } + + // get list of completed goals + public static ArrayList getCompletedGoals() { + return completedGoals; + } + + // set completed goals + public static void setCompletedGoals(ArrayList oList) {completedGoals = oList;} + + // add an event to the calendar + public void addEvent(Event e) + { + this.events.add(e); + } + + // get the list of all events + public ArrayList getAllEvents(){ + return this.events; + } + + /** + * get events filtered by a date + */ + public ArrayList getEventsInTime(LocalDateTime time) + { + ArrayList filteredEvents = new ArrayList<>(); + for (Event e: this.events) + if (e.getTimeBehaviour().inTime(time)) + { + System.out.println(e.getName()); + filteredEvents.add(e); + } + return filteredEvents; + } +} diff --git a/observer/EventObserver.java b/observer/EventObserver.java new file mode 100644 index 0000000..fd0203e --- /dev/null +++ b/observer/EventObserver.java @@ -0,0 +1,15 @@ +package observer; + +/** + * Interface for Event Observers. Event Observers must be able to add an Event's points to themselves when they are + * notified that and Event is complete. + */ +public interface EventObserver { + + /** + * Add points to this observer's current point total. + * + * @param points the amount of points to be added + */ + boolean addPoints(int points); +} diff --git a/observer/Goal.java b/observer/Goal.java new file mode 100644 index 0000000..271dbfc --- /dev/null +++ b/observer/Goal.java @@ -0,0 +1,64 @@ +package observer; + +import java.io.Serializable; + +/** + * Class for the user's goals, which act as concrete Event Observers. A goal contains a name, amount of points currently + * gained, and amount of points needed. + */ +public class Goal implements EventObserver, Serializable { + + private String name; // The goal's name + private int currentPoints; // The amount of points the user has currently earned toward this goal + private final int pointsToBadge; // The amount of points that are required to complete this goal + + /** + * Constructor for the Goal class. Takes a name and a point value. + * + * @param name the name of the Goal + * @param p the amount of points required for completion + */ + public Goal(String name, int p) { + this.name = name; + this.pointsToBadge = p; + this.currentPoints = 0; + } + + + /** + * Add points to this observer's current point total. + * + * @param points the amount of points to be added + * @return true if the goal is complete, or false otherwise + */ + @Override + public boolean addPoints(int points) { + this.currentPoints += points; + return this.currentPoints >= this.pointsToBadge; + } + + /** + * Get this Goal's name + * + * @return this.name + */ + public String getName() {return this.name;} + + + /** + * Get the string representation of this goal. If the goal is incomplete, its string representation looks like this: + * name: currentPoints/pointsToBadge + * If the goal is complete, its string representation is only the name of the goal. + * + * @return the string representation of this goal + */ + @Override + public String toString() { + if (this.currentPoints >= this.pointsToBadge) { + return this.name; + } + else { + return this.name + ": " + this.currentPoints + "/" + this.pointsToBadge; + } + } +} diff --git a/observer/GoalTests.java b/observer/GoalTests.java new file mode 100644 index 0000000..acb5c36 --- /dev/null +++ b/observer/GoalTests.java @@ -0,0 +1,34 @@ +package observer; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class GoalTests { + + @Test + public void addPointsTest() { + Goal goalA = new Goal("goalA", 50); + goalA.addPoints(30); + goalA.addPoints(5); + assertEquals("goalA: 35/50", goalA.toString()); + } + + @Test + public void goalCompleteTest() { + Goal goalB = new Goal("goalB", 60); + assertEquals(true, goalB.addPoints(60)); + } + + @Test + public void testGoalToString() { + Goal goalC = new Goal("goalC", 100); + assertEquals("goalC: 0/100", goalC.toString()); + goalC.addPoints(50); + assertEquals("goalC: 50/100", goalC.toString()); + goalC.addPoints(50); + assertEquals("goalC", goalC.toString()); + goalC.addPoints(50); + assertEquals("goalC", goalC.toString()); + } +} diff --git a/out/production/The-Hamburglars/.gitignore b/out/production/The-Hamburglars/.gitignore new file mode 100644 index 0000000..1cdb928 --- /dev/null +++ b/out/production/The-Hamburglars/.gitignore @@ -0,0 +1,30 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +.out/ +.idea/ + +*.name + +*iml diff --git a/out/production/The-Hamburglars/.idea/.gitignore b/out/production/The-Hamburglars/.idea/.gitignore new file mode 100644 index 0000000..6073398 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/.gitignore @@ -0,0 +1,4 @@ +# Default ignored files +/shelf/ +/workspace.xml +/save/model.ser diff --git a/out/production/The-Hamburglars/.idea/libraries/javafx.xml b/out/production/The-Hamburglars/.idea/libraries/javafx.xml new file mode 100644 index 0000000..12d7e02 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/libraries/javafx.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/misc.xml b/out/production/The-Hamburglars/.idea/misc.xml new file mode 100644 index 0000000..3b29b6e --- /dev/null +++ b/out/production/The-Hamburglars/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/.idea/uiDesigner.xml b/out/production/The-Hamburglars/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/out/production/The-Hamburglars/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/The-Hamburglars.iml b/out/production/The-Hamburglars/The-Hamburglars.iml new file mode 100644 index 0000000..5d52380 --- /dev/null +++ b/out/production/The-Hamburglars/The-Hamburglars.iml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<<<<<<< HEAD + + + + + + + + + + + + + + + + +======= +>>>>>>> e4b52f77b1e1669b3b2bf81452780ef1c69c30fe + + \ No newline at end of file diff --git a/out/production/The-Hamburglars/save/model.ser b/out/production/The-Hamburglars/save/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..c0489c790c65c67ee5c537ff4a263267a0c21331 GIT binary patch literal 669 zcmY*WJx?1!5FMXQFklA}gb+fOBFYqZl#!q@!~w%0SpiWciZ=GzEIQvFyJLF;5)u+c z{y>Tpp`nF_l9Gm=iY9H+K!K1_q{_~o31N!U&BuHD=FQ113}^-8+pNp{4vNSxE5$yC zLZdmjDt)_T-?NaZLQacaZV~{<_Hy(kP+K;5tlUzw1FZglBab z$&NyJ5fXn8vA7kiqY`mzE`*V^`>`ow+<|=u;9VZ0MwmzeBq;bNXwD=E!?UK@50}ik zXf`!bP-L9GjMX>d*!&7{=5LOV=3kEg@*r1*;Y5lUH(Au-Rz`#Cx)KQr8TV!6V%FyU z|00SuU*KD;E8Hrj@JS)q_`huxS_Ml8-m*Z**JNvPi?tK0W%3EiC)7LZ2A3u&%?t%! zJn%vov_4V?VJh99KtU+$EPBI`Q_K1`q>(A4gd~m{qA$Ap(YU|P)z=S)=hHLGX9WP0 z^zs7$gFg$;?~U_l?4eNjZPE(4<~i3qqLQC9S6#0BCCQ>c7x(4sSEqaSo>eH;J4#tI zYh<6cx${wP$OYDDSt}oXb3PF7TZGK2dv}6T8x>nAKR*0$F4~1gD(Q$ + + + + + + + + + + + + + + + + + diff --git a/save/model.ser b/save/model.ser new file mode 100644 index 0000000000000000000000000000000000000000..ced79fe174c493eb8834c775acb03dc8d148092b GIT binary patch literal 376 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7?{ghKqN?0ZhlH?j-GR3PHJ9CVv#S1SALh{qnAZY6%zxq4+C3reolUAQ3->P56FD| zoW#6z{osma2Zsj zK>?U!00wDk#ULZV0PH@73fuw+AMoZU6{i-Jr55SA=O^a;I`rA`hSu6@pxZqec#}(u zihzy@$j=122*@u0GeYv65>wJseHd8s5_40*&IX5yE6{4!5(cJ#60p78K(0FwyOl67 OdZUN{6)`$iQ~&^)8EP^B literal 0 HcmV?d00001 diff --git a/timeBehaviour/TimeBehaviour.java b/timeBehaviour/TimeBehaviour.java new file mode 100644 index 0000000..5b7dc49 --- /dev/null +++ b/timeBehaviour/TimeBehaviour.java @@ -0,0 +1,28 @@ +package timeBehaviour; + +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * A TimeBehaviour interface. + */ +public interface TimeBehaviour extends Serializable +{ + + /** + * To get the time of the TimeBehaviour object. + * + * @return LocalDateTime time + */ + LocalDateTime getTime(); + + + /** + * To check if the timebehaviour is still in-time or not. + * + * @param time the time to check of the timeBehaviour is still in time or not. + * @return boolean true if the timebehaviour is still within the deadline, false otherwise. + */ + boolean inTime(LocalDateTime time); +} diff --git a/timeBehaviour/TimePoint.java b/timeBehaviour/TimePoint.java new file mode 100644 index 0000000..9a24726 --- /dev/null +++ b/timeBehaviour/TimePoint.java @@ -0,0 +1,48 @@ +package timeBehaviour; + +import java.time.LocalDateTime; + + +/** + * A TimePoint Class, a concrete class for TimeBehaviour with deadline. + */ +public class TimePoint implements TimeBehaviour +{ + private final LocalDateTime deadlineTime; // the deadline of the TimeBehaviour object. + + + /** + * Constructor for initializing the TimePoint timebehavior with the given deadline time. + * + * @param time LocalDateTime + */ + public TimePoint(LocalDateTime time) + { + this.deadlineTime = time; + } + + + /** + * To get the deadline time of an TimeBehaviour object. + * + * @return LocalDateTime deadline of the event. + */ + @Override + public LocalDateTime getTime() + { + return this.deadlineTime; + } + + + /** + * To check if the timebehaviour is still in-time or not. + * + * @param time the time to check of the timeBehaviour is still in time or not. + * @return boolean true if the timebehaviour is still within the deadline, false otherwise. + */ + @Override + public boolean inTime(LocalDateTime time) + { + return this.deadlineTime.toLocalDate().equals(time.toLocalDate()); + } +} diff --git a/timeBehaviour/TimeRange.java b/timeBehaviour/TimeRange.java new file mode 100644 index 0000000..e71c121 --- /dev/null +++ b/timeBehaviour/TimeRange.java @@ -0,0 +1,78 @@ +package timeBehaviour; + +import java.time.LocalDateTime; + + +/** + * A TimeRange Class, a concrete class for TimeBehaviour with a range of start time and end time. + */ +public class TimeRange implements TimeBehaviour +{ + private final LocalDateTime startTime; // the start time of the TimeBehaviour object. + + private final LocalDateTime endTime; // the end time of the TimeBehaviour object. + + + /** + * Constructor for initializing a TimeRange timebehaviour with given range of time. + * + * @param start_time_block the start time of the range. + * @param end_time_block the end time of the range. + */ + public TimeRange(LocalDateTime start_time_block, LocalDateTime end_time_block) + { + this.startTime = start_time_block; + this.endTime = end_time_block; + } + + + /** + * To get the Start time of the timebehaviour instance. + * + * @return startTime + */ + public LocalDateTime getStartTime() + { + return this.startTime; + } + + + /** + * To get the End Time of the timebehaviour instance. + * + * @return endTime + */ + public LocalDateTime getEndTime() + { + return this.endTime; + } + + + /** + * To get the time of the TimeBehaviour object. + * + * @return LocalDateTime time + */ + @Override + public LocalDateTime getTime() + { + return this.startTime; + } + + + /** + * To check if the timebehaviour is still in-time or not. + * + * @param time the time to check of the timeBehaviour is still in time or not. + * @return boolean true if the timebehaviour is still within the deadline, false otherwise. + */ + @Override + public boolean inTime(LocalDateTime time) + { + System.out.println(this.startTime.isBefore(time)); + System.out.println(this.endTime.isAfter(time)); + return (this.startTime.isBefore(time) && this.endTime.isAfter(time)) || + this.startTime.toLocalDate().equals(time.toLocalDate()) || + this.endTime.toLocalDate().equals(time.toLocalDate()); + } +} diff --git a/views/CalendarView.java b/views/CalendarView.java new file mode 100644 index 0000000..b0788e0 --- /dev/null +++ b/views/CalendarView.java @@ -0,0 +1,331 @@ +package views; + +import event.Event; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.fxml.FXMLLoader; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Node; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.DatePicker; +import javafx.scene.control.Label; +import javafx.scene.control.ListView; +import javafx.scene.control.skin.DatePickerSkin; +import javafx.scene.paint.Paint; +import javafx.scene.text.Font; +import javafx.scene.layout.*; +import javafx.stage.Stage; +import model.CalendarModel; +import observer.EventObserver; + + +import java.io.*; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.ArrayList; + + +public class CalendarView { + + //Below defines all the components we'll need + + //The main root + Stage stage; + + //The model that stores event information + CalendarModel model; + + //The sublayout that contains our calendar + AnchorPane calendarLayout; + + //The overall layout that contains everything + BorderPane realLayout; + + //Buttons used for functionality + Button makeEventButton; + Button makeGoalButton; + Button changeThemeButton; + Button viewGoalButton; + + //The calendar used to access events + DatePicker calendar; + + //A wrapper class used to help display the calendar in a better way + DatePickerSkin calendarSkin; + + // A node that takes the calendar and makes it always visible + Node calendarDisplay; + Button editButton; + + //Label showing the selected date + Label dateDisplay; + Button completeEventButton; + + //Variables for getting the background and text color to change window theme + static Paint colour = javafx.scene.paint.Color.valueOf("#FFFFFF"); + static Paint colour_font = javafx.scene.paint.Color.valueOf("#000000") ; + + // ListView to display event names for a specific date + ListView eventsView = new ListView<>(); + + // List to store events for a given date + ArrayList events = new ArrayList<>(); + + // static instance + static CalendarView instance; + + //Method to implement singleton design pattern + public static CalendarView getView(CalendarModel model, Stage stage){ + if (instance == null){ + instance = new CalendarView(model, stage); + } + return instance; + } + + // private constructor to enforce Singleton + private CalendarView(CalendarModel model, Stage stage){ + // Get a model + this.model = model; + + // load stored model info + loadModel(); + this.stage = stage; + + // Set up the layouts + this.calendarLayout = new AnchorPane(); + this.realLayout = new BorderPane(); + + // Create the UI + initUI(); + } + + // load stored info + public void loadModel() { + File folder = new File("save/"); + if (!folder.exists()) { + return; + } + File[] fileList = folder.listFiles(); + assert fileList != null; + for (File f : fileList) { + if (f.isFile() && f.getName().equals("model.ser")) { + try { + FileInputStream file = new FileInputStream("save/model.ser"); + ObjectInputStream in = new ObjectInputStream(file); + ArrayList loadList = (ArrayList) in.readObject(); + this.model = (CalendarModel) loadList.get(0); + Event.setObserverList((ArrayList) loadList.get(1)); + CalendarModel.setCompletedGoals((ArrayList) loadList.get(2)); + CalendarView.colour = javafx.scene.paint.Color.valueOf(this.model.colour); + CalendarView.colour_font = javafx.scene.paint.Color.valueOf(this.model.colour_font); + } catch (IOException | ClassNotFoundException e) { + throw new RuntimeException(e); + } + + } + } + } + + // Save our model + public void saveModel() { + this.model.colour = colour.toString(); + this.model.colour_font = colour_font.toString(); + File folder = new File("save/"); + if (!folder.exists()) { + folder.mkdir(); + } + File fModel = new File("save/model.ser"); + ArrayList saveList = new ArrayList<>(); + try { + saveList.add(this.model); + saveList.add(Event.getObserverList()); + saveList.add(CalendarModel.getCompletedGoals()); + FileOutputStream fout = new FileOutputStream(fModel); + ObjectOutputStream oos = new ObjectOutputStream(fout); + oos.writeObject(saveList); + } catch (IOException e) { + throw new RuntimeException(e); + } + + } + + private void initUI(){ + + // set the title of the screen + this.stage.setTitle("Chronos"); + + + //Make core screen + this.calendarLayout = new AnchorPane(); + this.realLayout = new BorderPane(); + + //make a DatePicker for our calendar, and then set up a display that keeps + // the calendar always active + calendar = new DatePicker(LocalDate.now()); + calendarSkin = new DatePickerSkin(calendar); + calendarDisplay = calendarSkin.getPopupContent(); + calendarDisplay.setScaleX(1.5); + calendarDisplay.setScaleY(1.5); + calendarDisplay.setLayoutX(100); + calendarDisplay.setLayoutY(100); + calendarLayout.getChildren().add(calendarDisplay); + calendarLayout.setPrefSize(400, 400); + calendarLayout.setBackground(new Background(new BackgroundFill(colour,null,null))); + + //Create the label to display the date + this.dateDisplay = new Label(calendar.getValue().toString()); + dateDisplay.setTextFill(colour_font); + dateDisplay.setFont(new Font(20)); + dateDisplay.setAlignment(Pos.TOP_CENTER); + //When a date is selected, update our list of events in the below + calendar.setOnAction(e ->{ + dateDisplay.setText(calendar.getValue().toString()); + this.displayEvents(calendar.getValue().atStartOfDay()); + }); + + //Create the button to make events + this.makeEventButton = new Button("Make Event"); + makeEventButton.setScaleX(1.15); + makeEventButton.setScaleY(1.15); + makeEventButton.setTextFill(colour_font); + makeEventButton.setOnAction(e -> { + EventCreatorView ecv = new EventCreatorView(this); + this.displayEvents(calendar.getValue().atStartOfDay()); + }); + + //Create the button to make goals + this.makeGoalButton = new Button("Make Goal"); + makeGoalButton.setScaleX(1.15); + makeGoalButton.setScaleY(1.15); + makeGoalButton.setTextFill(colour_font); + makeGoalButton.setOnAction(e -> { + NewGoalView ngv = new NewGoalView(this); + }); + + //Create the button to view + this.viewGoalButton = new Button("View Goal"); + viewGoalButton.setScaleX(1.15); + viewGoalButton.setScaleY(1.15); + viewGoalButton.setTextFill(colour_font); + viewGoalButton.setOnAction(e -> { + GoalListView glv = new GoalListView(this); + }); + + //Create Button for changing the theme + this.changeThemeButton = new Button("Change Theme"); + changeThemeButton.setTextFill(colour_font); + changeThemeButton.setScaleX(1.15); + changeThemeButton.setScaleY(1.15); + changeThemeButton.setOnAction(e -> { + // Configure the Color + FXMLLoader fxmlLoader = new FXMLLoader(CalendarView.class.getResource("ColorPick.fxml")); + Scene scene = null; + try { + Parent root1 = (Parent) fxmlLoader.load(); + Stage stage = new Stage(); + stage.setTitle("Chronos"); + stage.setScene(new Scene(root1)); + stage.show(); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + Color.cv = this; + }); + + //Create button bar + HBox buttons = new HBox(10); + buttons.setPadding(new Insets(30)); + buttons.getChildren().addAll(makeEventButton, makeGoalButton, viewGoalButton, changeThemeButton); + buttons.setPadding(new Insets(20)); + + //Create buttons for editing and completing events + this.editButton = new Button("Edit Event"); + this.editButton.setTextFill(colour_font); + editButton.setOnAction(e -> { + if (this.eventsView.getSelectionModel().getSelectedItem() != null){ + + for(Event i: this.events) + { + if(i.getName().equals(this.eventsView.getSelectionModel().getSelectedItem())) + { + EventEditorView editorView = new EventEditorView(this, i); + break; + } + } + } + else{ + System.out.println("Need to select an item"); + } + }); + + this.completeEventButton = new Button("Complete Event"); + this.completeEventButton.setTextFill(colour_font); + completeEventButton.setOnAction(e -> { + String eventName = this.eventsView.getSelectionModel().getSelectedItem(); + if (eventName == null){ + return; + } + //int index = 0; + Event completed = null; + for (Event event: this.events){ + if (event.getName() == eventName){ + completed = event; + completed.complete(); + break; + } + } + if (!(completed == null)){ + this.events.remove(completed); + this.model.getAllEvents().remove(completed); + this.saveModel(); + } + }); + + //Create bar for editing and completing events + HBox eventsManaging = new HBox(); + eventsManaging.getChildren().addAll(editButton, completeEventButton); + eventsManaging.setPadding(new Insets(20)); + + //Create view for events + VBox eventDisplay = new VBox(); + eventDisplay.setPadding(new Insets(20)); + this.displayEvents(LocalDateTime.now()); + eventDisplay.getChildren().addAll(dateDisplay, eventsView, eventsManaging); + + + //put everything together + realLayout.setCenter(calendarLayout); + realLayout.setBottom(buttons); + realLayout.setRight(eventDisplay); + realLayout.setBackground(new Background(new BackgroundFill(colour,null,null))); + + + + //Finally, display everything + Scene scene = new Scene(realLayout); + this.stage.setScene(scene); + this.stage.show(); + + } + + //Method to display events in the event list + private void displayEvents(LocalDateTime time) + { + //Get events that match the date + this.events = this.model.getEventsInTime(time); + + //Get their names + ArrayList eventNames = new ArrayList<>(); + for (Event e: this.events){ + eventNames.add(e.getName()); + } + + //Set the ListView to contain those names + ObservableList namesToDisplay = FXCollections.observableArrayList(eventNames); + this.eventsView.setItems(namesToDisplay); + } + +} diff --git a/views/Color.java b/views/Color.java new file mode 100644 index 0000000..46ab8f0 --- /dev/null +++ b/views/Color.java @@ -0,0 +1,92 @@ +package views; + +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.control.ColorPicker; +import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.Background; +import javafx.scene.layout.BackgroundFill; +import javafx.scene.shape.Circle; +import javafx.scene.text.Text; + +import java.net.URL; +import java.util.ResourceBundle; + + +/** + * Color class for handling color picker to choose background and font color as per user's choice + * + */ +public class Color implements Initializable +{ + public AnchorPane myPane2; // color picker for font change pane + public Circle circle2; // chosen color reflected shape for font + public Text text1; // text in color picker window + public Text text2; // text in color picker window + public AnchorPane myPane; // color picker for background change pane + @FXML + private Circle circle; // chosen color reflected shape for background + @FXML + private ColorPicker cp; // chosen color for background + @FXML + private ColorPicker cp2; // chosen color for font + @FXML + static CalendarView cv; // calendar view access + + + /** + * Choose a background theme for the application as per choice of user. + * + * @param actionEvent application's response if the user chooses his desired background color. + */ + public void handleColorPicker(ActionEvent actionEvent) + { + // Change the fill color for the circle when you pick a new color and get color value from user to change + // the background color for calendar's background and border layout. + circle.setFill(cp.getValue()); + cv.calendarLayout.setBackground(new Background(new BackgroundFill(cp.getValue(),null,null))); + cv.realLayout.setBackground(new Background(new BackgroundFill(cp.getValue(),null,null))); + + //Change the fill color for the circle when you pick a new color and get color value from the user to + // change background color for color picker window. + CalendarView.colour = cp.getValue(); + myPane.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); + cv.saveModel(); + } + + + /** + * Choose a font color for the application as per choice of user. + * + * @param actionEvent application's response if user chooses his desired font color. + */ + public void handleFontColor(ActionEvent actionEvent) { + // Colour Picker UI + circle2.setFill(cp2.getValue()); + CalendarView.colour_font = cp2.getValue(); + cv.makeEventButton.setTextFill(cp2.getValue()); + cv.makeGoalButton.setTextFill(cp2.getValue()); + cv.viewGoalButton.setTextFill(cp2.getValue()); + cv.changeThemeButton.setTextFill(cp2.getValue()); + cv.editButton.setTextFill(cp2.getValue()); + cv.completeEventButton.setTextFill(cp2.getValue()); + cv.dateDisplay.setTextFill(cp2.getValue()); + text1.setFill(cp2.getValue()); + text2.setFill(cp2.getValue()); + cv.saveModel(); + } + + /** + * Change the style of color picker + * + * @param url The location used to resolve relative paths for the root object, or null if the location is not known. + * @param resourceBundle The resources used to localize the root object,or null if the root object was not localized. + */ + @Override + public void initialize(URL url, ResourceBundle resourceBundle) + { + cp.getStyleClass().add(ColorPicker.STYLE_CLASS_SPLIT_BUTTON); + myPane.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); + } +} diff --git a/views/ColorPick.fxml b/views/ColorPick.fxml new file mode 100644 index 0000000..a78f9a5 --- /dev/null +++ b/views/ColorPick.fxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/views/EventCreatorView.java b/views/EventCreatorView.java new file mode 100644 index 0000000..f83c7ec --- /dev/null +++ b/views/EventCreatorView.java @@ -0,0 +1,270 @@ +package views; + +import event.Event; +import timeBehaviour.TimeBehaviour; +import timeBehaviour.TimePoint; +import timeBehaviour.TimeRange; + +import javafx.geometry.Insets; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.DatePicker; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.Background; +import javafx.scene.layout.BackgroundFill; +import javafx.scene.layout.VBox; +import javafx.scene.text.Font; +import javafx.stage.Modality; +import javafx.stage.Stage; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +/** + * A EventCreatorView class for handling the creation of events. + */ +public class EventCreatorView { + private final CalendarView calendarView; // the calendar view + private final TextField nameTextField = new TextField("Name"); // the name of the event + private final TextField pointsTextField = new TextField("Points"); // the points associated with the event + private final TextField descTextField = new TextField("Description"); // the description of the event + private final Button changeTimeButton = new Button("Choose start/end time"); // Button for changing the type of time of the event + private final DatePicker pointDatePicker = new DatePicker(LocalDate.now()); // DatePicker for TimePoint event + private final TextField pointTimePicker = new TextField("Time (hh:mm)"); // Deadline time for TimePoint event + private final DatePicker startDatePicker = new DatePicker(LocalDate.now()); // Start time DatePicker for TimeRange event + private final TextField startTimePicker = new TextField("Start time (hh:mm)"); // Start time for TimeRange event + private final DatePicker endDatePicker = new DatePicker(LocalDate.now()); // End time DatePicker for TimeRange event + private final TextField endTimePicker = new TextField("End time (hh:mm)"); // End time for TimeRange event + private final Button saveButton = new Button("Save Changes"); // Button for Saving the edited event + private final Label errorLabel = new Label(""); // the error message to display + + /** + * Constructor for the EventCreatorView Class. + * + * @param calendarView the application's CalendarView + */ + public EventCreatorView(CalendarView calendarView) { + this.calendarView = calendarView; + + + // Set up the stage + final Stage dialog = new Stage(); + dialog.initModality(Modality.APPLICATION_MODAL); + dialog.initOwner(calendarView.stage); + VBox dialogVbox = new VBox(20); + dialogVbox.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); + dialogVbox.setPadding(new Insets(20, 20, 20, 20)); + + + + // Font UI + Font f = new Font(16); + Label createEventLabel = new Label("Create a new event!"); + createEventLabel.setFont(f); + nameTextField.setFont(f); + pointsTextField.setFont(f); + descTextField.setFont(f); + changeTimeButton.setFont(f); + pointTimePicker.setFont(f); + pointDatePicker.setValue(this.calendarView.calendar.getValue()); + startTimePicker.setFont(f); + startDatePicker.setValue(this.calendarView.calendar.getValue()); + endDatePicker.setValue(this.calendarView.calendar.getValue()); + endTimePicker.setFont(f); + saveButton.setFont(f); + + + + // Buttons, TextFields, and Labels UI. + createEventLabel.setTextFill(CalendarView.colour_font); + changeTimeButton.setTextFill(CalendarView.colour_font); + saveButton.setTextFill(CalendarView.colour_font); + VBox vbox = new VBox(10, createEventLabel, nameTextField, pointsTextField, descTextField, changeTimeButton, pointDatePicker, pointTimePicker, saveButton, errorLabel); + dialogVbox.getChildren().add(vbox); + Scene scene = new Scene(dialogVbox, 400, 500); + dialog.setScene(scene); + dialog.show(); + dialog.setAlwaysOnTop(true); + + + + // On Action Function Calls. + saveButton.setOnAction(e -> createEvent()); + changeTimeButton.setOnAction(e -> { + if (vbox.getChildren().contains(pointDatePicker)) { + vbox.getChildren().remove(pointDatePicker); + vbox.getChildren().remove(pointTimePicker); + vbox.getChildren().remove(saveButton); + vbox.getChildren().remove(errorLabel); + pointDatePicker.setValue(this.calendarView.calendar.getValue()); + pointTimePicker.setText("Time (hh:mm)"); + changeTimeButton.setText("Choose single time"); + vbox.getChildren().add(startDatePicker); + vbox.getChildren().add(startTimePicker); + vbox.getChildren().add(endDatePicker); + vbox.getChildren().add(endTimePicker); + } else { + vbox.getChildren().remove(startDatePicker); + vbox.getChildren().remove(startTimePicker); + vbox.getChildren().remove(endDatePicker); + vbox.getChildren().remove(endTimePicker); + vbox.getChildren().remove(saveButton); + vbox.getChildren().remove(errorLabel); + startDatePicker.setValue(this.calendarView.calendar.getValue()); + startTimePicker.setText("Start time (hh:mm)"); + endDatePicker.setValue(this.calendarView.calendar.getValue()); + endTimePicker.setText("End time (hh:mm)"); + changeTimeButton.setText("Choose start/end time"); + vbox.getChildren().add(pointDatePicker); + vbox.getChildren().add(pointTimePicker); + } + vbox.getChildren().add(saveButton); + vbox.getChildren().add(errorLabel); + + }); + + } + + /** + * Create a new Event using the parameters given in the text fields and date pickers. + * Store this new Event in the CalendarModel's list of Events. + * + * @throws NumberFormatException for invalid input of integer in points field. + */ + private void createEvent() throws NumberFormatException { + + // Check if the Event's Name is not empty. + if (this.nameTextField.getText().trim().isEmpty() || this.nameTextField.getText().trim().isBlank()) { + this.errorLabel.setText("Please enter the Event Name. It can NOT be Blank!"); + return; + } + // Check if the event name is already in the events list. + else + { + String temp = this.nameTextField.getText().trim(); + for(Event i: this.calendarView.model.getAllEvents()) + { + if (temp.equals(i.getName())) + { + this.errorLabel.setText("Event Name already taken!"); + return; + } + } + } + // store the valid name + String event_name = this.nameTextField.getText().trim(); + + + // Check if the Event's Description is not empty. + if (this.descTextField.getText().trim().isEmpty() || this.descTextField.getText().trim().isBlank()) { + this.errorLabel.setText("Please enter the Event's Description. It can NOT be Blank!"); + return; + } + //Store the valid description + String event_description = this.descTextField.getText().trim(); + + + String points = String.valueOf(this.pointsTextField.getText()).trim(); + int event_points = 0; + // Check if the Event's associated Points are of integer type. + try { + event_points += Integer.parseInt(points); // store the valid points associated with the event. + } + catch (NumberFormatException e) + { + this.errorLabel.setText("Please enter a Integer value for the points associated with the event."); + return; + } + + + //Check the type of the time and create time range or time point based on that. + if (this.endTimePicker.getText().trim().isBlank() || this.endTimePicker.getText().trim().isEmpty() || this.startTimePicker.getText().trim().equals("Start time (hh:mm)") || this.endTimePicker.getText().trim().equals("End time (hh:mm)")) { + // Create a new Time Point object based on the deadline of the user. + + String deadline_hours = this.pointTimePicker.getText().trim(); + + Pattern pattern = Pattern.compile("^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"); + Matcher matcher = pattern.matcher(deadline_hours); + if (matcher.find()) { + // match found, valid deadline HH:mm. + String yyyy_mm_dd = this.pointDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + String yyyy_mm_dd_HH_mm = yyyy_mm_dd + " " + deadline_hours; + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); + LocalDateTime pointTime = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter); + + + // Create a TimePoint object. + TimeBehaviour tp = new TimePoint(pointTime); + + // Finally, create a new Event with the new TimePoint deadline time of the event. + Event e = new Event(event_name, event_description, event_points, tp); + + + // Add the event to the events list of CalendarView.model.events + this.calendarView.model.addEvent(e); + + // Save the event + this.calendarView.saveModel(); + + + //Success Message! + this.errorLabel.setText("Event Added to the Calendar!"); + } + else // Invalid Format of HH:mm + this.errorLabel.setText("Please Re-enter the time of the event. Enter in HH:mm format."); + } + else + { + // Create a new Time Range object based on the start-time and end-time of the user. + + String start_time = this.startTimePicker.getText().trim(); + String end_time = this.endTimePicker.getText().trim(); + + + Pattern pattern = Pattern.compile("^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"); + Matcher matcher = pattern.matcher(start_time); + Matcher matcher1 = pattern.matcher(end_time); + + if (matcher1.find() && matcher.find()) + { + // match found, valid deadline HH:mm. + String yyyy_mm_dd = this.startDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + String yyyy_mm_dd2 = this.endDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + String yyyy_mm_dd_HH_mm = yyyy_mm_dd + " " + start_time; + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); + LocalDateTime start_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter); + + String yyyy_mm_dd_HH_mm2 = yyyy_mm_dd2 + " " + end_time; + DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); + LocalDateTime end_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm2, formatter2); + + System.out.println(start_time_block + " " + end_time_block); + + + // Create a TimeRange object. + TimeBehaviour tr = new TimeRange(start_time_block, end_time_block); + + // Finally, create a new Event with the new TimeRange start and end time of the event block. + Event e = new Event(event_name, event_description, event_points, tr); + + + // Add the event to the events list of CalendarView.model.events + this.calendarView.model.addEvent(e); + + // Save the event + this.calendarView.saveModel(); + + //Success Message! + this.errorLabel.setText("Event Added to the Calendar!"); + } + else // Invalid Format of HH:mm + this.errorLabel.setText("Invalid Start/End time of the event. Enter in HH:mm format."); + } + } +} diff --git a/views/EventEditorView.java b/views/EventEditorView.java new file mode 100644 index 0000000..b799e11 --- /dev/null +++ b/views/EventEditorView.java @@ -0,0 +1,307 @@ +package views; + +import event.Event; +import timeBehaviour.TimeBehaviour; +import timeBehaviour.TimePoint; +import timeBehaviour.TimeRange; +import static views.CalendarView.colour; + +import javafx.geometry.Insets; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.DatePicker; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.Background; +import javafx.scene.layout.BackgroundFill; +import javafx.scene.layout.VBox; +import javafx.scene.text.Font; +import javafx.stage.Modality; +import javafx.stage.Stage; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +/** + * A EventEditorView class for handling the editing of events. + */ +public class EventEditorView +{ + private final CalendarView calendarView; // the calendar view + private final Event event; // the event to edit + private final TextField nameTextField = new TextField("Name"); // the name of the event + private final TextField pointsTextField = new TextField("Points"); // the points associated with the event + private final TextField descTextField = new TextField("Description"); // the description of the event + private final Button changeTimeButton = new Button("Choose start/end time"); // Button for changing the type of time of the event + private final DatePicker pointDatePicker = new DatePicker(LocalDate.now()); // DatePicker for TimePoint event + private final TextField pointTimePicker = new TextField("Time (hh:mm)"); // Deadline time for TimePoint event + private final DatePicker startDatePicker = new DatePicker(LocalDate.now()); // Start time DatePicker for TimeRange event + private final TextField startTimePicker = new TextField("Start time (hh:mm)"); // Start time for TimeRange event + private final DatePicker endDatePicker = new DatePicker(LocalDate.now()); // End time DatePicker for TimeRange event + private final TextField endTimePicker = new TextField("End time (hh:mm)"); // End time for TimeRange event + private final Button saveButton = new Button("Save Changes"); // Button for Saving the edited event + private final Label errorLabel = new Label(""); // the error message to display + + + /** + * Constructor for the EventEditorView Class. + * + * @param calendarView the application's CalendarView + * @param event the event to edit + */ + public EventEditorView(CalendarView calendarView, Event event) + { + this.calendarView = calendarView; + this.event = event; + + + + // Set up the stage + final Stage dialog = new Stage(); + dialog.initModality(Modality.APPLICATION_MODAL); + dialog.initOwner(calendarView.stage); + VBox dialogVbox = new VBox(20); + dialogVbox.setPadding(new Insets(20, 20, 20, 20)); + + + + // Font UI + Font f = new Font(16); + Label editEventLabel = new Label(""); + editEventLabel.setFont(f); + nameTextField.setFont(f); + pointsTextField.setFont(f); + descTextField.setFont(f); + changeTimeButton.setFont(f); + pointTimePicker.setFont(f); + startTimePicker.setFont(f); + endTimePicker.setFont(f); + saveButton.setFont(f); + errorLabel.setFont(f); + + + + // Buttons, TextFields, and Labels UI. + saveButton.setTextFill(CalendarView.colour_font); + editEventLabel.setTextFill(CalendarView.colour_font); + changeTimeButton.setTextFill(CalendarView.colour_font); + errorLabel.setTextFill(CalendarView.colour_font); + editEventLabel.setText("Edit Event: " + event.getName()); + nameTextField.setText(event.getName()); + pointsTextField.setText(String.valueOf(event.getPointValue())); + descTextField.setText(event.getDescription()); + dialogVbox.setBackground(new Background(new BackgroundFill(colour,null,null))); + VBox vbox = new VBox(10, editEventLabel, nameTextField, pointsTextField, descTextField, changeTimeButton, pointDatePicker, pointTimePicker, saveButton, errorLabel); + dialogVbox.getChildren().add(vbox); + Scene scene = new Scene(dialogVbox, 400, 500); + dialog.setScene(scene); + dialog.show(); + dialog.setAlwaysOnTop(true); + + + + // On Action Function Calls. + saveButton.setOnAction(e -> editEvent()); + changeTimeButton.setOnAction(e -> changeTime(vbox)); + + + + //If event has a time point: + if(event.getTimeBehaviour() instanceof TimePoint tp) + { + //set values of pointDatePicker and pointTimePicker to event's time + this.pointDatePicker.setValue(tp.getTime().toLocalDate()); + this.pointTimePicker.setText(tp.getTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")).substring(11,16)); + } + + //If event has a time range: + else + { + this.changeTime(vbox); + + //set values of startDatePicker, startTimePicker, endDatePicker and endTimePicker + TimeRange tr = (TimeRange) event.getTimeBehaviour(); + + this.startDatePicker.setValue(tr.getStartTime().toLocalDate()); + this.endDatePicker.setValue(tr.getEndTime().toLocalDate()); + + this.startTimePicker.setText(tr.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")).substring(11,16)); + this.endTimePicker.setText(tr.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")).substring(11,16)); + } + } + + + /** + * Edit the details of the event and save accordingly. + */ + private void editEvent() { + + // Check if the Event's Name is not empty. + if (this.nameTextField.getText().trim().isEmpty() || this.nameTextField.getText().trim().isBlank()) { + this.errorLabel.setText("Please enter the Event Name. It can NOT be Blank!"); + return; + } + // Check if the event name is already in the events list. + else + { + String temp = this.nameTextField.getText().trim(); + for(Event i: this.calendarView.model.getAllEvents()) + { + if (temp.equals(i.getName())) + { + this.errorLabel.setText("Event Name already taken!"); + return; + } + } + } + this.event.setName(this.nameTextField.getText().trim()); // edit name + + + // Check if the Event's Description is not empty. + if (this.descTextField.getText().trim().isEmpty() || this.descTextField.getText().trim().isBlank()) { + this.errorLabel.setText("Please enter the Event's Description. It can NOT be Blank!"); + return; + } + this.event.setDescription(this.descTextField.getText().trim()); // edit the description + + + String points = String.valueOf(this.pointsTextField.getText()).trim(); + int event_points = 0; + // Check if the Event's associated Points are of integer type. + try { + event_points += Integer.parseInt(points); + } catch (NumberFormatException e) { + this.errorLabel.setText("Please enter a Integer value for the points associated with the event."); + return; + } + this.event.setPointValue(event_points); // edit the points associated + + + + + if (this.endTimePicker.getText().trim().isBlank() || this.endTimePicker.getText().trim().isEmpty() || this.startTimePicker.getText().trim().equals("Start time (hh:mm)") || this.endTimePicker.getText().trim().equals("End time (hh:mm)")) + { + // Create a new Time Point object based on the deadline of the user. + String deadline_hours = this.pointTimePicker.getText().trim(); + + Pattern pattern = Pattern.compile("^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"); + Matcher matcher = pattern.matcher(deadline_hours); + + if (matcher.find()) + { + // match found, valid deadline HH:mm. + String yyyy_mm_dd = this.pointDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + + String yyyy_mm_dd_HH_mm = yyyy_mm_dd + " " + deadline_hours; + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); + LocalDateTime pointTime = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter); + + + // Create a TimePoint object. + TimeBehaviour tp = new TimePoint(pointTime); + this.event.setTimeBehaviour(tp); // edit the new deadline with timepoint object + + + //Success Message + this.errorLabel.setText("Event Added to the Calendar!"); + + // Save the event + this.calendarView.saveModel(); + } + + else // Invalid Format of HH:mm + this.errorLabel.setText("Please Re-enter the time of the event. Enter in HH:mm format."); + } + + else + { + // Create a new Time Range object based on the start-time and end-time of the user. + + String start_time = this.startTimePicker.getText().trim(); + String end_time = this.endTimePicker.getText().trim(); + + + Pattern pattern = Pattern.compile("^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"); + Matcher matcher = pattern.matcher(start_time); + Matcher matcher1 = pattern.matcher(end_time); + + if (matcher1.find() && matcher.find()) + { + // match found, valid deadline HH:mm. + String yyyy_mm_dd = this.startDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + String yyyy_mm_dd2 = this.endDatePicker.getValue().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + + String yyyy_mm_dd_HH_mm = yyyy_mm_dd + " " + start_time; + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); + LocalDateTime start_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm, formatter); + + String yyyy_mm_dd_HH_mm2 = yyyy_mm_dd2 + " " + end_time; + DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); + LocalDateTime end_time_block = LocalDateTime.parse(yyyy_mm_dd_HH_mm2, formatter2); + + System.out.println(start_time_block + " " + end_time_block); + + // Create a TimeRange object. + TimeBehaviour tr = new TimeRange(start_time_block, end_time_block); + + this.event.setTimeBehaviour(tr); // edit the timerange of the event. + + //Success Message! + this.errorLabel.setText("Event Added to the Calendar!"); + + // Save the event + this.calendarView.saveModel(); + } + + else // Invalid Format of HH:mm + this.errorLabel.setText("Invalid Start/End time of the event. Enter in HH:mm format."); + } + } + + + /** + * Switches between displaying input for time points/time ranges + * + * @param vbox a Vertical JavaFx Box + */ + private void changeTime(VBox vbox) + { + if (vbox.getChildren().contains(pointDatePicker)) + { + vbox.getChildren().remove(pointDatePicker); + vbox.getChildren().remove(pointTimePicker); + vbox.getChildren().remove(saveButton); + vbox.getChildren().remove(errorLabel); + pointDatePicker.setValue(LocalDate.now()); + pointTimePicker.setText("Time (hh:mm)"); + changeTimeButton.setText("Choose single time"); + vbox.getChildren().add(startDatePicker); + vbox.getChildren().add(startTimePicker); + vbox.getChildren().add(endDatePicker); + vbox.getChildren().add(endTimePicker); + } + else // Switch to Time-Range entry field. + { + vbox.getChildren().remove(startDatePicker); + vbox.getChildren().remove(startTimePicker); + vbox.getChildren().remove(endDatePicker); + vbox.getChildren().remove(endTimePicker); + vbox.getChildren().remove(saveButton); + vbox.getChildren().remove(errorLabel); + startDatePicker.setValue(LocalDate.now()); + startTimePicker.setText("Start time (hh:mm)"); + endDatePicker.setValue(LocalDate.now()); + endTimePicker.setText("End time (hh:mm)"); + changeTimeButton.setText("Choose start/end time"); + vbox.getChildren().add(pointDatePicker); + vbox.getChildren().add(pointTimePicker); + } + vbox.getChildren().add(saveButton); + vbox.getChildren().add(errorLabel); + } +} diff --git a/views/GoalCompleteView.java b/views/GoalCompleteView.java new file mode 100644 index 0000000..8b5e4e0 --- /dev/null +++ b/views/GoalCompleteView.java @@ -0,0 +1,56 @@ +package views; + +import javafx.geometry.Insets; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.layout.Background; +import javafx.scene.layout.BackgroundFill; +import javafx.scene.layout.VBox; +import javafx.scene.text.Font; +import javafx.stage.Stage; +import observer.EventObserver; +import observer.Goal; + +import static views.CalendarView.colour; + +/** + * A window that notifies the user when they have completed one of their goals. + */ +public class GoalCompleteView { + + private Label completeLabel = new Label(""); // Message that tells the user which goal has been completed + private Button okButton = new Button("OK"); // Button to close this window + + /** + * Constructor + * + * @param o the goal which has been completed + */ + public GoalCompleteView(Goal o) { + final Stage dialog = new Stage(); + VBox dialogVbox = new VBox(20); + dialogVbox.setPadding(new Insets(20, 20, 20, 20)); + dialogVbox.setBackground(new Background(new BackgroundFill(colour,null,null))); + completeLabel.setText("Congratulations! You completed your goal: " + o.getName()); + Font f = new Font(16); + completeLabel.setFont(f); + completeLabel.setTextFill(CalendarView.colour_font); + okButton.setFont(f); + okButton.setTextFill(CalendarView.colour_font); + + + okButton.setOnAction(e -> { + dialog.close(); + }); + + VBox vbox = new VBox(10, completeLabel, okButton); + dialogVbox.getChildren().add(vbox); + Scene scene = new Scene(dialogVbox, 400, 100); + dialog.setScene(scene); + dialog.show(); + dialog.setAlwaysOnTop(true); + } + + +} \ No newline at end of file diff --git a/views/GoalListView.java b/views/GoalListView.java new file mode 100644 index 0000000..173c373 --- /dev/null +++ b/views/GoalListView.java @@ -0,0 +1,85 @@ +package views; + +import javafx.scene.layout.Background; +import javafx.scene.layout.BackgroundFill; +import javafx.scene.paint.Paint; +import model.CalendarModel; +import event.Event; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.geometry.Insets; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.control.ListView; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import javafx.scene.text.Font; +import javafx.stage.Stage; +import observer.EventObserver; + +import java.util.ArrayList; + +import static views.CalendarView.colour; + +/** + * GUI for the user to view their existing Goals. Shows ongoing Goals and completed Goals separately. + */ +public class GoalListView { + + CalendarView calendarView; // The application's CalendarView + private Paint colour; // The background colour + + /** + * Constructor + * + * @param calendarView the application's CalendarView + */ + public GoalListView(CalendarView calendarView) { + this.calendarView = calendarView; + this.colour = CalendarView.colour; + + final Stage dialog = new Stage(); + Label labelOngoing = new Label("Ongoing goals:"); + labelOngoing.setFont(new Font(16)); + labelOngoing.setTextFill(CalendarView.colour_font); + Label labelComplete = new Label("Completed goals:"); + labelComplete.setFont(new Font(16)); + labelComplete.setTextFill(CalendarView.colour_font); + + ArrayList goalsOngoingList = new ArrayList<>(); + for (EventObserver o : Event.getObserverList()) { + goalsOngoingList.add(o.toString()); + } + ObservableList goalsOngoing = FXCollections.observableArrayList(goalsOngoingList); + ListView listViewOngoing = new ListView<>(goalsOngoing); + listViewOngoing.setMaxSize(200, 200); + + ArrayList goalsCompleteList = new ArrayList<>(); + for (EventObserver o : CalendarModel.getCompletedGoals()) { + goalsCompleteList.add(o.toString()); + } + ObservableList goalsComplete = FXCollections.observableArrayList(goalsCompleteList); + ListView listViewComplete = new ListView<>(goalsComplete); + listViewComplete.setMaxSize(200, 200); + + VBox vboxOngoing = new VBox(20); + vboxOngoing.setPadding(new Insets(20, 20, 20, 20)); + vboxOngoing.getChildren().addAll(labelOngoing, listViewOngoing); + vboxOngoing.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); + + VBox vboxComplete = new VBox(20); + vboxComplete.setPadding(new Insets(20, 20, 20, 20)); + vboxComplete.getChildren().addAll(labelComplete, listViewComplete); + vboxComplete.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); + + HBox hbox = new HBox(20); + hbox.setPadding(new Insets(20, 20, 20, 20)); + hbox.getChildren().addAll(vboxOngoing, vboxComplete); + hbox.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); + + Scene scene = new Scene(hbox, 400, 400); + dialog.setScene(scene); + dialog.show(); + dialog.setAlwaysOnTop(true); + } +} diff --git a/views/NewGoalView.java b/views/NewGoalView.java new file mode 100644 index 0000000..de83a6d --- /dev/null +++ b/views/NewGoalView.java @@ -0,0 +1,109 @@ +package views; + +import event.Event; +import javafx.geometry.Insets; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.Background; +import javafx.scene.layout.BackgroundFill; +import javafx.scene.layout.VBox; +import javafx.scene.paint.Paint; +import javafx.scene.text.Font; +import javafx.stage.Modality; +import javafx.stage.Stage; +import observer.Goal; + +import static views.CalendarView.colour; + +/** + * GUI for the user to create new Goals. Allows the user to choose a name and amount of points required to complete the + * goal. + */ +public class NewGoalView { + + CalendarView calendarView; // The application's CalendarView + private Paint colour; // The background colour + private Label createGoalLabel = new Label("Create a new goal! Enter a name and point value."); // Text label at the top of the window + private TextField goalNameTextField = new TextField("Name"); // Text field to enter the new goal's name + private TextField goalPointsTextField = new TextField("Points"); // Text field to enter a number of points + private Label errorLabel = new Label(""); // Label to display whether the goal was created successfully or not + private Button saveButton = new Button("Save Goal"); // Button to create and save the new goal + + /** + * Constructor + * + * @param calendarView the application's CalendarView + */ + public NewGoalView(CalendarView calendarView) { + this.calendarView = calendarView; + this.colour = CalendarView.colour; + + final Stage dialog = new Stage(); + dialog.initModality(Modality.APPLICATION_MODAL); + dialog.initOwner(calendarView.stage); + VBox dialogVbox = new VBox(20); + dialogVbox.setPadding(new Insets(20, 20, 20, 20)); + + createGoalLabel.setId("createGoalLabel"); + createGoalLabel.setTextFill(CalendarView.colour_font); + createGoalLabel.setFont(new Font(16)); + createGoalLabel.setTextFill(CalendarView.colour_font); + goalNameTextField.setId("goalNameTextField"); + goalNameTextField.setFont(new Font(16)); + goalPointsTextField.setId("goalPointsTextField"); + goalPointsTextField.setFont(new Font(16)); + errorLabel.setId("errorLabel"); + errorLabel.setTextFill(CalendarView.colour_font); + errorLabel.setFont(new Font(16)); + saveButton.setId("saveButton"); + saveButton.setTextFill(CalendarView.colour_font); + saveButton.setFont(new Font(16)); + dialogVbox.setBackground(new Background(new BackgroundFill(colour,null,null))); + + saveButton.setOnAction(e -> createGoal()); + errorLabel.setTextFill(CalendarView.colour_font); + + VBox createGoalBox = new VBox(10, createGoalLabel, goalNameTextField, goalPointsTextField, errorLabel, saveButton); + createGoalBox.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); + + + dialogVbox.getChildren().add(createGoalBox); + dialogVbox.setBackground(new Background(new BackgroundFill(CalendarView.colour,null,null))); + Scene dialogScene = new Scene(dialogVbox, 400, 400); + dialog.setScene(dialogScene); + dialog.show(); + dialog.setAlwaysOnTop(true); + } + + + /** + * Create a new Goal using the configurations given in goalNameTextField and goalPointsTextField. Add the new Goal + * to the observerLists of all Events. + */ + private void createGoal() { + try { + int points = Integer.parseInt(goalPointsTextField.getText()); + + String name; + if (!goalNameTextField.getText().isEmpty()) { + name = goalNameTextField.getText(); + } + else { + errorLabel.setText("Enter a name for the goal!"); + return; + } + + Goal goal = new Goal(name, points); + Event.getObserverList().add(goal); + this.calendarView.saveModel(); + errorLabel.setText("Goal " + "\"" + goal.getName() + "\"" + " created!"); + + } + catch (NumberFormatException e) { + errorLabel.setText("Invalid number of points!"); + } + + } +} \ No newline at end of file