Class observable.ObservableLabel
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class observable.ObservableLabel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Label
                   |
                   +----observable.ObservableLabel

public class ObservableLabel
extends Label
implements Observer
Just a simple-minded class to make a label out of the value of an ObservableDbl.
Version:
1.0 02-25-97
Author:
Daren Stotler
See Also:
ObservableDbl, ObservableTest

Variable Index

 o precision_

Constructor Index

 o ObservableLabel(ObservableDbl)
Simplest constructor: just the double and no other text
 o ObservableLabel(ObservableDbl, String)
Another constructor, this time with just one string.
 o ObservableLabel(ObservableDbl, String, int)
Another constructor, this time with one string and an alignment flag.
 o ObservableLabel(ObservableDbl, String, String, int)
Last (for now) constructor.

Method Index

 o update(Observable, Object)
The one and only method of the Observer interface.

Variables

 o precision_
  protected int precision_

Constructors

 o ObservableLabel
  public ObservableLabel(ObservableDbl od)
Simplest constructor: just the double and no other text
Parameters:
od - an ObservableDbl
 o ObservableLabel
  public ObservableLabel(ObservableDbl od,
                         String s1)
Another constructor, this time with just one string.
Parameters:
od - an ObservableDbl
s1 - string to appear before the double in the label
 o ObservableLabel
  public ObservableLabel(ObservableDbl od,
                         String s1,
                         int align)
Another constructor, this time with one string and an alignment flag.
Parameters:
od - an ObservableDbl
s1 - string to appear before the double in the label
align - alignment flag (as in Label class)
See Also:
Label
 o ObservableLabel
  public ObservableLabel(ObservableDbl od,
                         String s1,
                         String s2,
                         int align)
Last (for now) constructor. Have two strings and an alignment flag.
Parameters:
od - an ObservableDbl
s1 - string to appear before the double in the label
s2 - string to appear after the double in the label
align - alignment flag (as in Label class)
See Also:
Label

Methods

 o update
  public void update(Observable obs,
                     Object arg)
The one and only method of the Observer interface. This will be called when the ObservableDbl gets called. This method will update the Label accordingly.
Parameters:
obs - observable which was updated
arg - what is being updated

All Packages  Class Hierarchy  This Package  Previous  Next  Index