|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectButtonField
rebuild.ui.component.CustomButtonField
public class CustomButtonField
Customizable button
Field Summary | |
---|---|
static int |
BOTTOM
Put the text on the bottom of the button. |
protected EncodedImage |
cIcon
Click icon for when the button is clicked. |
protected EncodedImage |
fIcon
Focus icon for when the button is focused. |
protected int |
gap
The gap between the icon and the text, used when the text is not centered. |
static int |
HCENTER
Put the text in the center (horizontal) of the button. |
static int |
LEFT
Put the text on the left of the button. |
protected int |
maxW
The maximum width of the button, used only for text. |
protected EncodedImage |
nIcon
Normal icon. |
static int |
RIGHT
Put the text on the right of the button. |
protected int |
scale
The scale of the icon if one exists. |
protected int |
textLocation
Flag that tells where the text is located. |
static int |
TOP
Put the text on the top of the button. |
static int |
VCENTER
Put the text in the center (vertical) of the button. |
Constructor Summary | |
---|---|
CustomButtonField()
Create a new CustomButtonField. |
|
CustomButtonField(long style)
Create a new CustomButtonField. |
|
CustomButtonField(java.lang.String label)
Create a new CustomButtonField. |
|
CustomButtonField(java.lang.String label,
long style)
Create a new CustomButtonField. |
Method Summary | |
---|---|
Bitmap |
getClickIconBitmap()
Get the click icon as a Bitmap. |
EncodedImage |
getClickIconEncoded()
Get the click icon as a EncodedImage. |
Bitmap |
getFocusIconBitmap()
Get the focus icon as a Bitmap. |
EncodedImage |
getFocusIconEncoded()
Get the focus icon as a EncodedImage. |
int |
getIconScale()
Get the scale that the icon/s should be drawn at as a Fixed32 number. |
int |
getMaxWidth()
Get the maximum width of the button when displaying text. |
Bitmap |
getNormalIconBitmap()
Get the normal icon as a Bitmap. |
EncodedImage |
getNormalIconEncoded()
Get the normal icon as a EncodedImage. |
int |
getPreferredHeight()
Retrieves this field's preferred height. |
int |
getPreferredWidth()
Retrieves this field's preferred width. |
int |
getTextGap()
Get the gap between the icon and the text. |
int |
getTextLocation()
Get the text location. |
protected void |
paint(Graphics graphics)
Invoked by the framework to redraw a portion of this field. |
void |
setClickIcon(Bitmap ico)
Set the click icon using a Bitmap. |
void |
setClickIcon(EncodedImage ico)
Set the click icon using a EncodedImage. |
void |
setFocusIcon(Bitmap ico)
Set the focus icon using a Bitmap. |
void |
setFocusIcon(EncodedImage ico)
Set the focus icon using a EncodedImage. |
void |
setIconScale(int fix32scale)
Set the scale of the icon. |
void |
setMaxWidth(int w)
Set the maximum width of the button when displaying text. |
void |
setNormalIcon(Bitmap ico)
Set the normal icon using a Bitmap. |
void |
setNormalIcon(EncodedImage ico)
Set the normal icon using a EncodedImage. |
void |
setTextGap(int g)
Set the gap between the icon and the text. |
void |
setTextLocation(int loc)
Set the text location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BOTTOM
public static final int TOP
public static final int LEFT
public static final int RIGHT
public static final int VCENTER
public static final int HCENTER
protected EncodedImage nIcon
protected EncodedImage fIcon
protected EncodedImage cIcon
protected int textLocation
protected int gap
protected int scale
protected int maxW
Constructor Detail |
---|
public CustomButtonField()
public CustomButtonField(long style)
style
- The button style, use the standard Field style flags.public CustomButtonField(java.lang.String label)
label
- The text to use for the field.public CustomButtonField(java.lang.String label, long style)
label
- The text to use for the field.style
- The button style, use the standard Field style flags.Method Detail |
---|
public int getPreferredHeight()
public int getPreferredWidth()
protected void paint(Graphics graphics)
graphics
- Graphics context for drawing in this field.public void setNormalIcon(Bitmap ico)
ico
- The icon to set or null if no normal icon should be set.public void setNormalIcon(EncodedImage ico)
ico
- The icon to set or null if no normal icon should be set.public Bitmap getNormalIconBitmap()
public EncodedImage getNormalIconEncoded()
public void setFocusIcon(Bitmap ico)
ico
- The icon to set or null if no focus icon should be set.public void setFocusIcon(EncodedImage ico)
ico
- The icon to set or null if no focus icon should be set.public Bitmap getFocusIconBitmap()
public EncodedImage getFocusIconEncoded()
public void setClickIcon(Bitmap ico)
ico
- The icon to set or null if no focus icon should be set.public void setClickIcon(EncodedImage ico)
ico
- The icon to set or null if no focus icon should be set.public Bitmap getClickIconBitmap()
public EncodedImage getClickIconEncoded()
public void setTextLocation(int loc)
loc
- Use either BOTTOM, TOP, LEFT, RIGHT, VCENTER, HCENTER.public int getTextLocation()
public void setTextGap(int g)
g
- The gap in pixels.public int getTextGap()
public void setMaxWidth(int w)
w
- The maximum width, anything <= 0 means that there is no maximum width.public int getMaxWidth()
public void setIconScale(int fix32scale)
fix32scale
- The scale the icon/s should be drawn at. Must be a valid Fixed32 number and must be in the format of 0 < fix32scale <= 1. 0 is equal to a 0x0 px icon, 1 is equal to the same size as the icon loaded, etc..public int getIconScale()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |