diff options
author | Ian Valentin Christensen <valentianchristensen@gmail.com> | 2025-04-30 20:54:55 +0200 |
---|---|---|
committer | Ian Valentin Christensen <valentianchristensen@gmail.com> | 2025-04-30 20:54:55 +0200 |
commit | cff947f57fd6d61561cf8e7f99ab7d9556cf0fc4 (patch) | |
tree | 47a5bca77ca33cbae12a69694b6d1e7ef612f71b /portfolio2.md | |
parent | 7f61d517a311cd52efea162448c400495b771428 (diff) |
write chapter for pf2
Diffstat (limited to 'portfolio2.md')
-rw-r--r-- | portfolio2.md | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/portfolio2.md b/portfolio2.md new file mode 100644 index 0000000..9664316 --- /dev/null +++ b/portfolio2.md @@ -0,0 +1,55 @@ +# Graphical user interface with Java FX + +The functionality of the user interface is fundamentally tied +to the database. +The database is created and filled with activities based on +the class "Model" supplied together with the assignment. + +We have tried to keep a strict separation between Model, View and Controller. +The view class knows what is on screen, +but never how it is processed by the controller. +It knows what arguments to pass on to the controller +and in some cases what it can expect to receive. + +The GUI itself is created based on a helper class GUI.java +consisting of a public enum containing a category name used for columns +and a number corresponding to the order the elements are shown in. +The start() function in Window.java, handling the view, +creates a List "columns" using the record ActivityColumn. +There is a lot of repetition in creating the layouts for the columns, +so the record allows us to cycle through columns based on the column and +label objects in the GUI class. +This cycle is where we assign functions to each button after creation. + +<!--TODO: create E/R diagram--> + +<!--TODO: make database with init_db.txt--> + +The database is filled with the init_db.txt file +based on the commands in there. +A participation table is created to bridge courses to the student +to avoid many to many relationships, +as shown in the E/R diagram. + +getSumEcts() in Database.java returns the result of a query +constructed to return the sum of ECTS for a given program. +It does not currently work for elective activities, +as that would require a redesign of the database or a helper class +that would make the code "inconsistent". <!--maybe find better word--> + +The backend was really created alongside the UI, +as we felt that was the most intuitive way to go about things. + + + +<!--TODO: fix duplicate activities--> + +<!--TODO: add label for subtotal ECTS--> + +As the screenshot shows, +it's not possible to choose the same subject module in both boxes. +ECTS is calculated dynamically as new activities are added. +Fonts and styling is consistent across columns, +and new columns could in theory be added easily as the code +is modular and reusable. + |