|
||||||||||
| 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
public class IconItem
Shows a string with an optional image attached to it.
The dynamic CSS selector of the IconItem is "icon".
Following CSS attributes can be set:
Copyright Enough Software 2004 - 2008
history
04-Apr-2004 - rob creation
| Field Summary | |
|---|---|
protected int |
horizontalAdjustment
|
protected javax.microedition.lcdui.Image |
image
|
protected int |
imageAlign
|
protected int |
imageHeight
|
protected int |
imageWidth
|
protected boolean |
isTextVisible
|
protected int |
relativeIconX
|
protected int |
relativeIconY
|
protected java.lang.Object[] |
scaleData
|
protected boolean |
scaleFinished
|
protected int |
verticalAdjustment
|
protected int |
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 | |
|---|---|
IconItem(java.lang.String text,
javax.microedition.lcdui.Image image)
Creates a new icon. |
|
IconItem(java.lang.String text,
javax.microedition.lcdui.Image image,
Style style)
Creates a new icon. |
|
IconItem(java.lang.String label,
java.lang.String text,
javax.microedition.lcdui.Image image)
Creates a new icon. |
|
IconItem(java.lang.String label,
java.lang.String text,
javax.microedition.lcdui.Image image,
Style style)
Creates a new icon. |
|
| Method Summary | |
|---|---|
void |
animate(long currentTime,
ClippingRegion repaintRegion)
Animates this item. |
protected java.lang.String |
createCssSelector()
Retrieves the CSS selector for this item. |
protected void |
defocus(Style originalStyle)
Removes the focus from this item. |
javax.microedition.lcdui.Image |
getImage()
Retrieves the image of this item. |
protected void |
initContent(int firstLineWidth,
int lineWidth)
Initialises this item. |
boolean |
isTextVisible()
Determines if the text of this icon item is visible |
void |
paintContent(int x,
int y,
int leftBorder,
int rightBorder,
javax.microedition.lcdui.Graphics g)
Paints the content of this item. |
void |
releaseResources()
Releases all (memory intensive) resources such as images or RGB arrays of this item. |
void |
setImage(javax.microedition.lcdui.Image image)
Sets the image for this icon. |
void |
setImage(javax.microedition.lcdui.Image img,
Style style)
Sets the image for this icon. |
void |
setImage(java.lang.String url)
Loads the specified image. |
void |
setImage(java.lang.String name,
javax.microedition.lcdui.Image image)
sets the image which has been loaded in the background. |
void |
setImageAlign(int imageAlign)
Sets the image align for this icon. |
void |
setStyle(Style style)
Sets the style of this item. |
void |
setTextVisible(boolean isTextVisible)
Toggles the visibility of this icon's text |
java.lang.String |
toString()
Generates a String representation of this item. |
| Methods inherited from class de.enough.polish.ui.StringItem |
|---|
getFont, getFontHeight, getText, hideNotify, setFont, setText, setText, setTextColor, showNotify, stringWidth |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected javax.microedition.lcdui.Image image
protected int imageAlign
protected int imageHeight
protected int imageWidth
protected int yAdjustText
protected boolean isTextVisible
protected boolean scaleFinished
protected java.lang.Object[] scaleData
protected int verticalAdjustment
protected int horizontalAdjustment
protected int relativeIconX
protected int relativeIconY
| Constructor Detail |
|---|
public IconItem(java.lang.String text,
javax.microedition.lcdui.Image image)
text - the text of this itemimage - the image of this item, null when no image should be displayed
public IconItem(java.lang.String text,
javax.microedition.lcdui.Image image,
Style style)
text - the text of this itemimage - the image of this item, null when no image should be displayedstyle - the style of this item
public IconItem(java.lang.String label,
java.lang.String text,
javax.microedition.lcdui.Image image)
label - the label of this itemtext - the text of this itemimage - the image of this item, null when no image should be displayed
public IconItem(java.lang.String label,
java.lang.String text,
javax.microedition.lcdui.Image image,
Style style)
label - the label of this itemtext - the text of this itemimage - the image of this item, null when no image should be displayedstyle - the style of this item| Method Detail |
|---|
protected java.lang.String createCssSelector()
Item
createCssSelector in class StringItem
protected void initContent(int firstLineWidth,
int lineWidth)
Item
initContent in class StringItemfirstLineWidth - 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 StringItemx - 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.public javax.microedition.lcdui.Image getImage()
public void setStyle(Style style)
Item
setStyle in class StringItemstyle - the new style for this item.public void setImage(java.lang.String url)
url - the local URL of the image
public void setImage(java.lang.String name,
javax.microedition.lcdui.Image image)
ImageConsumer
setImage in interface ImageConsumername - the name of the image.
This allows the image-consumer to differentiate between several images.image - the image which was loaded in the background thread.public void setImage(javax.microedition.lcdui.Image image)
image - the image for this icon, when null is given, no image is painted.
public void setImage(javax.microedition.lcdui.Image img,
Style style)
img - the image for this icon, when null is given, no image is painted.style - the new style of this item, is ignored when nullpublic void setImageAlign(int imageAlign)
imageAlign - either Graphics.TOP, Graphics.LEFT, Graphics.BOTTOM or Graphics.RIGHT
public void animate(long currentTime,
ClippingRegion repaintRegion)
Item
animate in class StringItemcurrentTime - the current time in millisecondsrepaintRegion - the repaint area that needs to be updated when this item is animatedItem.addRelativeToContentRegion(ClippingRegion, int, int, int, int)protected void defocus(Style originalStyle)
Item
defocus in class StringItemoriginalStyle - the original style which will be restored.public java.lang.String toString()
Item
toString in class StringItempublic void releaseResources()
releaseResources in class StringItempublic boolean isTextVisible()
public void setTextVisible(boolean isTextVisible)
isTextVisible - true when the text should be shown
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||