|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.ui.Item
de.enough.polish.ui.StringItem
de.enough.polish.ui.IconItem
de.enough.polish.ui.Ticker
public class Ticker
Implements a "ticker-tape", a piece of text that runs continuously across the display. The direction and speed of scrolling are determined by the implementation. While animating, the ticker string scrolls continuously. That is, when the string finishes scrolling off the display, the ticker starts over at the beginning of the string.
There is no API provided for starting and stopping the ticker. The application model is that the ticker is always scrolling continuously. However, the implementation is allowed to pause the scrolling for power consumption purposes, for example, if the user doesn't interact with the device for a certain period of time. The implementation should resume scrolling the ticker when the user interacts with the device again.
The text of the ticker may contain line breaks. The complete text MUST be displayed in the ticker; line break characters should not be displayed but may be used as separators.
The same ticker may be shared by several Displayable
objects ("screens"). This can be accomplished by calling
setTicker() on each of them.
Typical usage is for an application to place the same ticker on
all of its screens. When the application switches between two screens that
have the same ticker, a desirable effect is for the ticker to be displayed
at the same location on the display and to continue scrolling its contents
at the same position. This gives the illusion of the ticker being attached
to the display instead of to each screen.
An alternative usage model is for the application to use different
tickers on different sets of screens or even a different one on each
screen. The ticker is an attribute of the Displayable class
so that
applications may implement this model without having to update the ticker
to be displayed as the user switches among screens.
StringItem,
IconItem| Field Summary |
|---|
| Fields inherited from class de.enough.polish.ui.IconItem |
|---|
horizontalAdjustment, image, imageAlign, imageHeight, imageWidth, isTextVisible, relativeIconX, relativeIconY, scaleData, scaleFinished, verticalAdjustment, yAdjustText |
| Fields inherited from class de.enough.polish.ui.StringItem |
|---|
animateTextWrap, bitMapFont, bitMapFontViewer, clipText, font, text, textColor, textEffect, textHorizontalAdjustment, textLines, textVerticalAdjustment, textWrapDirection, textWrapSpeed, useSingleLine, xOffset |
| Constructor Summary | |
|---|---|
Ticker(java.lang.String str)
Constructs a new Ticker object, given its initial
contents string. |
|
Ticker(java.lang.String str,
Style style)
Constructs a new Ticker object, given its initial
contents string. |
|
| Method Summary | |
|---|---|
boolean |
animate()
Animates this item. |
protected java.lang.String |
createCssSelector()
Retrieves the CSS selector for this item. |
java.lang.String |
getString()
Retrieves the shown text of this ticker. |
protected void |
hideNotify()
Called by the system to notify the item that it is now completely invisible, when it previously had been at least partially visible. |
protected void |
initContent(int firstLineWidth,
int lineWidth)
Initialises this item. |
void |
paintContent(int x,
int y,
int leftBorder,
int rightBorder,
javax.microedition.lcdui.Graphics g)
Paints the content of this item. |
void |
setString(java.lang.String text)
Sets the ticker text |
void |
setStyle(Style style)
Sets the style of this item. |
protected void |
showNotify()
Called by the system to notify the item that it is now at least partially visible, when it previously had been completely invisible. |
| Methods inherited from class de.enough.polish.ui.IconItem |
|---|
animate, defocus, getImage, isTextVisible, releaseResources, setImage, setImage, setImage, setImage, setImageAlign, setTextVisible, toString |
| Methods inherited from class de.enough.polish.ui.StringItem |
|---|
getFont, getFontHeight, getText, setFont, setText, setText, setTextColor, stringWidth |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Ticker(java.lang.String str)
Ticker object, given its initial
contents string.
str - string to be set for the Ticker
java.lang.NullPointerException - if str is null
public Ticker(java.lang.String str,
Style style)
Ticker object, given its initial
contents string.
str - string to be set for the Tickerstyle - the CSS style for this item
java.lang.NullPointerException - if str is null| Method Detail |
|---|
public java.lang.String getString()
public void setString(java.lang.String text)
text - the text that is being scrolled
protected void initContent(int firstLineWidth,
int lineWidth)
Item
initContent in class IconItemfirstLineWidth - the maximum width of the first linelineWidth - the maximum width of any following linesItem.contentWidth,
Item.contentHeight,
Item.preferredWidth,
Item.preferredHeight
public void paintContent(int x,
int y,
int leftBorder,
int rightBorder,
javax.microedition.lcdui.Graphics g)
Item
paintContent in class IconItemx - the left start positiony - the upper start positionleftBorder - the left border, nothing must be painted left of this positionrightBorder - the right border, nothing must be painted right of this positiong - the Graphics on which this item should be painted.protected java.lang.String createCssSelector()
Item
createCssSelector in class IconItempublic void setStyle(Style style)
Item
setStyle in class IconItemstyle - the new style for this item.public boolean animate()
Item
animate in class ItemItem.animate(long, ClippingRegion)protected void hideNotify()
Itempaint() calls will be made on this item
until after a showNotify() has been called again.
The default implementation of this method sets the isShown field to false and calls hideNotify on style elements.
hideNotify in class StringItemprotected void showNotify()
Itempaint() calls after
showNotify() has been called.
The default implementation of this method sets the isShown field to true and calls showNotify on style elements.
showNotify in class StringItem
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||