com.sybase.uep.bobclient.data
Class FontStyle

java.lang.Object
  extended by com.sybase.uep.bobclient.data.FontStyle

public class FontStyle
extends java.lang.Object

This is the Style Class. This will contain all the font information.

Author:
tdang

Field Summary
static int DEFAULT_BACKGROUND_COLOR
          Default background color.
static java.lang.String DEFAULT_FONT
          Default font.
static int DEFAULT_FONT_SIZE
          Default font size for non-touch screen devices.
static int DEFAULT_FONT_SIZE_UNIT
          Default font unit.
static int DEFAULT_FOREGROUND_COLOR
          Default foreground color.
static int DEFAULT_GRADIENT_COLOR
          Default gradient color.
static int DEFAULT_STYLE
          Default font style.
static java.lang.String DEFAULT_SYSTEM_FONT
          Default system font.
static int FONT_SIZE_UNIT_PIXEL
          Default pixel font unit.
static int FONT_SIZE_UNIT_POINT
          Default point font unit.
 
Constructor Summary
FontStyle()
          Constructor to create a Font Style object
FontStyle(java.lang.String fontFace, int fontSize, int fontSizeUnit, int fontStyle, int foregroundColor, int backgroundColor)
          Constructor to create a Font Style object
FontStyle(java.lang.String fontFace, int fontSize, int fontSizeUnit, int fontStyle, int foregroundColor, int backgroundColor, int gradientColor)
          Constructor to create a Font Style object
 
Method Summary
 FontStyle clone()
          Make a copy of this Font Style
 int getBackgroundColor()
          Get the background color
 net.rim.device.api.ui.Font getBoldFont()
          Get bold Font object
 net.rim.device.api.ui.Font getFont()
          Get the Font object
 java.lang.String getFontFace()
          Get the font face
 net.rim.device.api.ui.FontFamily getFontFamily()
          Get the font family object
 net.rim.device.api.ui.FontFamily getFontFamily(java.lang.String fontFace)
          Get the font family object
 int getFontSize()
          Get the font size
 int getFontSizeUnit()
          Get the font size unit in pixel or point
 int getFontStyle()
          Get the font style
 int getForegroundColor()
          Get the foreground color
 int getGradientColor()
          Get the gradient color
 void setBackgroundColor(int color)
          Set the background color
 void setFontFace(java.lang.String fontFace)
          Set the font face
 void setFontSize(int fontSize)
          Set the font size
 void setFontSizeUnit(int fontSizeUnit)
          Set the font size unit
 void setFontStyle(int fontStyle)
          Set the font style
 void setForegroundColor(int color)
          Set the foreground color
 void setGradientColor(int color)
          Get the gradient color
 java.lang.String toString()
          Descript of this font style object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SYSTEM_FONT

public static final java.lang.String DEFAULT_SYSTEM_FONT
Default system font.

See Also:
Constant Field Values

DEFAULT_FONT

public static final java.lang.String DEFAULT_FONT
Default font.

See Also:
Constant Field Values

DEFAULT_FOREGROUND_COLOR

public static final int DEFAULT_FOREGROUND_COLOR
Default foreground color.

See Also:
Constant Field Values

DEFAULT_BACKGROUND_COLOR

public static final int DEFAULT_BACKGROUND_COLOR
Default background color.

See Also:
Constant Field Values

DEFAULT_GRADIENT_COLOR

public static final int DEFAULT_GRADIENT_COLOR
Default gradient color.

See Also:
Constant Field Values

DEFAULT_STYLE

public static final int DEFAULT_STYLE
Default font style.

See Also:
Constant Field Values

FONT_SIZE_UNIT_PIXEL

public static final int FONT_SIZE_UNIT_PIXEL
Default pixel font unit.

See Also:
Constant Field Values

FONT_SIZE_UNIT_POINT

public static final int FONT_SIZE_UNIT_POINT
Default point font unit.

See Also:
Constant Field Values

DEFAULT_FONT_SIZE_UNIT

public static final int DEFAULT_FONT_SIZE_UNIT
Default font unit.

See Also:
Constant Field Values

DEFAULT_FONT_SIZE

