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

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

public final class BorderFactory
extends Object

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 ).

Image explaining border and edges

Since:
BlackBerry API 4.6.0

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 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 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

createSimpleBorder

public static Border createSimpleBorder(XYEdges edges)
Create a simple single-line solid border.

Parameters:
edges - XYEdges object representing the thickness of the border in pixels.
Returns:
Border object representing a simple single-line solid border.
Throws:
IllegalArgumentException - If edges is null.
Since:
BlackBerry API 4.6.0

createSimpleBorder

public static Border createSimpleBorder(XYEdges edges,
                                        int style)
Create a simple border with specified style.

Parameters:
edges - XYEdges object representing the thickness of the border in pixels.
style - STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
Returns:
Border object representing a simple border.
Throws:
IllegalArgumentException - If edges is null.
Since:
BlackBerry API 4.6.0

createSimpleBorder

public static Border createSimpleBorder(XYEdges edges,
                                        XYEdges colors,
                                        int style)
Create a simple border with specified colors and style.

Parameters:
edges - XYEdges object representing the thickness of the border in pixels.
colors - XYEdges object representing the colors of the border's four sides in 0xAARRGGBB format (includes alpha channel).
style - STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
Returns:
Border object representing a simple border.
Throws:
IllegalArgumentException - If edges is null.
Since:
BlackBerry API 4.6.0

createSimpleBorder

public static Border createSimpleBorder(XYEdges edges,
                                        XYEdges colors,
                                        XYEdges style)
Create a simple border with specified colors and styles.

Parameters:
edges - XYEdges object representing the thickness of the border in pixels.
colors - XYEdges object representing the colors of the border's four sides in 0xAARRGGBB format (includes alpha channel).
styles - XYEdges object representing the styles of the border's four sides: STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
Returns:
Border object representing a simple border.
Throws:
IllegalArgumentException - If edges is null.
Since:
BlackBerry API 4.6.0

createRoundedBorder

public static Border createRoundedBorder(XYEdges edges)
Create a single-line rounded border.

Parameters:
edges - XYEdges object representing the thickness of the border in pixels.
Returns:
Border object representing a rounded border.
Throws:
IllegalArgumentException - If edges is null.
Since:
BlackBerry API 4.6.0

createRoundedBorder

public static Border createRoundedBorder(XYEdges edges,
                                         int style)
Create a single-line rounded border with specified style.

Parameters:
edges - XYEdges object representing the thickness of the border in pixels.
style - STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
Returns:
Border object representing a rounded border.
Throws:
IllegalArgumentException - If edges is null.
Since:
BlackBerry API 4.6.0

createRoundedBorder

public static Border createRoundedBorder(XYEdges edges,
                                         int color,
                                         int style)
Create a single-line rounded border with specified color and style.

Parameters:
edges - XYEdges object representing the thickness of the border in pixels.
color - 32-bit RGB color in 0xAARRGGBB format (includes alpha channel).
style - STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
Returns:
Border object representing a rounded border.
Throws:
IllegalArgumentException - If edges is null.
Since:
BlackBerry API 4.6.0

createBitmapBorder

public static Border createBitmapBorder(XYEdges edges,
                                        Bitmap bitmap)
Create a bitmap border with specified outer edge dimensions.

Parameters:
edges - XYEdges object representing the thickness of the border in pixels.
bitmap - Reference to bitmap for the border.
Throws:
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()
Since:
BlackBerry API 4.6.0

createBitmapBorder

public static Border createBitmapBorder(XYEdges edges,
                                        XYEdges corners,
                                        Bitmap bitmap)
Create a bitmap border with specified outer edge dimensions.

Parameters:
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.
Throws:
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()
Since:
BlackBerry API 4.6.0

createBevelBorder

public static Border createBevelBorder(XYEdges edges)
Create a bevel (3D) border. By default, the inner and outer border colors consist of Color.LIGHTGRAY and Color.DARKGRAY.

Parameters:
edges - XYEdges object representing the thickness of the border in pixels.
Throws:
IllegalArgumentException - If edges is null.
Since:
BlackBerry API 4.6.0

createBevelBorder

public static Border createBevelBorder(XYEdges edges,
                                       XYEdges colorsOuter,
                                       XYEdges colorsInner)
Create a simple border with specified style.

Parameters:
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.
Throws:
IllegalArgumentException - If edges is null.
Since:
BlackBerry API 4.6.0





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.