public class nUISwitchButton extends nUIButtonElement implements ISwitchButton
TYPE_DEFAULT, 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
Constructor and Description |
---|
nUISwitchButton() |
nUISwitchButton(java.util.Hashtable properties) |
nUISwitchButton(java.lang.String label) |
nUISwitchButton(java.lang.String label,
java.util.Hashtable properties) |
Modifier and Type | Method and Description |
---|---|
int |
getAccentColor() |
int |
getOutlineColor() |
int |
getThumbColor() |
boolean |
isOn()
Is the switch currently enabled?
|
void |
setAccentColor(int accent_color) |
void |
setNumstates(int numstates)
The number of states for this element will always be 2, no matter what value is passed here.
|
void |
setOn(boolean on)
Set the position of the switch.
|
void |
setOutlineColor(int outline_color) |
void |
setTextColor(int text_color)
Sets the text color.
|
void |
setThumbColor(int thumb_color) |
void |
setType(int type)
Sets the switch type.
|
boolean |
toggle()
Toggles the switch.
|
getFocusable, getFontStyle, getGroupID, getNumstates, getState, getText, getTextalign, getTextColor, getType, setFontSize, setFontStyle, setGroupID, setState, setText, setTextalign
applyBackground, applyBackground, applyBackground
getBackgroundDrawable, getBottom, getElementIdentifier, getGesturable, getHeight, getInnerHeight, getInnerWidth, getInnerX, getInnerY, getLeft, getMaxChildX, getMaxChildY, getProperties, getProperty, getRight, getScreenInnerX, getScreenInnerY, getScreenX, getScreenY, getTop, getTopLevelParentView, getTopLevelParentWindow, getTriggerable, getWidth, getX, getY, insertAtInternal, isEnabled, isVisible, onRemoved, remove, setBackgroundDrawable, setBottom, setElementIdentifier, setEnabled, setFocusable, setGesturable, setHeight, setInnerHeight, setInnerWidth, setInnerX, setInnerY, setLeft, setProperties, setProperty, setRight, setTop, setTriggerable, setVisible, setWidth, setX, setY
add, addEventListener, childElementAt, childIndexOf, getFirstChild, getId, getLastChild, getNextSibling, getParent, getPrevSibling, getTag, insertAfter, insertAt, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setId, setTag, setUnlinkChildrenOnRemoval
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isEnabled, setEnabled
getText, setText
setBackgroundDrawable
public nUISwitchButton()
public nUISwitchButton(java.lang.String label)
public nUISwitchButton(java.util.Hashtable properties)
public nUISwitchButton(java.lang.String label, java.util.Hashtable properties)
public boolean toggle()
toggle
in interface ISwitchButton
public void setOn(boolean on)
setOn
in interface ISwitchButton
on
- Will be set to the "on" position, if true.public boolean isOn()
isOn
in interface ISwitchButton
true
if it is.public void setNumstates(int numstates)
setNumstates
in class nUIButtonElement
numstates
- Number of statespublic void setType(int type)
TYPE_DEFAULT
.setType
in class nUIButtonElement
type
- the switch type.java.lang.IllegalArgumentException
- if the switch type is not valid.public void setTextColor(int text_color)
nUIButtonElement
setTextColor
in interface ITextfieldElement
setTextColor
in class nUIButtonElement
text_color
- This is an AARRGGBB value - normally you will want to set the alpha portion fully opaquepublic void setThumbColor(int thumb_color)
public int getThumbColor()
public void setAccentColor(int accent_color)
public int getAccentColor()
public void setOutlineColor(int outline_color)
public int getOutlineColor()