example.chooser
Class TextSample

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Canvas
          extended by example.chooser.TextSample

public class TextSample
extends javax.microedition.lcdui.Canvas

A Text sample. This screen can be used to display a Sample string. using the Face, Style, Size and foreground and background color.


Field Summary
(package private)  int bgcolor
           
(package private) static int border
          The width of the border.
(package private)  int face
           
(package private)  int fgcolor
           
(package private)  int size
           
(package private)  int style
           
(package private)  java.lang.String text
          The sample text
 
Fields inherited from class javax.microedition.lcdui.Canvas
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP
 
Constructor Summary
TextSample()
          Create a new TextSample canvas.
 
Method Summary
 int getBackgroundColor()
          Get the color of font currently being displayed.
 int getFace()
          Get the face of font currently being displayed.
 int getForegroundColor()
          Get the color of font currently being displayed.
 int getSize()
          Get the size of font currently being displayed.
 int getStyle()
          Get the style of font currently being displayed.
protected  void paint(javax.microedition.lcdui.Graphics g)
          Paint the canvas with the current color and controls to change it.
 void setBackgroundColor(int color)
          Set the Color of font to display.
 void setFace(int face)
          Set the Face of font to display.
 void setForegroundColor(int color)
          Set the Color of font to display.
 void setSize(int size)
          Set the Size of font to display.
 void setStyle(int style)
          Set the Style of font to display.
 
Methods inherited from class javax.microedition.lcdui.Canvas
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, showNotify, sizeChanged
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setCommandListener, setTicker, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

border

static final int border
The width of the border.

See Also:
Constant Field Values

face

int face

style

int style

size

int size

bgcolor

int bgcolor

fgcolor

int fgcolor

text

java.lang.String text
The sample text

Constructor Detail

TextSample

public TextSample()
Create a new TextSample canvas.

Method Detail

setStyle

public void setStyle(int style)
Set the Style of font to display.

Parameters:
style - to which to set the font
See Also:
Font.getStyle()

getStyle

public int getStyle()
Get the style of font currently being displayed.

Returns:
the font style
See Also:
Font.getStyle()

setFace

public void setFace(int face)
Set the Face of font to display.

Parameters:
face - to which to set the font
See Also:
Font.getFace()

getFace

public int getFace()
Get the face of font currently being displayed.

Returns:
the current font face
See Also:
Font.getFace()

setSize

public void setSize(int size)
Set the Size of font to display.

Parameters:
size - to which the font should be set
See Also:
Font.getSize()

getSize

public int getSize()
Get the size of font currently being displayed.

Returns:
The current size of font.
See Also:
Font.getSize()

setForegroundColor

public void setForegroundColor(int color)
Set the Color of font to display.

Parameters:
color - a new foreground color

getForegroundColor

public int getForegroundColor()
Get the color of font currently being displayed.

Returns:
the foreground color

setBackgroundColor

public void setBackgroundColor(int color)
Set the Color of font to display.

Parameters:
color - a new background color

getBackgroundColor

public int getBackgroundColor()
Get the color of font currently being displayed.

Returns:
the background color

paint

protected void paint(javax.microedition.lcdui.Graphics g)
Paint the canvas with the current color and controls to change it.

Specified by:
paint in class javax.microedition.lcdui.Canvas
Parameters:
g - the graphics context to which to paint