/Users/lyon/j4p/src/gui/touchtone/TouchToneModel.java

1    package gui.touchtone; 
2     
3    import gui.run.RunTextFieldOld; 
4     
5    /** 
6     * Maintain state internally, so that the textfield 
7     * controller and view are consistent with the 
8     * keyboard controller and view. 
9     */ 
10   public class TouchToneModel { 
11       // the state of the system. 
12    
13       private String stateString = ""; 
14    
15       private gui.run.RunTextFieldOld textFieldOld 
16               = new RunTextFieldOld("", 24) { 
17                   public void run() { 
18                       setStateString(getText()); 
19                   } 
20               }; 
21    
22       public void dialPadKey(String s) { 
23           stateString = stateString + s; 
24           textFieldOld.setText(stateString); 
25       } 
26    
27       public void setStateString(String _s) { 
28           stateString = _s; 
29       } 
30    
31       public String getStateString() { 
32           return stateString; 
33       } 
34    
35       public void setTextField(gui.run.RunTextFieldOld tf) { 
36           this.textFieldOld = tf; 
37       } 
38    
39       public RunTextFieldOld getTextField() { 
40           return textFieldOld; 
41       } 
42   }