Class Ticker.Ticker
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Ticker.Ticker

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----Ticker.Ticker

public class Ticker
extends Thread
A class that runs a string through a window from left to right as if it were a stock ticker.

Constructor Index

 o Ticker(Applet, Vector, int, int, int, int)
Constructor.
 o Ticker(Applet, String, int, int, int, int)
Constructor.

Method Index

 o paint1(Graphics, int)
Paint an updated version of the ticker, moving the displayed string 1 pixel to the left.
 o paintFirst(Graphics)
Setup the ticker display initial state by painting the string across the window, truncated to whatever width the ticker allows.
 o repaint(Graphics)
A version of paintFirst.
 o run()
Call paintFirst to setup the ticker window, then sit in a loop, conditioned on bTrue, calling paint1 to move the ticker relentlessly to the left.
 o stopIt()
Stop the ticker thread by setting bRun to false.

Constructors

 o Ticker
  public Ticker(Applet a,
                Vector v,
                int x,
                int y,
                int w,
                int waittime)
Constructor.
Parameters:
a - The Applet that created this ticker.
v - A Vector of Strings that will be used as the ticker items, each item separated by a space.
x - The x location of the ticker within the applet.
y - The y location of the ticker within the applet.
w - The width of the ticker.
 o Ticker
  public Ticker(Applet a,
                String inputString,
                int x,
                int y,
                int w,
                int waittime)
Constructor.
Parameters:
a - The Applet that created this ticker.
inputString - A Strings that will be used as the ticker item.
x - The x location of the ticker within the applet.
y - The y location of the ticker within the applet.
w - The width of the ticker.

Methods

 o run
  public void run()
Call paintFirst to setup the ticker window, then sit in a loop, conditioned on bTrue, calling paint1 to move the ticker relentlessly to the left. Delay before each paint1 call for Delay milliseconds.
Overrides:
run in class Thread
 o stopIt
  public void stopIt()
Stop the ticker thread by setting bRun to false.
 o paintFirst
  public void paintFirst(Graphics g)
Setup the ticker display initial state by painting the string across the window, truncated to whatever width the ticker allows. Called once.
 o repaint
  public void repaint(Graphics g)
A version of paintFirst. Not used.
 o paint1
  public void paint1(Graphics g,
                     int inc)
Paint an updated version of the ticker, moving the displayed string 1 pixel to the left.

All Packages  Class Hierarchy  This Package  Previous  Next  Index