commented java files a little more, added initial UI redesign report

git-svn-id: svn://anubis/gvsu@467 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
josh 2009-12-05 15:32:48 +00:00
parent 6231771a1a
commit 4db518413c
3 changed files with 15 additions and 1 deletions

View File

@ -55,6 +55,10 @@ class RetirementCalculatorPanel
new ComboChoice(97, "97 (Female; 90th percentile)") 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 static int row = 0;
private void addRow(JPanel panel, JComponent c1, JComponent c2) private void addRow(JPanel panel, JComponent c1, JComponent c2)
{ {
@ -254,11 +258,13 @@ class RetirementCalculatorPanel
{ {
if (e.getComponent().getClass() == JTextField.class) if (e.getComponent().getClass() == JTextField.class)
{ {
/* select all text of a text box */
((JTextField) e.getComponent()).selectAll(); ((JTextField) e.getComponent()).selectAll();
} }
String tooltip = myToolTips.get(e.getComponent()); String tooltip = myToolTips.get(e.getComponent());
if (tooltip != null) if (tooltip != null)
{ {
/* update the tooltip for the newly selected field */
if (tooltip.indexOf("<br") < 0) if (tooltip.indexOf("<br") < 0)
{ {
tooltip = tooltip + "<br/> &nbsp; "; tooltip = tooltip + "<br/> &nbsp; ";
@ -269,6 +275,7 @@ class RetirementCalculatorPanel
public void focusLost(FocusEvent e) public void focusLost(FocusEvent e)
{ {
/* we are not interested in this event */
} }
private void calculate() private void calculate()

View File

@ -1,9 +1,16 @@
import java.util.*; 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 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<String, Double> myFields; private HashMap<String, Double> myFields;
public RetirementCalculatorModel() public RetirementCalculatorModel()

Binary file not shown.