public static final int DEFAULT_FONT_SIZE
Default font size for non-touch screen devices.

See Also:
Constant Field Values
Constructor Detail

FontStyle

public FontStyle()
Constructor to create a Font Style object


FontStyle

public FontStyle(java.lang.String fontFace,
                 int fontSize,
                 int fontSizeUnit,
                 int fontStyle,
                 int foregroundColor,
                 int backgroundColor)
Constructor to create a Font Style object

Parameters:
fontFace - - String value for the font family null if not set
fontSize - - int value for the font size in points -1 if not set
fontSizeUnit - - Can be either point (Ui.UNITS_pt) or pixel (Ui.UNITS_px) -1 if not set
fontStyle - - int value for the font style can be Font.PLAIN, Font.BOLD, Font.ITALIC, or combination -1 if not set
foregroundColor - - int value for the color of the text color -1 if not set
backgroundColor - - int value for the color of the back ground color -1 if not set

FontStyle

public FontStyle(java.lang.String fontFace,
                 int fontSize,
                 int fontSizeUnit,
                 int fontStyle,
                 int foregroundColor,
                 int backgroundColor,
                 int gradientColor)
Constructor to create a Font Style object

Parameters:
fontFace - - String value for the font family null if not set
fontSize - - int value for the font size in points -1 if not set
fontSizeUnit - - Can be either point (Ui.UNITS_pt) or pixel (Ui.UNITS_px) -1 if not set
fontStyle - - int value for the font style can be Font.PLAIN, Font.BOLD, Font.ITALIC, or combination -1 if not set
foregroundColor - - int value for the color of the text color -1 if not set
backgroundColor - - int value for the color of the back ground color -1 if not set
gradientColor - - int value for the color of the gradient color -1 if not set
Method Detail

setFontFace

public void setFontFace(java.lang.String fontFace)
Set the font face

Parameters:
fontFace - - name of the font face

getFontFace

public java.lang.String getFontFace()
Get the font face

Returns:
name of the font face

setFontSize

public void setFontSize(int fontSize)
Set the font size

Parameters:
fontSize - - int value of the font size in points or pixels depending on what the font size unit is set to

getFontSize

public int getFontSize()
Get the font size

Returns:
int value of the font size in points

setFontSizeUnit

public void setFontSizeUnit(int fontSizeUnit)
Set the font size unit

Parameters:
fontSizeUnit - - font size unit, can be Ui.UNITS_px or Ui.UNITS_pt

getFontSizeUnit

public int getFontSizeUnit()
Get the font size unit in pixel or point

Returns:
unit of the font size, can be Ui.UNITS_px or Ui.UNITS_pt

setFontStyle

public void setFontStyle(int fontStyle)
Set the font style

Parameters:
fontStyle - - int value of the font style

getFontStyle

public int getFontStyle()
Get the font style

Returns:
int value of the font style

setForegroundColor

public void setForegroundColor(int color)
Set the foreground color

Parameters:
color - - int value of the color

getForegroundColor

public int getForegroundColor()
Get the foreground color

Returns:
int value of the color

setBackgroundColor

public void setBackgroundColor(int color)
Set the background color

Parameters:
color - - int value of the color

getBackgroundColor

public int getBackgroundColor()
Get the background color

Returns:
int value of the color

setGradientColor

public void setGradientColor(int color)
Get the gradient color


getGradientColor

public int getGradientColor()
Get the gradient color

Returns:
int value of the color

getFontFamily

public net.rim.device.api.ui.FontFamily getFontFamily()
Get the font family object

Returns:
FontFamily object

getFontFamily

public net.rim.device.api.ui.FontFamily getFontFamily(java.lang.String fontFace)
Get the font family object

Returns:
FontFamily object

getFont

public net.rim.device.api.ui.Font getFont()
Get the Font object

Returns:
font object based on the styles defined

getBoldFont

public net.rim.device.api.ui.Font getBoldFont()
Get bold Font object

Returns:
font object based on the styles with bold

clone

public FontStyle clone()
Make a copy of this Font Style

Returns:
a copy of the Font Style object

toString

public java.lang.String toString()
Descript of this font style object

Overrides:
toString in class java.lang.Object
Returns:
string value information of this font style object