org.kobjects.kui
Class Style

java.lang.Object
  extended by org.kobjects.kui.Style

public class Style
extends java.lang.Object


Field Summary
 int align
           
 int[] background
          Background array, see apply
 int color
          Text Color
static int FILL_GRADIENT
           
static int FILL_PLAIN
           
 int font
          Text Font
 int[] frame
          Frame array, see apply
static int FRAME_RELIEF
           
static int FRAME_ROUNDED
           
static int FRAME_SIMPLE
          Constant for drawing a simple border
 int xc
           
 
Constructor Summary
Style(int textColor, int font, int[] frame, int[] background, int extraColor, int align)
          Creates a style to be used with KUI elements.
 
Method Summary
 int apply(Graphics g)
           
 void drawString(Graphics g, java.lang.String s, int x, int y)
           
 int fill(Graphics gc, int x0, int y0, int w, int h)
           
 int frame(Graphics gc, int x0, int y0, int w, int h)
           
 Font getFont()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FRAME_SIMPLE

public static final int FRAME_SIMPLE
Constant for drawing a simple border

See Also:
Constant Field Values

FRAME_ROUNDED

public static final int FRAME_ROUNDED
See Also:
Constant Field Values

FRAME_RELIEF

public static final int FRAME_RELIEF
See Also:
Constant Field Values

FILL_PLAIN

public static final int FILL_PLAIN
See Also:
Constant Field Values

FILL_GRADIENT

public static final int FILL_GRADIENT
See Also:
Constant Field Values

color

public final int color
Text Color


font

public final int font
Text Font


background

public final int[] background
Background array, see apply


frame

public final int[] frame
Frame array, see apply


xc

public final int xc

align

public final int align
Constructor Detail

Style

public Style(int textColor,
             int font,
             int[] frame,
             int[] background,
             int extraColor,
             int align)
Creates a style to be used with KUI elements.

Parameters:
textColor - Text color ARGB value.
font - MIDP font bit combination (Font.SIZE_SMALL, Font.STYLE_BOLD, ...)
frame - An integer array defining the frame. The first value defines the type of the frame (FRAME_SIMPLE, FRAME_ROUNDED, FRAME_RELIEF). The following two values define the the width of the frame in pixels (starting and end point relative to the filled area). Additional values define the frame color. If the array is omitted (null), no frame is drawn
background - An integer array defining the background color. The first value defines the fill style (FILL_PLAIN, FILL_GRADIENT). In the case of FILL_PLAIN, the next value defines the fill color. In the case of FILL_GRADIENT, a sequence of RGB color values and percent valuese (in the range from 0...255) defines the fill gradient.
extraColor - An extra color, used e.g for the sub-focus in choice groups
align - A combination of Graphics.TOP/BOTTOM/VCENTER and Graphics.LEFT/RIGHT/HCENTER.
Method Detail

fill

public int fill(Graphics gc,
                int x0,
                int y0,
                int w,
                int h)

apply

public int apply(Graphics g)

frame

public int frame(Graphics gc,
                 int x0,
                 int y0,
                 int w,
                 int h)

getFont

public Font getFont()

drawString

public void drawString(Graphics g,
                       java.lang.String s,
                       int x,
                       int y)