javax.swing.plaf.basic

Class BasicSliderUI.ScrollListener

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.

UNKNOWN: Apparently this class was intended to be protected, but was made public by a compiler bug and is now public for compatibility.

Constructor Summary
ScrollListener()
Creates a new ScrollListener object.
ScrollListener(int dir, boolean block)
Creates a new ScrollListener object.
Method Summary
voidactionPerformed(ActionEvent e)
Called every time the swing timer reaches its interval.
voidsetDirection(int direction)
Sets the direction to scroll in.
voidsetScrollByBlock(boolean block)
Sets whether movement will be in blocks.

Constructor Detail

ScrollListener

public ScrollListener()
Creates a new ScrollListener object.

ScrollListener

public 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.

Parameters: e An {@link 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.