diff options
author | ArghKevin <kagheli@student.sdccd.edu> | 2024-05-25 20:51:17 -0700 |
---|---|---|
committer | ArghKevin <kagheli@student.sdccd.edu> | 2024-05-25 20:51:17 -0700 |
commit | f2ab466a586d4f9482e92c0248c96150de13a2a7 (patch) | |
tree | 2141638250d61560c32da65872939d9e8d98cce6 | |
parent | 9bdcdffa230d328a7aeee76c8023089957e726d6 (diff) |
Finalize README and program comments in preparation for submission.main
-rw-r--r-- | README.md | 45 | ||||
-rw-r--r-- | src/CSVReader.java | 1 | ||||
-rw-r--r-- | src/ComparisonView.java | 2 | ||||
-rw-r--r-- | src/FamilyButton.java | 1 | ||||
-rw-r--r-- | src/FamilyButtonListener.java | 2 | ||||
-rw-r--r-- | src/JSONReader.java | 1 | ||||
-rw-r--r-- | src/MetadataView.java | 1 |
7 files changed, 52 insertions, 1 deletions
@@ -177,3 +177,48 @@ The project current fulfills all LOs except LO6. I'll be working on that next. I have until the 25th. It's the 20th. 5 days left. ![week5](week5.png) ![week6](week6.png) + +## Weeks 7 and 8: Finishing +The graphical user interface is complete. Interactive buttons associated with each font family +have been added. Their colors match with the color of their associated line. +When a button is toggled, a view of its associated font family's metadata is shown. +The comments have been checked over. + +![week7](week7.png) +![week8](week8.png) + +### Reflection + +Reflecting on the project, I am glad that I chose something relatively ambitious. +Though the project equals roughly 1000 lines of code, and is considerably larger than the minimum +acceptable effort, I am glad that I produced something which genuinely piques my interest. + +I made plenty of design changes. I basically understood the design of the program at the beginning, though +the details naturally didn't exist yet. I knew that it would be several hundred lines of code, though I didn't +know how many exactly. My best guesstimate near the start was closer to 600 than 1000. +I didn't expect JSON parsing to be as painful as it was. In hindsight, I was well aware +that I knew very little about properly parsing JSON. I still don't know much, as I used +the exact format of the provided JSON data as a crutch. Actually parsing the several kinds +of braces would have been much more work. + +I didn't initially account for the disk size of the actual font data. 2GB is too large +for today's networks to quickly distribute. It's a matter of downloading over the course +of minutes instead of seconds. To remedy this, I kept only the metadata files included +with the font families, and removed the actual font data from the git history. + +There is more that I would have liked to have done. Being able to collate the font families +into their distinct styles, as outlines in families.csv, would have been useful. Further, +being able to change the time metric used for measuring views during program runtime +would allow further insight. As it is, the view provided is relatively static. Easier +to read than manually parsing the three distinct files which contain data on each family, +yet still less than totally satisfying. + +If I were to restart the writing of the program from scratch, I would look for a parter +who enjoys writing the graphical front-ends of programs. That kind of code gets ugly +quickly. Ideally, a partner would also remain engaged throughout the project. +It is what it is. I enjoyed the project regardless. The workload was occasionally heavy, +though on the whole rewarding. + +### Learning Objective Demonstration + +https://mesacsclub.com/kaa/learning.mp4 diff --git a/src/CSVReader.java b/src/CSVReader.java index 62e7845..fe7d18b 100644 --- a/src/CSVReader.java +++ b/src/CSVReader.java @@ -16,6 +16,7 @@ import java.util.Arrays; * Read from and interpret CSV files. */ +// CSVReader is a reader public class CSVReader extends Reader { private String[] header; // A CSV file has-a header. One line, multiple fields. // Array of HashMaps. Headers are keys, values are on each line of the CSV following the header. diff --git a/src/ComparisonView.java b/src/ComparisonView.java index 636cd18..c74de02 100644 --- a/src/ComparisonView.java +++ b/src/ComparisonView.java @@ -30,7 +30,7 @@ public class ComparisonView extends JFrame { private Font textFont; // A ComparisonView has a preferred text font private Font buttonFont; // A ComparisonView has a preferred button font private final int TEXT_SIZE = 20; // A ComparisonView has a constant text size. - private FamilyButton buttons[]; // A ComparisonView has an array of buttons. + private FamilyButton[] buttons; // A ComparisonView has an array of buttons. private final int BUTTON_MAX = 10; // A ComparisonView has a set maximum number of buttons. /** diff --git a/src/FamilyButton.java b/src/FamilyButton.java index 994e848..0bef3df 100644 --- a/src/FamilyButton.java +++ b/src/FamilyButton.java @@ -14,6 +14,7 @@ import javax.swing.JToggleButton; * Provide an interative button to toggle FontFamily metadata. */ +// FamilyButton is a JToggleButton public class FamilyButton extends JToggleButton { private FontFamily family; // A FamilyButton has-a font family diff --git a/src/FamilyButtonListener.java b/src/FamilyButtonListener.java index 95a4bc4..906b349 100644 --- a/src/FamilyButtonListener.java +++ b/src/FamilyButtonListener.java @@ -12,6 +12,8 @@ import java.awt.event.*; * Purpose of class: * Listen for state changes in an instantiation of FamilyButton. */ + +// FamilyButtonListener is an ItemListener public class FamilyButtonListener implements ItemListener { private MetadataView metadataView; // A FamilyButtonListener has a metadataView diff --git a/src/JSONReader.java b/src/JSONReader.java index 4cc72ad..6f0bbdb 100644 --- a/src/JSONReader.java +++ b/src/JSONReader.java @@ -21,6 +21,7 @@ import java.io.*; * Read from and interpret JSON files. */ +// JSONReader is a Reader public class JSONReader extends Reader { /* metadata.pb is not exactly JSON, but so close to it that it's practically a subset of JSON with fewer quotation diff --git a/src/MetadataView.java b/src/MetadataView.java index 5837aca..46cfd24 100644 --- a/src/MetadataView.java +++ b/src/MetadataView.java @@ -15,6 +15,7 @@ import java.awt.*; * Provide an area to show metadata. */ +// MetadataView is a JTextArea public class MetadataView extends JTextArea { // A MetadataView has-a default text. private final String defaultText = "Toggle a font family using a colorful button below.\n" + |