public class nUIButtonElement extends nUIElementDisplay
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_DEFAULT |
static int |
TYPE_LIST |
Y_IDENTIFIER_PREV_BOTTOM
COLOR_BACKGROUND_NORMAL, COLOR_BLACK, COLOR_FOREGROUND_DARK, COLOR_FOREGROUND_LIGHT, COLOR_FOREGROUND_NORMAL, COLOR_TRANSPARENT, COLOR_WHITE, DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONS
event_listener, event_listener_exclusive, first_child, last_child, next_sibling, nuiid, parent, prev_sibling, unlink_children_on_removal_from_parent
Constructor and Description |
---|
nUIButtonElement(int nuiid,
java.lang.String text)
Default button constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
getFocusable()
Gets whether or not this object is focusable.
|
int |
getFontSize()
Gets the current font size.
|
int |
getFontStyle()
Gets the current font style used for text on this button.
|
int |
getGroupID()
Gets the current group that this button belongs to.
|
int |
getNumstates()
Gets the current number of states that this button can be in.
|
int |
getState()
Gets the current state of this button.
|
java.lang.String |
getText()
Gets the text used to label this button.
|
int |
getTextalign()
Gets the current horizontal text alignment.
|
int |
getTextColor()
Gets the current text color used for this button element.
|
int |
getType()
Gets the current button type.
|
void |
setFontSize(int font_size)
Sets the size of the font to use.
|
void |
setFontSizeAbsolute(int size_in_pixels,
boolean accessibility_adjusted)
Sets absolute font size in pixels.
|
void |
setFontSizeRelative(int rel_font_id,
int scale)
Sets font size relative to the one of the predefined sizes.
|
void |
setFontStyle(int font_style)
Sets the style of the font to use.
|
void |
setGroupID(int group_id)
Sets the group ID of this button.
Groups start from 0 and go upwards. |
void |
setNumstates(int numstates)
Sets the number of states that this button has.
|
void |
setState(int state)
Sets the current state of this button.
|
void |
setText(java.lang.String text)
Sets the text to display.
|
void |
setTextalign(int textalign)
Sets the text horizontal alignment.
|
void |
setTextColor(int text_color)
Sets the text color.
|
void |
setType(int type)
Sets the button type.
|
getY, insertAt
getBackgroundDrawable, getBgcolor, getBottom, getFocus, getGesturable, getHeight, getInnerHeight, getInnerWidth, getInnerX, getInnerY, getLeft, getMaxChildX, getMaxChildY, getRight, getScreenInnerX, getScreenInnerY, getScreenX, getScreenY, getTop, getTopLevelParentView, getTopLevelParentWindow, getTriggerable, getWidth, getX, insertAtInternal, isEnabled, onRemoved, remove, setBackgroundDrawable, setBgcolor, setBottom, setChildFocus, setEnabled, setFocus, setFocusable, setGesturable, setHeight, setInnerHeight, setInnerWidth, setInnerX, setInnerY, setLeft, setRight, setTop, setTriggerable, setWidth, setX, setY
add, addEventListener, childElementAt, childIndexOf, getTag, insertAfter, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setTag
public static final int TYPE_DEFAULT
public static final int TYPE_LIST
public nUIButtonElement(int nuiid, java.lang.String text)
nuiid
- Unique Native UI ID (or -1 if unidentified)text
- The text displayed by this buttonpublic boolean getFocusable()
nUIDisplayObject
getFocusable
in class nUIDisplayObject
public void setType(int type)
type
- the button type.java.lang.IllegalArgumentException
- if the button type is not valid.public int getType()
public void setText(java.lang.String text)
text
- Text to displayjava.lang.NullPointerException
- if text is nullpublic java.lang.String getText()
public void setTextalign(int textalign)
textalign
- Horizontal text alignmentjava.lang.IllegalArgumentException
- if textalign is not nUIConstants.left, center or rightpublic int getTextalign()
nUIConstants
.public void setGroupID(int group_id)
group_id
- the group id of this button, or -1 for "ungrouped".public int getGroupID()
public void setState(int state)
state
- State valuejava.lang.IllegalArgumentException
- if state is less than 0 or greater than or equal to numstatespublic int getState()
getNumstates()-1
.public void setNumstates(int numstates)
numstates
- Number of statesjava.lang.IllegalArgumentException
- if numstatus is less than or equal to 0public int getNumstates()
public void setTextColor(int text_color)
text_color
- This is an AARRGGBB value - normally you will want to set the alpha portion fully opaquepublic int getTextColor()
public void setFontSize(int font_size)
font_size
- One of the following NUIConstants: size_tiny, size_samll, size_medium, size_large, size_hugejava.lang.IllegalArgumentException
- if font_size is not validpublic int getFontSize()
public void setFontSizeAbsolute(int size_in_pixels, boolean accessibility_adjusted)
size_in_pixels
- any positive numberaccessibility_adjusted
- if true, some platforms can scale the actual font size depending on system properties.public void setFontSizeRelative(int rel_font_id, int scale)
rel_font_id
- one of the following NUIConstants: size_tiny, size_samll, size_medium, size_large, size_hugescale
- positive number in percentages.public void setFontStyle(int font_style)
font_style
- Any of nUIConstants.style_*
java.lang.IllegalArgumentException
- if font_style is not validpublic int getFontStyle()
nUIConstants.style_*