|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.ui.Field
net.rim.device.api.ui.component.BitmapField
public class BitmapField
Displays a bitmap.
By default this field uses only enough area to fit its contained bitmap. If you specify an alignment style at construction, the field always uses the full width of the controlling manager's layout.
Behaviour
Displays a bitmap. By specifying the Field.FOCUSABLE style at
construction, you can make this field focusable.
| Field Summary | ||
|---|---|---|
static int |
STAMP_MONOCHROME
Stamp option. |
|
| Fields inherited from interface net.rim.device.api.ui.DrawStyle |
|---|
BASELINE, BOTTOM, ELLIPSIS, HALIGN_MASK, HCENTER, HDEFAULT, HFULL, LEADING, LEFT, RIGHT, TOP, TRAILING, TRUNCATE_BEGINNING, VALIGN_MASK, VCENTER, VDEFAULT, VFULL |
| Constructor Summary | ||
|---|---|---|
BitmapField()
Constructs a new BitmapField instance. |
||
BitmapField(Bitmap bitmap)
Constructs a new BitmapField instance with provided bitmap. |
||
BitmapField(Bitmap bitmap,
long style)
Constructs a new BitmapField instance with provided bitmap and alignment style. |
||
| Method Summary | ||
|---|---|---|
protected void |
drawFocus(Graphics graphics,
boolean on)
Draws the focus indicator for this field. |
|
int |
getBitmapHeight()
Retrieves the height of this bitmap. |
|
int |
getBitmapWidth()
Retrieves the width of this bitmap. |
|
int |
getPreferredHeight()
Retrieves this field's preferred height. |
|
int |
getPreferredWidth()
Retrieves this field's preferred width. |
|
protected void |
layout(int width,
int height)
Lays out this field's contents. |
|
protected void |
paint(Graphics graphics)
Redraws this field. |
|
void |
setBitmap(Bitmap bitmap)
Sets the bitmap for this field. |
|
void |
setImage(EncodedImage image)
Sets the EncodedImage for this field. |
|
void |
setSpace(int hSpace,
int vSpace)
Sets the border region for this field. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int STAMP_MONOCHROME
| Constructor Detail |
|---|
public BitmapField()
This field uses the default style.
public BitmapField(Bitmap bitmap)
This field uses the default style.
bitmap - Bitmap to display in field.
public BitmapField(Bitmap bitmap,
long style)
Use this method to build a bitmap with a specified alignment
style. To build an alignment style value, you can combine one of
VCENTER, TOP, and BOTTOM with one
of HCENTER, LEFT, and RIGHT.
If the horizontal alignments is DEFAULT (0), it
will remain as DEFAULT, but behave as if it is LEFT.
If the vertical alignment is DEFAULT (0), it
will remain as DEFAULT, but behave as if it is TOP.
Note: If you want this field to be focusable, then you
should also include Field.FOCUSABLE
bitmap - Bitmap to display in field.style - Alignment style for this field.| Method Detail |
|---|
protected void drawFocus(Graphics graphics,
boolean on)
This field's manager invokes this method after painting the field. Note that this method inverts only the bitmap itself, not the border region.
drawFocus in class Fieldgraphics - Graphics context for drawing the focus.on - True if the focus should be set; otherwise, false.public int getBitmapHeight()
public int getBitmapWidth()
public int getPreferredHeight()
Field.getPreferredHeight() for more information.
This field's manager invokes this method to assist in its layout.
getPreferredHeight in class Fieldpublic int getPreferredWidth()
Field.getPreferredWidth() for more information.
This field's manager invokes this method to assist in its layout.
getPreferredWidth in class Field
protected void layout(int width,
int height)
This field's manager invokes this method during the layout process to instruct this field to arrange its contents, given an amount of available space.
layout in class Fieldwidth - Amount of available horizontal space.height - Amount of available vertical space.protected void paint(Graphics graphics)
This field's manager invokes this method during the repainting process to instruct this field to repaint itself. Note that invoking this method prompts a repaint of the entire bitmap contained in this field.
paint in class Fieldgraphics - Graphics context for repainting this field.public void setBitmap(Bitmap bitmap)
Provide a bitmap to this method to specify the image that this field should contain and display.
Using this method invokes Field.fieldChangeNotify(int), and marks the
field as invalid (as long as this field is controlled by a valid manager).
bitmap - Bitmap image to display.public void setImage(EncodedImage image)
Provide an EncodedImage to this method to specify the image that this field should contain and display.
Using this method invokes Field.fieldChangeNotify(int), and marks the
field as invalid (as long as this field is controlled by a valid manager).
image - EncodedImage to display.
public void setSpace(int hSpace,
int vSpace)
Use this method to specify the amount of horizontal and vertical padding placed around this field's contained bitmap image.
hSpace - Number of pixels of padding for both left and right sides.vSpace - Number of pixels of padding for both top and bottom edges.
|
|||||||||
| 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.