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

Class observable.ObservableSlider

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----dpscomponents.slider.MightySlider
                           |
                           +----dpscomponents.slider.FormatSlider
                                   |
                                   +----observable.ObservableSlider

public class ObservableSlider
extends FormatSlider
implements Observer
This class provides a slider with a value tied to an ObservableDbl. The base class is the FormatSlider which displays floating point values.
Version:
1.0 02-20-97
Author:
Daren Stotler
See Also:
FormatSlider, ObservableDbl, ObservableTest

Constructor Index

 o ObservableSlider(ObservableDbl)
Initializes the class.

Method Index

 o Release()
In the original MightySlider class, this method was essentially abstract; the subclass had to implement some specific action here.
 o SetMaximum(int)
Ties the maximum shown on the slider (int) with that of the ObservableDbl.
 o SetMinimum(int)
Ties the minimum shown on the slider (int) with that of the ObservableDbl.
 o update(Observable, Object)
This is the one and only method of the Observer interface; it doesn't really do anything unless there is some other do-dad around which can also alter the ObservableDbl used in this object's constructor.

Constructors

 o ObservableSlider
  public ObservableSlider(ObservableDbl new_value)
Initializes the class. Lets the ObservableDbl know we're here and grabs its value to use initially.
Parameters:
new_value - ObservableDbl associated with this slider

Methods

 o Release
  public void Release()
In the original MightySlider class, this method was essentially abstract; the subclass had to implement some specific action here. By going to the Observable approach, the need for this specific connection is removed & the following behavior becomes very general. Note that we have opted not to do likewise for the Motion method; the constant message passing it entails seems distasteful.
Overrides:
Release in class MightySlider
 o update
  public void update(Observable obs,
                     Object arg)
This is the one and only method of the Observer interface; it doesn't really do anything unless there is some other do-dad around which can also alter the ObservableDbl used in this object's constructor. I've no idea what the arguments have to do with anything (so much for the generality of the interface).
Parameters:
obs - observable which was updated
arg - what is being updated (not used)
 o SetMaximum
  public void SetMaximum(int max)
Ties the maximum shown on the slider (int) with that of the ObservableDbl.
Parameters:
max - maximum value to be allowed for the slider
Overrides:
SetMaximum in class MightySlider
 o SetMinimum
  public void SetMinimum(int min)
Ties the minimum shown on the slider (int) with that of the ObservableDbl.
Parameters:
max - minimum value to be allowed for the slider
Overrides:
SetMinimum in class MightySlider

All Packages  Class Hierarchy  This Package  Previous  Next  Index