com.intel.ui
Class Label
java.lang.Objectcom.intel.ui.Widget
com.intel.ui.Label
public abstract class Label
- extends Widget
This abstract class represents a leaf Widget
of a transparent box with text.
Field Summary | |
---|---|
static byte |
FONT_TYPE_NEO_SANS_INTEL
Neo Sans Intel font. |
Method Summary | |
---|---|
static Label |
create(short id,
int fontColor,
XYPair relLocation,
java.lang.String text,
byte fontType)
Factory method for creating a concrete instance initialized with the specified parameters |
byte |
getFontType()
Returns the font type |
java.lang.String |
getText()
Returns the text contained in the Label |
static XYPair |
getTextSize(byte fontType,
java.lang.String text)
Returns the text size in pixels (width and height) |
Methods inherited from class com.intel.ui.Widget |
---|
getColor, getId, getRelativeLocation, getSize |
Methods inherited from class java.lang.Object |
---|
equals, hashCode, toString |
Field Detail |
---|
FONT_TYPE_NEO_SANS_INTEL
public static final byte FONT_TYPE_NEO_SANS_INTEL
- Neo Sans Intel font.
- See Also:
- Constant Field Values
Method Detail |
---|
create
public static final Label create(short id, int fontColor, XYPair relLocation, java.lang.String text, byte fontType) throws UiException
- Factory method for creating a concrete instance initialized with the specified parameters
- Parameters:
id
- An ID representing thisWidget
for quick reference by the calling application. The ID does not have to be unique and is not used internally by the package.fontColor
- the color of the font in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).size
- The size of theWidget
relLocation
- The relative location from the parentWidget
text
- the text that will appear in theLabel
in ASCII encodingfontType
- The font type- Returns:
Label
instance- Throws:
UiIllegalParameterException
- in one of the following cases:- Location is negative
- Text is too long
- Location exceeds upper bound
Widget.MAX_WIDTH
and/orWidget.MAX_HEIGHT
- The font type is not FONT_TYPE_NEO_SANS_INTEL
- The text length is 0
UiException
getText
public java.lang.String getText()
- Returns the text contained in the
Label
- Returns:
- Returns the text contained in the
Label
getTextSize
public static XYPair getTextSize(byte fontType, java.lang.String text) throws UiException
- Returns the text size in pixels (width and height)
- Returns:
- Returns the text size in pixels
- Throws:
UiIllegalParameterException
- in one of the following cases:- The font type is not one of the FONT_TYPE_... definitions above.
- The text length is 0.
UiException
getFontType
public byte getFontType()
- Returns the font type
- Returns:
- Returns the font type