weiman.observableControls
Class RunSliderDoubleBoxNoLabel

java.lang.Object
  extended by weiman.observableControls.RunSliderDoubleBoxNoLabel
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, java.util.Observer, javax.swing.event.ChangeListener

public abstract class RunSliderDoubleBoxNoLabel
extends java.lang.Object
implements java.lang.Runnable, javax.swing.event.ChangeListener, java.util.Observer

Original code for JSlider, ticks, hashtable from Glenn Josefiak Final code with linear interpolator, JSpinner, SpinnerNumberModel, clamping by Carl Weiman, October 20, 2006


Constructor Summary
RunSliderDoubleBoxNoLabel(boolean isHorizontal, java.lang.String label)
           
RunSliderDoubleBoxNoLabel(double _dblMin, double _dblMax, double _dblInit, boolean isHorizontal, java.lang.String label)
          Construct a DoubleSlider
 
Method Summary
 void addObserver(java.util.Observer obsrvr)
          Add the specified Observer to the list of parties notified if the slider is moved.
 java.awt.Component getBox()
           
 double getDblSliderMax()
           
 double getDblSliderMin()
           
 javax.swing.JPanel getResetButtonPanel()
           
 double getTolerance()
           
 double getValue()
          Return the current value of the DoubleSlider
static void main(java.lang.String[] args)
           
 void setLabel(java.lang.String s)
          Set the text of the slider valueUnits
 void setTickLabel(double tickValue)
          Set the valueUnits of a tick
 void setTitle(java.lang.String s)
           
 void setValue(double value)
          Programmatically set value of textfield, slider and observable in one place
 void setValueX(double value)
           
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 void update(java.util.Observable obsvble, java.lang.Object arg)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

RunSliderDoubleBoxNoLabel

public RunSliderDoubleBoxNoLabel(double _dblMin,
                                 double _dblMax,
                                 double _dblInit,
                                 boolean isHorizontal,
                                 java.lang.String label)
Construct a DoubleSlider

Parameters:
_dblMin - The minimum output value of the slider
_dblMax - The maximum output value of the slider
_dblInit - The initial output value of the slider
isHorizontal - The constructed orientation the slider
label - The permanent label of the slider

RunSliderDoubleBoxNoLabel

public RunSliderDoubleBoxNoLabel(boolean isHorizontal,
                                 java.lang.String label)
Method Detail

setValueX

public void setValueX(double value)

getTolerance

public double getTolerance()

update

public void update(java.util.Observable obsvble,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

addObserver

public void addObserver(java.util.Observer obsrvr)
Add the specified Observer to the list of parties notified if the slider is moved.

Parameters:
obsrvr - The Observer to be added "this" class.

setValue

public void setValue(double value)
Programmatically set value of textfield, slider and observable in one place

Parameters:
value - intended new double value of DoubleSlider

getValue

public double getValue()
Return the current value of the DoubleSlider

Returns:
double value of DoubleSlider

setTitle

public void setTitle(java.lang.String s)

setLabel

public void setLabel(java.lang.String s)
Set the text of the slider valueUnits

Parameters:
s - Descriptive text below the slider.

setTickLabel

public void setTickLabel(double tickValue)
Set the valueUnits of a tick

Parameters:
tickValue - The tickValue at which the valueUnits will appear.

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

getDblSliderMin

public double getDblSliderMin()

getDblSliderMax

public double getDblSliderMax()

getBox

public java.awt.Component getBox()

getResetButtonPanel

public javax.swing.JPanel getResetButtonPanel()

main

public static void main(java.lang.String[] args)