All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class programming101.calculBeanz.DisplayField

java.lang.Object
    |
    +----java.awt.Component
            |
            +----java.awt.TextComponent
                    |
                    +----java.awt.TextField
                            |
                            +----programming101.calculBeanz.DisplayField

public class DisplayField
extends TextField
implements Control, ModelListener, TextListener
Entry of new values and display of cumulative values. This is the V-component of the Model-View-Control (MVC) design pattern.

This class

Since:
15/03/98
Version:
1.2 (6/04/98)
Author:
©1998 Peter T. Sander

Constructor Index

 o DisplayField()
No-args constructor (needed for JavaBeans).

Method Index

 o addControlListener(ControlListener)
Registers another listener to be informed when text is entered.
 o fireControlEvent(ControlEvent)
Fires a text event to registered listeners.
 o getPreferredSize()
Determines size of display area.
 o removeControlListener(ControlListener)
Removes a listener.
 o textValueChanged(TextEvent)
Method guaranteed by implementing the TextListener interface.
 o update(ModelEvent)
Method guaranteed by implementing the ModelListener interface.

Constructors

 o DisplayField
public DisplayField()
No-args constructor (needed for JavaBeans). Registers itself as a listener for text events.

Methods

 o addControlListener
public void addControlListener(ControlListener listener)
Registers another listener to be informed when text is entered. The actual management is delegated to the ControlImpl object.

Parameters:
listener - listener to add
 o removeControlListener
public void removeControlListener(ControlListener listener)
Removes a listener. The actual management is delegated to the ControlImpl object.

Parameters:
listener - listener to remove
 o fireControlEvent
public void fireControlEvent(ControlEvent te)
Fires a text event to registered listeners. The actual management is delegated to the ControlImpl object.

Parameters:
te - text event encapsulating relevant text information
 o textValueChanged
public void textValueChanged(TextEvent te)
Method guaranteed by implementing the TextListener interface. Invoked by the underlying windowing system.

Parameters:
te - a text field event
 o getPreferredSize
public Dimension getPreferredSize()
Determines size of display area.

Returns:
dimension of display area
Overrides:
getPreferredSize in class TextField
 o update
public void update(ModelEvent me)
Method guaranteed by implementing the ModelListener interface. Invoked by any models which have registered this text field control as interested by their events in response to a new calculation. Updates the display.

Parameters:
me - encapsulates information about the calculation event

All Packages  Class Hierarchy  This Package  Previous  Next  Index