uchicago.src.sim.event
Class SliderListener
java.lang.Object
uchicago.src.sim.event.SliderListener
- All Implemented Interfaces:
- java.util.EventListener, javax.swing.event.ChangeListener
public abstract class SliderListener
- extends java.lang.Object
- implements javax.swing.event.ChangeListener
Abstract implementation of a ChangeListener. Will call the execute
method whenever the JSlider being listened to fires a ChangeEvent, that is,
whenever the slider is moved the execute() method will be called.
A modeler will implement this execute() method. Two variables are
available for use in the execute method.
- value - the current value of the slider
- isAdjusting - a boolean indicating whether the slider is in the
process of being adjusted. False indicates that the slider is no longer
being moved.
- isSlidingLeft - a boolean indicating whether the slider is being
adjusted to the left.
- Version:
- $Revision: 1.4 $ $Date: 2004/11/03 19:51:06 $
- Author:
- Nick Collier
|
Method Summary |
abstract void |
execute()
Called whenever the JSlider for which this is a listener is moved. |
void |
setFirstVal(int val)
|
void |
stateChanged(javax.swing.event.ChangeEvent evt)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
prevValue
protected int prevValue
value
protected int value
isAdjusting
protected boolean isAdjusting
isSlidingLeft
protected boolean isSlidingLeft
SliderListener
public SliderListener()
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent evt)
- Specified by:
stateChanged in interface javax.swing.event.ChangeListener
setFirstVal
public void setFirstVal(int val)
execute
public abstract void execute()
- Called whenever the JSlider for which this is a listener is moved.