|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.lcdui.Item
javax.microedition.lcdui.CustomItem
de.enough.polish.ui.FakeCustomItem
de.enough.polish.ui.FakeStringCustomItem
de.enough.polish.ui.FakeIconCustomItem
public class FakeIconCustomItem
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 boolean |
isTextVisible
|
| Fields inherited from class de.enough.polish.ui.FakeStringCustomItem |
|---|
bitMapFont, bitMapFontViewer, clipText, font, text, textColor, textEffect, textHorizontalAdjustment, textLines, textVerticalAdjustment, useSingleLine, xOffset |
| Fields inherited from class javax.microedition.lcdui.CustomItem |
|---|
KEY_PRESS, KEY_RELEASE, KEY_REPEAT, NONE, POINTER_DRAG, POINTER_PRESS, POINTER_RELEASE, TRAVERSE_HORIZONTAL, TRAVERSE_VERTICAL |
| Constructor Summary | |
|---|---|
FakeIconCustomItem(java.lang.String text,
javax.microedition.lcdui.Image image)
Creates a new icon. |
|
FakeIconCustomItem(java.lang.String text,
javax.microedition.lcdui.Image image,
Style style)
Creates a new icon. |
|
FakeIconCustomItem(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.FakeStringCustomItem |
|---|
animate, getFont, getText, hideNotify, setFont, setText, setText, showNotify |
| Methods inherited from class javax.microedition.lcdui.CustomItem |
|---|
getGameAction, getInteractionModes, invalidate, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, sizeChanged, traverse, traverseOut |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean isTextVisible
| Constructor Detail |
|---|
public FakeIconCustomItem(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 FakeIconCustomItem(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 FakeIconCustomItem(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()
FakeCustomItem
createCssSelector in class FakeStringCustomItem
protected void initContent(int firstLineWidth,
int lineWidth)
FakeCustomItem
initContent in class FakeStringCustomItemfirstLineWidth - the maximum width of the first linelineWidth - the maximum width of any following linesFakeCustomItem.contentWidth,
FakeCustomItem.contentHeight,
FakeCustomItem.preferredWidth,
FakeCustomItem.preferredHeight
public void paintContent(int x,
int y,
int leftBorder,
int rightBorder,
javax.microedition.lcdui.Graphics g)
FakeCustomItem
paintContent in class FakeStringCustomItemx - 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)
FakeCustomItem
setStyle in class FakeStringCustomItemstyle - 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)
FakeCustomItem
animate in class FakeCustomItemcurrentTime - the current time in millisecondsrepaintRegion - the repaint area that needs to be updated when this item is animated#addRelativeRegion(ClippingRegion, int, int, int, int)protected void defocus(Style originalStyle)
FakeCustomItem
defocus in class FakeStringCustomItemoriginalStyle - the original style which will be restored.public java.lang.String toString()
FakeCustomItem
toString in class FakeStringCustomItempublic void releaseResources()
releaseResources in class FakeStringCustomItempublic 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 | |||||||||