Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QUESTION 1
- Grade: 0.95
- File: BasicWorksheetModel, Line: 72
- The only problem that we had with our previous model design was dealing with multiple recursive cell formulas. Previously, when we created a cell, we would add the cell to the hashtable without trying to evaluate it, which caused a runtime error. Now, we try to evaluate the cell's formula before putting it in the hashtable to avoid runtime errors and it works perfectly.
- QUESTION 2
- Textual view:
- This was fairly simple; we used the toString method to evaluate the text input and return a textual evaluated version of the spreadsheet.
- Graphics view:
- We used the JTable for our GUI implementation, so we had to use a wrapper class to make our spreadsheet's data model compatible with JTable. The other problem we had to tackle was creating row headers. We have a class that gets the data required to be displayed for row headers (i.e. 1, 2, 3) and another class that actually renders the header as a JLabel.
- Most of this is described in the README file. If any details are unclear, please reach out to us.
- QUESTION 3
- Properties:
- The hashtable variable is simply our data model, which includes a Coord key and Cell value.
- ValueTable is intended to be the evaluated version of the hashtable; we thought we would create this to avoid recursion, but we later found out a better way of handling recursion (as previously described).
- OrderedCoords was also initially intended to avoid recursion; once we found a better way of handling recursion, we decided just to keep it because it does not make a difference in our program's functionality.
- Our model mainly relies on the hashtable as the data model. (need to continue).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement