Class Ticker
Object
Component
Label
Ticker
public class Ticker
- extends Label
Implements a "ticker-tape", a piece of text that runs
continuously across the component area.
Ticker animation starts automatically when it's first painted on
screen and stops when it's no longer visible.
When the text is changed with Component.setText(String)
the ticker animation starts from the beginning.
Ticker has following special style customizations:
color: Color of text
font: Font of text
ticker-speed: Time reserved for individual character in
milliseconds, if speed is less or equal to zero the
ticker will behave like normal Label.
For instance, if ticker-speed is 0 for normal
style and something else for focused variant, the
animation starts only after it has been focused.
ticker-mode:
loop: ticker moves in a loop mode
bounce: ticker bounces back and forth
Loop
On loop mode the text is initially positioned just over
right border of component area so that none of the text is visible.
When animation begins it moves from right-to-left until
it has completely passed over the left border of component area.
After whole loop has been been completed the Ticker
sends ITEM_CHANGED action with itself as source.
Text of ticker can be safely changed (without interrupting the animation)
when action is received.
Bounce
On bounce mode the text is always (partially) visible and it animates
between states where first character touches the left border and
last character touches the right border. If the text is smaller than
available area it will not animate at all.
|
Constructor Summary |
Ticker(Style style,
String text)
Constructs a new Ticker component. |
| Methods inherited from class Component |
add, appendText, clear, find, first, get, getAction, getData, getElement, getFlags, getImage, getLocation, getParent, getShell, getSize, getStyle, getText, getViewPort, hasLinefeed, indexOf, insert, isFocusable, isShown, isVisible, isWrapping, last, operator_get, operator_set, remove, remove, repaint, set, setAction, setData, setElement, setFlags, setImage, setLocation, setPreferredHeight, setPreferredSize, setPreferredWidth, setStyle, setText, size |
| Methods inherited from |
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
Ticker
public Ticker(Style style,
String text)
- Constructs a new Ticker component.
- Parameters:
style - Style to usetext - Text to use