01: /*************************************************************************
02: * *
03: * 1) This source code file, in unmodified form, and compiled classes *
04: * derived from it can be used and distributed without restriction, *
05: * including for commercial use. (Attribution is not required *
06: * but is appreciated.) *
07: * *
08: * 2) Modified versions of this file can be made and distributed *
09: * provided: the modified versions are put into a Java package *
10: * different from the original package, edu.hws; modified *
11: * versions are distributed under the same terms as the original; *
12: * and the modifications are documented in comments. (Modification *
13: * here does not include simply making subclasses that belong to *
14: * a package other than edu.hws, which can be done without any *
15: * restriction.) *
16: * *
17: * David J. Eck *
18: * Department of Mathematics and Computer Science *
19: * Hobart and William Smith Colleges *
20: * Geneva, New York 14456, USA *
21: * Email: eck@hws.edu WWW: http://math.hws.edu/eck/ *
22: * *
23: *************************************************************************/package edu.hws.jcm.awt;
24:
25: /**
26: * An InputObject represents some sort of value that can be changed
27: * by, for example, user interaction with a GUI element. The value can
28: * actually change only when the checkInput() method is called. Generally,
29: * an InputObject is a GUI element with an associated MathObject such as
30: * a Variable or Expression. For example, a VariableInput is a text-input
31: * box where the user can enter the value of a Variable. However, the
32: * input is only checked and the value of the variable can only change
33: * when the VariableInput's checkInput() method is called. The checkInput()
34: * method is generally meant to be called by a Controller object. The
35: * checkInput() method should throw a JCMError if an error occurs.
36: * See the Controller class for more information.
37: *
38: * @author David Eck
39: */
40: public interface InputObject extends java.io.Serializable {
41:
42: /**
43: * Check and possibly change the value associated with this InputObject.
44: */
45: public void checkInput();
46:
47: /**
48: * This method was introduced to provide a common interface for setting
49: * a Controller that is to be notified when there is a change in the
50: * InputObject. (This was introduced late in development, to be used
51: * by edu.hws.jcm.awt.JCMPanel.gatherInputs(). In all the standard
52: * classes that implement the InputObject interface, this method
53: * simply calls a setOnChange or setOnUserAction method.)
54: */
55: public void notifyControllerOnChange(Controller c);
56:
57: } // end interface InputObject
|