All Packages Class Hierarchy This Package Previous Next Index
This provides a way for a functional class to be controlled a GUI interface. It assumes a simple model in which the class has one or more modes that it can operate under and that each mode is identified by a name. Only one mode can be enabled at a time. Each mode can optionally have addition mode-specific options that can be controlled as well.
This interface is implemented by the class that provides the GUI, while the class to be controlled implements the ModedGUIControllable class. In addition to the methods defined here, the GUI class's interface should also provide a way to "attach" the class being controlled. When the controlled class is attached, the GUI class should call the other's initModedGUI() method. This allows the controlled class to carry out any necessary initialization, including calling the GUI's addMode() method to register the different modes.
The addMode() is used to register modes of operation. The name given should not only be used as an identifying display within the GUI (e.g. as a string in a Choice menu of selectable modes), but it should also be the that will engage that mode when it is based to the ModedGUIControllable's useMode() method. An AWT Component can optionally be given to the addMode() method as well. This Component should be enabled whenever the mode it is associated with is engaged. How the component is engaged is up to the GUI class. For example, it can hide the Component when the associated mode is not engaged.
For an example use of the ModedGUI and ModeGUIControllable interfaces, see the TransferFunction and TransferFunctionPanel classes. In this example, the TransferFunctionPanel provides GUI components that are needed by all TransferFunctions (controlled via TransferFunction methods); it also allows access to features specific to TransferFunction subclasses via the ModedGUI/ModedGUIControllable interfaces.
public abstract void addMode(String modeName,
Component optionsControl)
All Packages Class Hierarchy This Package Previous Next Index