FileDocCategorySizeDatePackage
TextRunSegment.javaAPI DocAndroid 1.5 API5333Wed May 06 22:41:54 BST 2009org.apache.harmony.awt.gl.font

TextRunSegment

public abstract class TextRunSegment extends Object implements Cloneable
Abstract class which represents the segment of the text with constant attributes running in one direction (i.e. constant level).

Fields Summary
float
x
float
y
BasicMetrics
metrics
TextDecorator.Decoration
decoration
Rectangle2D
logicalBounds
Rectangle2D
visualBounds
Constructors Summary
Methods Summary
abstract booleancharHasZeroAdvance(int index)
Checks if the character doesn't contribute to the text advance

param
index - character index
return
true if the character has zero advance

public abstract java.lang.Objectclone()

abstract floatdoJustification(TextRunBreaker.JustificationInfo[] jInfos)
Performs justification of the segment. Updates positions of individual characters.

param
jInfos - justification information, gathered by the previous passes
return
amount of growth or shrink of the segment

abstract voiddraw(java.awt.Graphics2D g2d, float xOffset, float yOffset)
Renders this text run segment

param
g2d - graphics to render to
param
xOffset - X offset from the graphics origin to the origin of the text layout
param
yOffset - Y offset from the graphics origin to the origin of the text layout

abstract floatgetAdvance()
Calculates advance of the segment

return
advance

abstract floatgetAdvanceDelta(int start, int end)
Calculates advance delta between two characters

param
start - 1st position
param
end - 2nd position
return
advance increment between specified positions

abstract floatgetCharAdvance(int index)
Returns the advance of the individual character

param
index - character index
return
character advance

abstract intgetCharIndexFromAdvance(float advance, int start)
Calculates index of the character which advance is equal to the given. If the given advance is greater then the segment advance it returns the position after the last character.

param
advance - given advance
param
start - character, from which to start measuring advance
return
character index

abstract floatgetCharPosition(int index)
Calculates position of the character on the screen

param
index - character index
return
X coordinate of the character position

abstract java.awt.ShapegetCharsBlackBoxBounds(int start, int limit)
Creates black box bounds shape for the specified range

param
start - range sart
param
limit - range end
return
black box bounds shape

abstract intgetEnd()
Returns end index of the segment

return
end index

abstract intgetLength()
Returns the number of characters in the segment

return
number of characters

abstract java.awt.geom.Rectangle2DgetLogicalBounds()
Returns logical bounds of this segment

return
logical bounds

abstract java.awt.ShapegetOutline()
Returns the outline shape

return
outline

abstract intgetStart()
Returns start index of the segment

return
start index

abstract java.awt.geom.Rectangle2DgetVisualBounds()
Returns visual bounds of this segment

return
visual bounds

abstract java.awt.font.TextHitInfohitTest(float x, float y)
Creates text hit info from the hit position

param
x - X coordinate relative to the origin of the layout
param
y - Y coordinate relative to the origin of the layout
return
hit info

abstract voidupdateJustificationInfo(TextRunBreaker.JustificationInfo jInfo)
Collects justification information into JustificationInfo object

param
jInfo - JustificationInfo object