javax.swing.plaf.basic
Class BasicSliderUI.ScrollListener

java.lang.Object
  extended by javax.swing.plaf.basic.BasicSliderUI.ScrollListener
All Implemented Interfaces:
ActionListener, EventListener
Enclosing class:
BasicSliderUI

public class BasicSliderUI.ScrollListener
extends Object
implements ActionListener

Helper class that listens to our swing timer. This class is responsible for listening to the timer and moving the thumb in the proper direction every interval.


Constructor Summary
BasicSliderUI.ScrollListener()
          Creates a new ScrollListener object.
BasicSliderUI.ScrollListener(int dir, boolean block)
          Creates a new ScrollListener object.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Called every time the swing timer reaches its interval.
 void setDirection(int direction)
          Sets the direction to scroll in.
 void setScrollByBlock(boolean block)
          Sets whether movement will be in blocks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSliderUI.ScrollListener

public BasicSliderUI.ScrollListener()
Creates a new ScrollListener object.


BasicSliderUI.ScrollListener

public BasicSliderUI.ScrollListener(int dir,
                                    boolean block)
Creates a new ScrollListener object.

Parameters:
dir - The direction to scroll in.
block - If movement will be in blocks.
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Called every time the swing timer reaches its interval. If the thumb needs to move, then this method will move the thumb one block or unit in the direction desired. Otherwise, the timer can be stopped.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - An ActionEvent.

setDirection

public void setDirection(int direction)
Sets the direction to scroll in.

Parameters:
direction - The direction to scroll in.

setScrollByBlock

public void setScrollByBlock(boolean block)
Sets whether movement will be in blocks.

Parameters:
block - If movement will be in blocks.