Class awt.SmoothScroller
All Packages    This Package    Previous    Next

Class awt.SmoothScroller

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----awt.SmoothScroller

public class SmoothScroller
extends Thread
SmootherScroller is a thread which calls back Scrollable clients to generate a real-world feel to smoother scrolling. This model includes applying thrust in one direction or another and friction. A variable amount of thrust can be applied for a variable amount of time. A notion of braking is included, by temporarily upping the friction. Units of acceleration are in pixels/sec/sec. Velocity is in pixels/sec. The constants below probably should not be constants and rather should be configurable for each instance. These constants work well for a text widget that calls the thrust method with particular values. Get my point? This thread is a daemon thread, so if all other user threads die, this one will too.
Version:
1.10 16 Feb 1995
Author:
Jonathan Payne

SmoothScroller(Scrollable)

brake(int)
run()
setThrust(int, int)

SmoothScroller
  public SmoothScroller(Scrollable client)

setThrust
  public synchronized void setThrust(int t,
                                     int millis)
brake
  public void brake(int millis)
run
  public void run()

All Packages    This Package    Previous    Next