de.enough.polish.ui
Class MessageItem

java.lang.Object
  extended by javax.microedition.lcdui.Item
      extended by javax.microedition.lcdui.CustomItem
          extended by de.enough.polish.ui.MessageItem

public class MessageItem
extends javax.microedition.lcdui.CustomItem


Field Summary
 
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
 
Fields inherited from class javax.microedition.lcdui.Item
BUTTON, HYPERLINK, LAYOUT_2, LAYOUT_BOTTOM, LAYOUT_CENTER, LAYOUT_DEFAULT, LAYOUT_EXPAND, LAYOUT_LEFT, LAYOUT_NEWLINE_AFTER, LAYOUT_NEWLINE_BEFORE, LAYOUT_RIGHT, LAYOUT_SHRINK, LAYOUT_TOP, LAYOUT_VCENTER, LAYOUT_VEXPAND, LAYOUT_VSHRINK, PLAIN
 
Constructor Summary
MessageItem(java.lang.String headline, java.lang.String text)
          Creates a new message item
MessageItem(java.lang.String headline, java.lang.String text, Style style)
          Creates a new message item
 
Method Summary
protected  int getMinContentHeight()
           
protected  int getMinContentWidth()
           
protected  int getPrefContentHeight(int width)
           
protected  int getPrefContentWidth(int height)
           
protected  void paint(javax.microedition.lcdui.Graphics g, int w, int h)
           
 void setHeadline(java.lang.String headline)
          Sets the headline text
 void setHeadline(java.lang.String headline, Style style)
          Sets the headline text
 void setImage(javax.microedition.lcdui.Image image)
          Sets the image of the headline
 void setText(java.lang.String text)
          Sets the text of the message.
 void setText(java.lang.String text, Style style)
          Sets the text of the message.
 
Methods inherited from class javax.microedition.lcdui.CustomItem
getGameAction, getInteractionModes, hideNotify, invalidate, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, showNotify, sizeChanged, traverse, traverseOut
 
Methods inherited from class javax.microedition.lcdui.Item
addCommand, getLabel, getLayout, getMinimumHeight, getMinimumWidth, getPreferredHeight, getPreferredWidth, notifyStateChanged, removeCommand, setDefaultCommand, setItemCommandListener, setLabel, setLayout, setPreferredSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageItem

public MessageItem(java.lang.String headline,
                   java.lang.String text)
Creates a new message item

Parameters:
headline - the headline text
text - the content text

MessageItem

public MessageItem(java.lang.String headline,
                   java.lang.String text,
                   Style style)
Creates a new message item

Parameters:
headline - the headline text
text - the content text
style - the CSS style
Method Detail

getMinContentWidth

protected int getMinContentWidth()
Specified by:
getMinContentWidth in class javax.microedition.lcdui.CustomItem

getMinContentHeight

protected int getMinContentHeight()
Specified by:
getMinContentHeight in class javax.microedition.lcdui.CustomItem

getPrefContentWidth

protected int getPrefContentWidth(int height)
Specified by:
getPrefContentWidth in class javax.microedition.lcdui.CustomItem

getPrefContentHeight

protected int getPrefContentHeight(int width)
Specified by:
getPrefContentHeight in class javax.microedition.lcdui.CustomItem

setHeadline

public void setHeadline(java.lang.String headline)
Sets the headline text

Parameters:
headline - the new headline

setHeadline

public void setHeadline(java.lang.String headline,
                        Style style)
Sets the headline text

Parameters:
headline - the new headline
style - the new style for the headline

setText

public void setText(java.lang.String text)
Sets the text of the message.

Parameters:
text - the new text

setText

public void setText(java.lang.String text,
                    Style style)
Sets the text of the message.

Parameters:
text - the new text
style - the new style of the text

setImage

public void setImage(javax.microedition.lcdui.Image image)
Sets the image of the headline

Parameters:
image - the new image of the headline

paint

protected void paint(javax.microedition.lcdui.Graphics g,
                     int w,
                     int h)
Specified by:
paint in class javax.microedition.lcdui.CustomItem