AI2 Component
(Version nb184)
|
Public Member Functions | |
Label (ComponentContainer container) | |
View | getView () |
int | TextAlignment () |
void | TextAlignment (int alignment) |
int | BackgroundColor () |
void | BackgroundColor (int argb) |
boolean | FontBold () |
void | FontBold (boolean bold) |
boolean | FontItalic () |
void | FontItalic (boolean italic) |
boolean | HasMargins () |
void | HasMargins (boolean hasMargins) |
float | FontSize () |
void | FontSize (float size) |
int | FontTypeface () |
void | FontTypeface (int typeface) |
String | Text () |
void | Text (String text) |
String | HTMLContent () |
boolean | HTMLFormat () |
void | HTMLFormat (boolean fmt) |
int | TextColor () |
void | TextColor (int argb) |
Public Member Functions inherited from com.google.appinventor.components.runtime.AndroidViewComponent | |
boolean | Visible () |
void | Visible (boolean visibility) |
int | Width () |
void | Width (int width) |
void | WidthPercent (int pCent) |
void | setLastWidth (int width) |
int | getSetWidth () |
void | setLastHeight (int height) |
int | getSetHeight () |
void | CopyWidth (AndroidViewComponent sourceComponent) |
int | Height () |
void | Height (int height) |
void | HeightPercent (int pCent) |
void | CopyHeight (AndroidViewComponent sourceComponent) |
int | Column () |
void | Column (int column) |
int | Row () |
void | Row (int row) |
HandlesEventDispatching | getDispatchDelegate () |
Additional Inherited Members | |
Static Public Attributes inherited from com.google.appinventor.components.runtime.Component | |
static final String | ASSET_DIRECTORY = "component" |
static final int | ALIGNMENT_NORMAL = 0 |
static final int | ALIGNMENT_CENTER = 1 |
static final int | ALIGNMENT_OPPOSITE = 2 |
static final int | ACCELEROMETER_SENSITIVITY_WEAK = 1 |
static final int | ACCELEROMETER_SENSITIVITY_MODERATE = 2 |
static final int | ACCELEROMETER_SENSITIVITY_STRONG = 3 |
static final int | BUTTON_SHAPE_DEFAULT = 0 |
static final int | BUTTON_SHAPE_ROUNDED = 1 |
static final int | BUTTON_SHAPE_RECT = 2 |
static final int | BUTTON_SHAPE_OVAL = 3 |
static final int | COLOR_NONE = 0x00FFFFFF |
static final int | COLOR_BLACK = 0xFF000000 |
static final int | COLOR_BLUE = 0xFF0000FF |
static final int | COLOR_CYAN = 0xFF00FFFF |
static final int | COLOR_DKGRAY = 0xFF444444 |
static final int | COLOR_GRAY = 0xFF888888 |
static final int | COLOR_GREEN = 0xFF00FF00 |
static final int | COLOR_LTGRAY = 0xFFCCCCCC |
static final int | COLOR_MAGENTA = 0xFFFF00FF |
static final int | COLOR_ORANGE = 0xFFFFC800 |
static final int | COLOR_PINK = 0xFFFFAFAF |
static final int | COLOR_RED = 0xFFFF0000 |
static final int | COLOR_WHITE = 0xFFFFFFFF |
static final int | COLOR_YELLOW = 0xFFFFFF00 |
static final int | COLOR_DEFAULT = 0x00000000 |
static final String | DEFAULT_VALUE_COLOR_NONE = "&H00FFFFFF" |
static final String | DEFAULT_VALUE_COLOR_BLACK = "&HFF000000" |
static final String | DEFAULT_VALUE_COLOR_BLUE = "&HFF0000FF" |
static final String | DEFAULT_VALUE_COLOR_CYAN = "&HFF00FFFF" |
static final String | DEFAULT_VALUE_COLOR_DKGRAY = "&HFF444444" |
static final String | DEFAULT_VALUE_COLOR_GRAY = "&HFF888888" |
static final String | DEFAULT_VALUE_COLOR_GREEN = "&HFF00FF00" |
static final String | DEFAULT_VALUE_COLOR_LTGRAY = "&HFFCCCCCC" |
static final String | DEFAULT_VALUE_COLOR_MAGENTA = "&HFFFF00FF" |
static final String | DEFAULT_VALUE_COLOR_ORANGE = "&HFFFFC800" |
static final String | DEFAULT_VALUE_COLOR_PINK = "&HFFFFAFAF" |
static final String | DEFAULT_VALUE_COLOR_RED = "&HFFFF0000" |
static final String | DEFAULT_VALUE_COLOR_WHITE = "&HFFFFFFFF" |
static final String | DEFAULT_VALUE_COLOR_YELLOW = "&HFFFFFF00" |
static final String | DEFAULT_VALUE_COLOR_DEFAULT = "&H00000000" |
static final float | FONT_DEFAULT_SIZE = 14 |
static final int | LAYOUT_ORIENTATION_HORIZONTAL = ComponentConstants.LAYOUT_ORIENTATION_HORIZONTAL |
static final int | LAYOUT_ORIENTATION_VERTICAL = ComponentConstants.LAYOUT_ORIENTATION_VERTICAL |
static final int | SCALING_SCALE_PROPORTIONALLY = 0 |
static final int | SCALING_SCALE_TO_FIT = 1 |
static final int | TYPEFACE_DEFAULT = 0 |
static final int | TYPEFACE_SANSSERIF = 1 |
static final int | TYPEFACE_SERIF = 2 |
static final int | TYPEFACE_MONOSPACE = 3 |
static final int | LENGTH_PREFERRED = -1 |
static final int | LENGTH_FILL_PARENT = -2 |
static final int | LENGTH_UNKNOWN = -3 |
static final int | LENGTH_PERCENT_TAG = -1000 |
static final int | TOAST_LENGTH_SHORT = 0 |
static final int | TOAST_LENGTH_LONG = 1 |
static final int | DIRECTION_NORTH = 1 |
static final int | DIRECTION_NORTHEAST = 2 |
static final int | DIRECTION_EAST = 3 |
static final int | DIRECTION_SOUTHEAST = 4 |
static final int | DIRECTION_SOUTH = -1 |
static final int | DIRECTION_SOUTHWEST = -2 |
static final int | DIRECTION_WEST = -3 |
static final int | DIRECTION_NORTHWEST = -4 |
static final int | DIRECTION_NONE = 0 |
static final int | DIRECTION_MIN = -4 |
static final int | DIRECTION_MAX = 4 |
static float | SLIDER_MIN_VALUE = 10 |
static float | SLIDER_MAX_VALUE = 50 |
static float | SLIDER_THUMB_VALUE = (SLIDER_MIN_VALUE + SLIDER_MAX_VALUE) / 2.0f |
static final String | DEFAULT_VALUE_TEXT_TO_SPEECH_COUNTRY = "" |
static final String | DEFAULT_VALUE_TEXT_TO_SPEECH_LANGUAGE = "" |
Protected Member Functions inherited from com.google.appinventor.components.runtime.AndroidViewComponent | |
AndroidViewComponent (ComponentContainer container) | |
Protected Member Functions inherited from com.google.appinventor.components.runtime.VisibleComponent | |
VisibleComponent () | |
Protected Attributes inherited from com.google.appinventor.components.runtime.AndroidViewComponent | |
final ComponentContainer | container |
Labels are components used to show text.
A label displays text which is specified by the Text
property. Other properties, all of which can be set in the Designer or Blocks Editor, control the appearance and placement of the text.
Definition at line 40 of file Label.java.
com.google.appinventor.components.runtime.Label.Label | ( | ComponentContainer | container | ) |
Creates a new Label component.
container | container, component will be placed in |
Definition at line 87 of file Label.java.
int com.google.appinventor.components.runtime.Label.BackgroundColor | ( | ) |
Returns the label's background color as an alpha-red-green-blue integer.
Definition at line 177 of file Label.java.
void com.google.appinventor.components.runtime.Label.BackgroundColor | ( | int | argb | ) |
Specifies the label's background color as an alpha-red-green-blue integer.
argb | background RGB color with alpha |
Definition at line 190 of file Label.java.
boolean com.google.appinventor.components.runtime.Label.FontBold | ( | ) |
Returns true if the label's text should be bold. If bold has been requested, this property will return true, even if the font does not support bold.
Definition at line 209 of file Label.java.
void com.google.appinventor.components.runtime.Label.FontBold | ( | boolean | bold | ) |
Specifies whether the label's text should be bold. Some fonts do not support bold.
bold |
Definition at line 223 of file Label.java.
boolean com.google.appinventor.components.runtime.Label.FontItalic | ( | ) |
Returns true if the label's text should be italic. If italic has been requested, this property will return true, even if the font does not support italic.
Definition at line 238 of file Label.java.
void com.google.appinventor.components.runtime.Label.FontItalic | ( | boolean | italic | ) |
Specifies whether the label's text should be italic. Some fonts do not support italic.
italic |
Definition at line 252 of file Label.java.
float com.google.appinventor.components.runtime.Label.FontSize | ( | ) |
Returns the label's text's font size, measured in sp(scale-independent pixels).
Definition at line 302 of file Label.java.
void com.google.appinventor.components.runtime.Label.FontSize | ( | float | size | ) |
Specifies the label's text's font size, measured in sp(scale-independent pixels).
size | font size in sp (scale-independent pixels) |
Definition at line 314 of file Label.java.
int com.google.appinventor.components.runtime.Label.FontTypeface | ( | ) |
Returns the label's text's font face as default, serif, sans serif, or monospace.
Definition at line 330 of file Label.java.
void com.google.appinventor.components.runtime.Label.FontTypeface | ( | int | typeface | ) |
Specifies the label's text's font face as default, serif, sans serif, or monospace.
typeface | one of Component#TYPEFACE_DEFAULT, Component#TYPEFACE_SERIF, Component#TYPEFACE_SANSSERIF or Component#TYPEFACE_MONOSPACE |
Definition at line 347 of file Label.java.
View com.google.appinventor.components.runtime.Label.getView | ( | ) |
Returns the View that is displayed in the UI.
Reimplemented from com.google.appinventor.components.runtime.AndroidViewComponent.
Definition at line 130 of file Label.java.
boolean com.google.appinventor.components.runtime.Label.HasMargins | ( | ) |
Returns true if the label should have margins.
Definition at line 268 of file Label.java.
void com.google.appinventor.components.runtime.Label.HasMargins | ( | boolean | hasMargins | ) |
Specifies whether the label should have margins. This margin value is not well coordinated with the designer, where the margins are defined for the arrangement, not just for individual labels.
hasMargins |
Definition at line 284 of file Label.java.
String com.google.appinventor.components.runtime.Label.HTMLContent | ( | ) |
Returns the content of the Label as HTML. This is only useful if the HTMLFormat property is true.
Definition at line 387 of file Label.java.
boolean com.google.appinventor.components.runtime.Label.HTMLFormat | ( | ) |
Returns the label's text's format
Definition at line 406 of file Label.java.
void com.google.appinventor.components.runtime.Label.HTMLFormat | ( | boolean | fmt | ) |
Specifies the label's text's format
Definition at line 419 of file Label.java.
String com.google.appinventor.components.runtime.Label.Text | ( | ) |
Returns the text displayed by the label.
Definition at line 359 of file Label.java.
void com.google.appinventor.components.runtime.Label.Text | ( | String | text | ) |
Specifies the text displayed by the label.
text | new caption for label |
Definition at line 371 of file Label.java.
int com.google.appinventor.components.runtime.Label.TextAlignment | ( | ) |
Returns the alignment of the label's text: center, normal (e.g., left-justified if text is written left to right), or opposite (e.g., right-justified if text is written left to right).
Definition at line 146 of file Label.java.
void com.google.appinventor.components.runtime.Label.TextAlignment | ( | int | alignment | ) |
Specifies the alignment of the label's text: center, normal (e.g., left-justified if text is written left to right), or opposite (e.g., right-justified if text is written left to right).
alignment | one of Component#ALIGNMENT_NORMAL, Component#ALIGNMENT_CENTER or Component#ALIGNMENT_OPPOSITE |
Definition at line 163 of file Label.java.
int com.google.appinventor.components.runtime.Label.TextColor | ( | ) |
Returns the label's text color as an alpha-red-green-blue integer.
Definition at line 439 of file Label.java.
void com.google.appinventor.components.runtime.Label.TextColor | ( | int | argb | ) |
Specifies the label's text color as an alpha-red-green-blue integer.
argb | text RGB color with alpha |
Definition at line 452 of file Label.java.