APIdia Launch Partner
Top Description Fields Constructors Methods
sun.font

public final Class TextLabelFactory

extends Object
Class Inheritance
Imports
java.awt.Font, java.awt.font.FontRenderContext, java.text.Bidi

A factory for text labels. Basically this just holds onto the stuff that doesn't change-- the render context, context, and bidi info for the context-- and gets called for each subrange you want to create.
See Also
Font, FontRenderContext, java.awt.font.GlyphVector, ExtendedTextSourceLabel, Bidi, java.awt.font.TextLayout

Field Summary

Modifier and TypeField and Description
private final Bidi
private final int
private final FontRenderContext
private Bidi
private int
private int
private final char[]

Constructor Summary

AccessConstructor and Description
public
TextLabelFactory(FontRenderContext
the FontRenderContext to use for the arrays to be produced.
frc
,
char[]
the text of the paragraph.
text
,
Bidi
the bidi information for the paragraph text, or null if the entire text is left-to-right text.
bidi
,
int flags)

Initialize a factory to produce glyph arrays.

Method Summary

Modifier and TypeMethod and Description
public ExtendedTextSourceLabel
createTextLabel(Font
the font to use to generate glyphs and character positions.
font
,
CoreMetrics lm, Decoration decorator, int
the start of the subrange for which to create the glyph array
start
,
int
the limit of the subrange for which to create glyph array Start and limit must be within the bounds of the current line. If no line context has been set, the entire text is used as the current line. The text between start and limit will be treated as though it all has the same bidi level (and thus the same directionality) as the character at start. Clients should ensure that all text between start and limit has the same bidi level for the current line.
limit
)

Create a glyph array for the text between start and limit.

public FontRenderContext
public Bidi
public void
setLineContext(int
the index within the text of the start of the line.
lineStart
,
int
the index within the text of the limit of the line.
lineLimit
)

Set a line context for the factory.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bidiback to summary
private final Bidi bidi
flagsback to summary
private final int flags
frcback to summary
private final FontRenderContext frc
lineBidiback to summary
private Bidi lineBidi
lineLimitback to summary
private int lineLimit
lineStartback to summary
private int lineStart
textback to summary
private final char[] text

Constructor Detail

TextLabelFactoryback to summary
public TextLabelFactory(FontRenderContext frc, char[] text, Bidi bidi, int flags)

Initialize a factory to produce glyph arrays.

Parameters
frc:FontRenderContext

the FontRenderContext to use for the arrays to be produced.

text:char[]

the text of the paragraph.

bidi:Bidi

the bidi information for the paragraph text, or null if the entire text is left-to-right text.

Method Detail

createTextLabelback to summary
public ExtendedTextSourceLabel createTextLabel(Font font, CoreMetrics lm, Decoration decorator, int start, int limit)

Create a glyph array for the text between start and limit.

Parameters
font:Font

the font to use to generate glyphs and character positions.

start:int

the start of the subrange for which to create the glyph array

limit:int

the limit of the subrange for which to create glyph array Start and limit must be within the bounds of the current line. If no line context has been set, the entire text is used as the current line. The text between start and limit will be treated as though it all has the same bidi level (and thus the same directionality) as the character at start. Clients should ensure that all text between start and limit has the same bidi level for the current line.

getFontRenderContextback to summary
public FontRenderContext getFontRenderContext()
getLineBidiback to summary
public Bidi getLineBidi()
setLineContextback to summary
public void setLineContext(int lineStart, int lineLimit)

Set a line context for the factory. Shaping only occurs on this line. Characters are ordered as they would appear on this line.

Parameters
lineStart:int

the index within the text of the start of the line.

lineLimit:int

the index within the text of the limit of the line.