javax.swing.plaf.basic
Class BasicScrollBarUI.ScrollListener

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

protected class BasicScrollBarUI.ScrollListener
extends Object
implements ActionListener

A helper class that listens for events from the timer that is used to move the thumb.


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

Constructor Detail

BasicScrollBarUI.ScrollListener

public BasicScrollBarUI.ScrollListener()
Creates a new ScrollListener object. The default is scrolling positively with block movement.


BasicScrollBarUI.ScrollListener

public BasicScrollBarUI.ScrollListener(int dir,
                                       boolean block)
Creates a new ScrollListener object using the given direction and block.

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

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 scrolling will be done in blocks.

Parameters:
block - Whether scrolling will be in blocks.

actionPerformed

public void actionPerformed(ActionEvent e)
Called every time the timer reaches its interval.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - The ActionEvent fired by the timer.