net.rim.device.api.ui.decor
Class BackgroundFactory

java.lang.Object
  extended by net.rim.device.api.ui.decor.BackgroundFactory

public final class BackgroundFactory
extends Object

A factory class for creating different types of Background. For more details, see:

Since:
BlackBerry API 4.6.0

Method Summary
static Background createBitmapBackground(Bitmap bitmap)
          Create a bitmap-based background.
static Background createBitmapBackground(Bitmap bitmap, int positionX, int positionY, int repeat)
          Create a bitmap-based background.
static Background createLinearGradientBackground(int colorTopLeft, int colorTopRight, int colorBottomRight, int colorBottomLeft)
          Create a linear gradient background.
static Background createSolidBackground(int color)
          Create a solid fill background.
static Background createSolidTransparentBackground(int color, int alpha)
          Create a solid fill and/or transparent background.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

createSolidBackground

public static Background createSolidBackground(int color)
Create a solid fill background.

Parameters:
color - 32-bit color in 0x00RRGGBB format
Returns:
Background object representing a solid fill background.
Since:
BlackBerry API 4.6.0

createSolidTransparentBackground

public static Background createSolidTransparentBackground(int color,
                                                          int alpha)
Create a solid fill and/or transparent background.

Parameters:
color - 32-bit color in 0x00RRGGBB format
alpha - 0 (clear) to 255 (opaque).
Returns:
Background object representing a solid fill and/or transparent background.
Since:
BlackBerry API 4.6.0

createBitmapBackground

public static Background createBitmapBackground(Bitmap bitmap)
Create a bitmap-based background.

Parameters:
bitmap - Bitmap graphic object.
Returns:
Background object representing a bitmap-based background.
Throws:
IllegalArgumentException - If bitmap is null.
Since:
BlackBerry API 4.6.0

createBitmapBackground

public static Background createBitmapBackground(Bitmap bitmap,
                                                int positionX,
                                                int positionY,
                                                int repeat)
Create a bitmap-based background.

Parameters:
bitmap - Bitmap graphic object.
positionX - Horizontal bitmap anchoring: POSITION_X_LEFT, POSITION_X_CENTER, POSITION_X_RIGHT.
positionY - Veritcal bitmap anchoring: POSITION_Y_TOP, POSITION_Y_CENTER, POSITION_Y_BOTTOM.
repeat - Bitmap tiling properties: REPEAT_NONE, REPEAT_HORIZONTAL, REPEAT_VERTICAL, REPEAT_BOTH, REPEAT_SCALE_TO_FIT.
Returns:
Background object representing a bitmap-based background.
Throws:
IllegalArgumentException - If bitmap is null.
Since:
BlackBerry API 4.6.0

createLinearGradientBackground

public static Background createLinearGradientBackground(int colorTopLeft,
                                                        int colorTopRight,
                                                        int colorBottomRight,
                                                        int colorBottomLeft)
Create a linear gradient background. Colors are in 32-bit 0x00RRGGBB format, i.e. opaque colors only.

Parameters:
colorTopLeft - Starting color at top-left corner of background.
colorTopRight - Starting color at top-right corner of background.
colorBottomRight - Starting color at bottom-right corner of background.
colorBottomLeft - Starting color at bottom-left corner of background.
Returns:
Background object representing a linear gradient background.
Since:
BlackBerry API 4.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal