com.intel.ui
Class Label
- java.lang.Object
-
- com.intel.ui.Widget
-
- com.intel.ui.Label
-
public abstract class Label extends Widget
This abstract class represents a leafWidget
of a transparent box with text.
-
-
Field Summary
Fields Modifier and Type Field and Description static byte
FONT_TYPE_NEO_SANS_INTEL
Neo Sans Intel font.
-
Method Summary
Methods Modifier and Type Method and Description 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 parametersbyte
getFontType()
Returns the font typejava.lang.String
getText()
Returns the text contained in theLabel
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
-
-
-
-
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).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 theLabel
- 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
-
-