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 0000000..c0489c7
Binary files /dev/null and b/out/production/The-Hamburglars/save/model.ser differ
diff --git a/out/production/The-Hamburglars/views/ColorPick.fxml b/out/production/The-Hamburglars/views/ColorPick.fxml
new file mode 100644
index 0000000..a78f9a5
--- /dev/null
+++ b/out/production/The-Hamburglars/views/ColorPick.fxml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/save/model.ser b/save/model.ser
new file mode 100644
index 0000000..ced79fe
Binary files /dev/null and b/save/model.ser differ
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