Class tea.set.TickerTape
All Packages Class Hierarchy This Package Previous Next Index
Class tea.set.TickerTape
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----tea.set.TickerTape
- public class TickerTape
- extends Canvas
- implements Runnable
TickerTape provides an interface similar to a stock ticker tape. It
can display a text stream in one strip by moving the text from
right to left. If multiple row of display is used, TickerTape
use a typewriter style display, by scrolling lines, and drawing
each new line of text one character at a time. It scrolls up one
line when a newline is seen, or a line has been filled up.
Tickertape can also operates in a line scroll mode. In this mode,
instead of scrolling by characters, everytime a complete line is
scrolled off the screen upward. There is no difference between
single line or multiple line modes. The text is broken up into
lines using newline character '\n'. TickerTape is in character
scroll mode by default.
-
CHAR_SCROLL
- Scroll by character.
-
LINE_SCROLL
- Scroll by line.
-
TickerTape(String)
- Construct a TickerTape with message as the text for displaying.
-
TickerTape(String, int)
- Construct a TickerTape with message as the text for displaying.
-
TickerTape(String, int, int)
- Construct a TickerTape with message as the text for displaying.
-
TickerTape(URL)
- Construct a TickerTape and display the content of url.
-
TickerTape(URL, int)
- Construct a TickerTape and display the content of url.
-
TickerTape(URL, int, int)
- Construct a TickerTape and display the content of url.
-
adjustSpeed(int)
- Adjust the ticker tape speed.
-
minimumSize()
- Return the minimum size of TickerTape.
-
paint(Graphics)
- Paint TickerTape.
-
preferredSize()
- Return the preferred size of TickerTape.
-
reload()
- A call to this function will cause that the TickerTape
to reload text from the URL.
-
run()
- TickerTape main loop.
-
setMessage(String)
- Set the message for displaying.
-
setMessage(URL)
- Set the URL content for displaying.
-
start()
- Create a new thread and start the TickerTape main loop, or resume
a suspended main loop thread.
-
stop()
- Stop the TickerTape thread.
-
update(Graphics)
- Don't clear area, for double buffering.
CHAR_SCROLL
public final static int CHAR_SCROLL
- Scroll by character. If TickerTape is in single line mode,
the ticker will be a single line moving from right to
left. If it's in multi-line mode, the interface is similar
to a typewriter, with one character appended to the last
line every iteration.
LINE_SCROLL
public final static int LINE_SCROLL
- Scroll by line. In this mode, one line is scrolled upwards
every iteration. The delay between lines depends on the
length of the topmost line.
TickerTape
public TickerTape(String message)
- Construct a TickerTape with message as the text for displaying.
- Parameters:
- message - ticker message.
TickerTape
public TickerTape(URL url)
- Construct a TickerTape and display the content of url.
- Parameters:
- url - ticker content URL.
TickerTape
public TickerTape(String message,
int rows)
- Construct a TickerTape with message as the text for displaying.
If rows equals one, TickerTape displays one line scrolling text.
Otherwise, it displays multiple lines with typewriter style
display.
- Parameters:
- message - ticker message.
- rows - number of display rows of text.
TickerTape
public TickerTape(URL url,
int rows)
- Construct a TickerTape and display the content of url.
If rows equals one, TickerTape displays one line scrolling text.
Otherwise, it displays multiple lines with typewriter style
display.
- Parameters:
- url - ticker content URL.
- rows - number of display rows of text.
TickerTape
public TickerTape(String message,
int rows,
int mode)
- Construct a TickerTape with message as the text for displaying.
If rows equals one, TickerTape displays one line scrolling text.
Otherwise, it displays multiple lines with typewriter style
display.
Either CHAR_SCROLL or LINE_SCROLL mode can be specified.
- Parameters:
- message - ticker message.
- rows - number of display rows of text.
- mode - line or character mode.
TickerTape
public TickerTape(URL url,
int rows,
int mode)
- Construct a TickerTape and display the content of url.
If rows equals one, TickerTape displays one line scrolling text.
Otherwise, it displays multiple lines with typewriter style
display.
Either CHAR_SCROLL or LINE_SCROLL mode can be specified.
- Parameters:
- url - ticker content URL.
- rows - number of display rows of text.
- mode - line or character mode.
setMessage
public void setMessage(String message)
- Set the message for displaying.
- Parameters:
- message - ticker message.
setMessage
public void setMessage(URL url)
- Set the URL content for displaying.
- Parameters:
- url - ticker content URL.
run
public void run()
- TickerTape main loop. It never returns.
reload
public synchronized void reload()
- A call to this function will cause that the TickerTape
to reload text from the URL. This allows other applets to update
information being desplayed on a TickerTape.
start
public void start()
- Create a new thread and start the TickerTape main loop, or resume
a suspended main loop thread.
stop
public void stop()
- Stop the TickerTape thread.
adjustSpeed
public synchronized void adjustSpeed(int inc)
- Adjust the ticker tape speed. Positive argument makes the text
move faster, and negative argument makes the text move slower.
- Parameters:
- inc - speed adjustment.
minimumSize
public Dimension minimumSize()
- Return the minimum size of TickerTape.
- Returns:
- minimum size.
- Overrides:
- minimumSize in class Component
preferredSize
public Dimension preferredSize()
- Return the preferred size of TickerTape.
- Returns:
- preferred size.
- Overrides:
- preferredSize in class Component
paint
public void paint(Graphics g)
- Paint TickerTape.
- Parameters:
- g - Graphics context of this component.
- Overrides:
- paint in class Canvas
update
public void update(Graphics g)
- Don't clear area, for double buffering.
- Parameters:
- g - Graphics context of this component.
- Overrides:
- update in class Component
All Packages Class Hierarchy This Package Previous Next Index