|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.decor.BorderFactory
public final class BorderFactory
A factory class for creating different types of borders.
See Border
for more details.
In this class, edges refers to the number of pixels from the bitmap’s edge to be treated as the border and
corner refers to the width and height from the bitmap’s edge to be treated as the corners
(refer to the image below).
If you only specify edges and do not specify any value for corners, then by default it equals to edges
( corners = = edges
).
Method Summary | ||
---|---|---|
static Border |
createBevelBorder(XYEdges edges)
Create a bevel (3D) border. |
|
static Border |
createBevelBorder(XYEdges edges,
XYEdges colorsOuter,
XYEdges colorsInner)
Create a simple border with specified style. |
|
static Border |
createBitmapBorder(XYEdges edges,
Bitmap bitmap)
Create a bitmap border with specified outer edge dimensions. |
|
static Border |
createBitmapBorder(XYEdges edges,
XYEdges corners,
Bitmap bitmap)
Create a bitmap border with specified outer edge dimensions. |
|
static Border |
createColoredBitmapBorder(XYEdges edges,
Bitmap greyBitmap,
int color,
Bitmap overlayBitmap)
Create a colored bitmap border with specified outer edge dimensions. |
|
static Border |
createColoredBitmapBorder(XYEdges edges,
XYEdges corners,
Bitmap greyBitmap,
int color,
Bitmap overlayBitmap)
Create a colored bitmap border with specified outer edge dimensions. |
|
static Border |
createRoundedBorder(XYEdges edges)
Create a single-line rounded border. |
|
static Border |
createRoundedBorder(XYEdges edges,
int style)
Create a single-line rounded border with specified style. |
|
static Border |
createRoundedBorder(XYEdges edges,
int color,
int style)
Create a single-line rounded border with specified color and style. |
|
static Border |
createRoundedBorder(XYEdges edges,
int color,
int alpha,
int style)
Create a single-line rounded border with specified color and style. |
|
static Border |
createSimpleBorder(XYEdges edges)
Create a simple single-line solid border. |
|
static Border |
createSimpleBorder(XYEdges edges,
int style)
Create a simple border with specified style. |
|
static Border |
createSimpleBorder(XYEdges edges,
XYEdges colors,
int style)
Create a simple border with specified colors and style. |
|
static Border |
createSimpleBorder(XYEdges edges,
XYEdges colors,
XYEdges style)
Create a simple border with specified colors and styles. |
|
static Border |
createSimpleBorder(XYEdges edges,
XYEdges colors,
XYEdges alphas,
int style)
Create a simple border with specified colors and style. |
|
static Border |
createSimpleBorder(XYEdges edges,
XYEdges colors,
XYEdges alphas,
XYEdges style)
Create a simple border with specified colors and styles. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Border createSimpleBorder(XYEdges edges)
edges
- XYEdges object representing the thickness of the border in pixels.
IllegalArgumentException
- If edges
is null.public static Border createSimpleBorder(XYEdges edges, int style)
edges
- XYEdges object representing the thickness of the border in pixels.style
- STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
IllegalArgumentException
- If edges
is null.public static Border createSimpleBorder(XYEdges edges, XYEdges colors, int style)
edges
- XYEdges object representing the thickness of the border in pixels.colors
- XYEdges object representing the colors of the border's
four sides in 0xRRGGBB format (does not include alpha channel).style
- STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
IllegalArgumentException
- If edges
is null.public static Border createSimpleBorder(XYEdges edges, XYEdges colors, XYEdges alphas, int style)
edges
- XYEdges object representing the thickness of the border in pixels.colors
- XYEdges object representing the colors of the border's
four sides in 0xRRGGBB format (does not include alpha channel).alphas
- XYEdges object representing the alpha channels of the border's
four sides from 0 (fully transparent) to 255 (fully opaque).style
- STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
public static Border createSimpleBorder(XYEdges edges, XYEdges colors, XYEdges style)
edges
- XYEdges object representing the thickness of the border in pixels.colors
- XYEdges object representing the colors of the border's
four sides in 0xRRGGBB format (does not include alpha channel).style
- XYEdges object representing the styles of the border's
four sides: STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
IllegalArgumentException
- If edges
is null.public static Border createSimpleBorder(XYEdges edges, XYEdges colors, XYEdges alphas, XYEdges style)
edges
- XYEdges object representing the thickness of the border in pixels.colors
- XYEdges object representing the colors of the border's
four sides in 0xRRGGBB format (does not include alpha channel).alphas
- XYEdges object representing the alpha channels of the border's
four sides from 0 (fully transparent) to 255 (fully opaque).style
- XYEdges object representing the styles of the border's
four sides: STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
IllegalArgumentException
- If edges
is null.public static Border createRoundedBorder(XYEdges edges)
edges
- XYEdges object representing the thickness of the border in pixels.
IllegalArgumentException
- If edges
is null.public static Border createRoundedBorder(XYEdges edges, int style)
edges
- XYEdges object representing the thickness of the border in pixels.style
- STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
IllegalArgumentException
- If edges
is null.public static Border createRoundedBorder(XYEdges edges, int color, int style)
edges
- XYEdges object representing the thickness of the border in pixels.color
- 24-bit RGB color in 0xRRGGBB format (does not include alpha channel).style
- STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
IllegalArgumentException
- If edges
is null.public static Border createRoundedBorder(XYEdges edges, int color, int alpha, int style)
edges
- XYEdges object representing the thickness of the border in pixels.color
- 24-bit RGB color in 0xRRGGBB format (does not include alpha channel).alpha
- 8-bit alpha channel from 0 (fully transparent) to 255 (fully opaque).style
- STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
IllegalArgumentException
- If edges
is null.public static Border createBitmapBorder(XYEdges edges, Bitmap bitmap)
edges
- XYEdges object representing the thickness of the border in pixels.bitmap
- Reference to bitmap for the border.
IllegalArgumentException
- If either of the parameters, edges
or bitmap
, is null;
if XYEdges object is empty;
if the total value of the left and right edges is greater than the width of the bitmap;
if the total value of the top and bottom edges is greater than the height of the bitmap.
In other words, this exception is thrown for any of the following conditions:
edges = = null
edges.isEmpty() = = true
bitmap = = null
edges.right + edges.left <e; bitmap.getWidth()
edges.top + edges.bottom <e; bitmap.getHeight()
public static Border createBitmapBorder(XYEdges edges, XYEdges corners, Bitmap bitmap)
edges
- XYEdges object representing the thickness of the border in pixels.corners
- XYEdgse boject representing the width (corners.left
,
corners.right
) and height (corners.top
, corners.bottom
)
of the corner bitmaps.bitmap
- Reference to bitmap for the border.
IllegalArgumentException
- If any of the parameters: edges
, corners
, or bitmap
, is null;
if the total value of the left and right edges is greater than the width of the bitmap;
if the total value of the top and bottom edges is greater than the height of the bitmap;
if the dimensions for the corner is less than edges.
In other words, this exception is thrown for any of the following conditions:
edges = = null
edges.isEmpty() = = true
corners = = null
bitmap = = null
(corners.top < edges.top) || (corners.right < edges.right)
|| (corners.bottom < edges.bottom) || (corners.left < edges.left)
edges.right + edges.left <e; bitmap.getWidth()
edges.top + edges.bottom <e; bitmap.getHeight()
public static Border createBevelBorder(XYEdges edges)
edges
- XYEdges object representing the thickness of the border in pixels.
IllegalArgumentException
- If edges
is null.public static Border createBevelBorder(XYEdges edges, XYEdges colorsOuter, XYEdges colorsInner)
edges
- XYEdges object representing the thickness of the border in pixels.colorsOuter
- XYEdges object representing the colors of the bevel's outer edge.colorsInner
- XYEdges object representing the colors of the bevel's inner edge.
IllegalArgumentException
- If edges
is null.public static Border createColoredBitmapBorder(XYEdges edges, Bitmap greyBitmap, int color, Bitmap overlayBitmap)
edges
- XYEdges object representing the thickness of the border in pixels.greyBitmap
- Reference to greyscale bitmap for bordercolor
- Integer representation of color to make final borderoverlayBitmap
- Image to be overlayed on colored border. Passing null means no overlay is to be used.
IllegalArgumentException
- If either of the parameters, edges
or bitmap
, is null;
if XYEdges object is empty;
if the total value of the left and right edges is greater than the width of the bitmap;
if the total value of the top and bottom edges is greater than the height of the bitmap.
In other words, this exception is thrown for any of the following conditions:
edges = = null
edges.isEmpty() = = true
bitmap = = null
edges.right + edges.left <e; bitmap.getWidth()
edges.top + edges.bottom <e; bitmap.getHeight()
public static Border createColoredBitmapBorder(XYEdges edges, XYEdges corners, Bitmap greyBitmap, int color, Bitmap overlayBitmap)
edges
- XYEdges object representing the thickness of the border in pixels.corners
- XYEdges boject representing the width (corners.left
,
corners.right
) and height (corners.top
, corners.bottom
)
of the corner bitmaps.greyBitmap
- Reference to greyscale bitmap for bordercolor
- Integer representation of color to make final borderoverlayBitmap
- Image to be overlayed on colored border. Passing null means no overlay is to be used.
IllegalArgumentException
- If any of the parameters: edges
, corners
, or bitmap
, is null;
if the total value of the left and right edges is greater than the width of the bitmap;
if the total value of the top and bottom edges is greater than the height of the bitmap;
if the dimensions for the corner is less than edges.
In other words, this exception is thrown for any of the following conditions:
edges = = null
edges.isEmpty() = = true
corners = = null
bitmap = = null
(corners.top < edges.top) || (corners.right < edges.right)
|| (corners.bottom < edges.bottom) || (corners.left < edges.left)
edges.right + edges.left <e; bitmap.getWidth()
edges.top + edges.bottom <e; bitmap.getHeight()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.