|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.util.text.TextTable
public final class TextTable
TextTable is used to generate test definitions for a specific (fixed) point size of a font. Each instance caches a table of GlyphIndex objects with predefined advances allowing the objects for each character used to be shared amongst the TextSpan objects that are used to display text.
Constructor Summary | |
---|---|
TextTable(DefineFont2 font,
int fontSize)
Creates a TextTable for the specified font size. |
Method Summary | |
---|---|
Bounds |
boundsForText(String text)
Create a bound box that encloses the line of text when rendered using the specified font and size. |
List<GlyphIndex> |
charactersForText(String text)
Create a list of characters that can be added to a text span. |
TextSpan |
defineSpan(String text,
Color color,
int xCoord,
int yCoord)
Create a span of text that can be added to a static text field. |
DefineText2 |
defineText(int uid,
String text,
Color color)
Create a definition for a static text field that displays a single line of text in the specified font. |
DefineText2 |
defineTextBlock(int uid,
List<String> lines,
Color color,
int lineSpacing)
Create a definition for a static text field that displays a block of text in the specified font. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextTable(DefineFont2 font, int fontSize)
font
- the font definition.fontSize
- the size of the font in twips.Method Detail |
---|
public Bounds boundsForText(String text)
text
- the string to be displayed.
public List<GlyphIndex> charactersForText(String text)
text
- the string to be displayed.
public TextSpan defineSpan(String text, Color color, int xCoord, int yCoord)
text
- the string to be displayed.color
- the colour used to display the text.xCoord
- the x-coordinate for the origin of the text span.yCoord
- the y-coordinate for the origin of the text span.
public DefineText2 defineText(int uid, String text, Color color)
uid
- the unique identifier that will be used to reference the text
field in a flash file.text
- the string to be displayed.color
- the colour used to display the text.
public DefineText2 defineTextBlock(int uid, List<String> lines, Color color, int lineSpacing)
uid
- the unique identifier that will be used to reference the text
field in a flash file.lines
- the list of strings to be displayed.color
- the colour used to display the text.lineSpacing
- the spearation between successive lines of text.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |