diff --git a/cs623/proj1/RetirementCalculator.java b/cs623/proj1/RetirementCalculator.java index 2c9e704..9f6a4d1 100644 --- a/cs623/proj1/RetirementCalculator.java +++ b/cs623/proj1/RetirementCalculator.java @@ -55,6 +55,10 @@ class RetirementCalculatorPanel new ComboChoice(97, "97 (Female; 90th percentile)") }; + /* + * These helper functions facilitate adding rows of user interface + * elements to the JPanel. + */ private static int row = 0; private void addRow(JPanel panel, JComponent c1, JComponent c2) { @@ -254,11 +258,13 @@ class RetirementCalculatorPanel { if (e.getComponent().getClass() == JTextField.class) { + /* select all text of a text box */ ((JTextField) e.getComponent()).selectAll(); } String tooltip = myToolTips.get(e.getComponent()); if (tooltip != null) { + /* update the tooltip for the newly selected field */ if (tooltip.indexOf("   "; @@ -269,6 +275,7 @@ class RetirementCalculatorPanel public void focusLost(FocusEvent e) { + /* we are not interested in this event */ } private void calculate() diff --git a/cs623/proj1/RetirementCalculatorModel.java b/cs623/proj1/RetirementCalculatorModel.java index 610b7ee..262af30 100644 --- a/cs623/proj1/RetirementCalculatorModel.java +++ b/cs623/proj1/RetirementCalculatorModel.java @@ -1,9 +1,16 @@ import java.util.*; +/* + * This class implements the model portion of the Retirement Calculator + * project. + * Its methods could be invoked by different view or controller classes. + */ public class RetirementCalculatorModel { - /* input fields */ + /* Hold fields in a hash instead of declaring each in a separate + * variable -- this is more scalable. + * (Interface documentation which fields need to be set) */ private HashMap myFields; public RetirementCalculatorModel() diff --git a/cs623/proj1/UI redesign report.odt b/cs623/proj1/UI redesign report.odt new file mode 100644 index 0000000..c08f086 Binary files /dev/null and b/cs623/proj1/UI redesign report.odt differ