|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Class that performs layout of attributed text strings into glyph sets paintable by TextPainter instances. Similar to java.awt.font.TextLayout in function and purpose. Note that while this utility interface is provided for the convenience of TextPainter implementations, conforming TextPainters are not required to use this class.
TextLayout
,
TextPainter
Field Summary | |
static int |
DECORATION_ALL
|
static int |
DECORATION_OVERLINE
|
static int |
DECORATION_STRIKETHROUGH
|
static int |
DECORATION_UNDERLINE
|
Method Summary | |
void |
draw(java.awt.Graphics2D g2d)
Paints the specified text layout using the specified Graphics2D and rendering context. |
java.awt.geom.Point2D |
getAdvance2D()
Returns the current text position at the completion of glyph layout. |
java.awt.geom.Rectangle2D |
getBounds2D()
Returns the rectangular bounds of the completed glyph layout. |
int |
getCharacterCount(int startGlyphIndex,
int endGlyphIndex)
Returns the number of chars represented by the glyphs within the specified range. |
java.awt.Shape |
getDecorationOutline(int decorationType)
Returns the outline of the specified decorations on the glyphs, transformed by an AffineTransform. |
java.awt.geom.Rectangle2D |
getGeometricBounds()
Returns the bounds of the geometry (this is always the bounds of the outline). |
int |
getGlyphCount()
Returns the number of glyphs in this layout. |
int |
getGlyphIndex(int charIndex)
Returns the glyph index of the glyph that has the specified char index. |
GVTGlyphMetrics |
getGlyphMetrics(int glyphIndex)
Returns the Metrics for a particular glyph. |
java.awt.Shape |
getHighlightShape(int beginCharIndex,
int endCharIndex)
Returns a Shape which encloses the currently selected glyphs as specified by glyph indices begin/tt> and end. |
java.awt.geom.Point2D |
getOffset()
Returns the current text position at the completion beginning of glyph layout, before the application of explicit glyph positioning attributes. |
java.awt.Shape |
getOutline()
Returns the outline of the completed glyph layout, transformed by an AffineTransform. |
java.awt.geom.Point2D |
getTextPathAdvance()
|
TextHit |
hitTestChar(float x,
float y)
Perform hit testing for coordinate at x, y. |
boolean |
isLeftToRight()
Returns true if the text direction in this layout is from left to right. |
boolean |
isOnATextPath()
Returns true if this layout in on a text path. |
boolean |
isVertical()
Returns true if the advance direction of this text is vertical. |
void |
setOffset(java.awt.geom.Point2D offset)
Sets the text position used for the implicit origin of glyph layout. |
void |
setScale(float xScale,
float yScale,
boolean adjSpacing)
Sets the scaling factor to use for string. |
Field Detail |
public static final int DECORATION_UNDERLINE
public static final int DECORATION_STRIKETHROUGH
public static final int DECORATION_OVERLINE
public static final int DECORATION_ALL
Method Detail |
public void draw(java.awt.Graphics2D g2d)
g2d
- the Graphics2D to usepublic java.awt.Shape getDecorationOutline(int decorationType)
decorationType
- an integer indicating the type(s) of decorations
included in this shape. May be the result of "OR-ing" several
values together:
e.g. DECORATION_UNDERLINE | DECORATION_STRIKETHROUGHpublic java.awt.geom.Rectangle2D getBounds2D()
public java.awt.geom.Rectangle2D getGeometricBounds()
public java.awt.Shape getOutline()
public java.awt.geom.Point2D getAdvance2D()
public GVTGlyphMetrics getGlyphMetrics(int glyphIndex)
public java.awt.geom.Point2D getTextPathAdvance()
public java.awt.geom.Point2D getOffset()
public void setScale(float xScale, float yScale, boolean adjSpacing)
xScale
- Scale factor to apply in X direction.yScale
- Scale factor to apply in Y direction.adjSpacing
- True if only spaces should be adjusted.public void setOffset(java.awt.geom.Point2D offset)
public java.awt.Shape getHighlightShape(int beginCharIndex, int endCharIndex)
begin
- the index of the first glyph in the contiguous selection.end
- the index of the last glyph in the contiguous selection.public TextHit hitTestChar(float x, float y)
x
- the x coordinate of the point to be tested.y
- the y coordinate of the point to be tested.public boolean isVertical()
public boolean isOnATextPath()
public int getGlyphCount()
public int getCharacterCount(int startGlyphIndex, int endGlyphIndex)
startGlyphIndex
- The index of the first glyph in the range.endGlyphIndex
- The index of the last glyph in the range.public int getGlyphIndex(int charIndex)
charIndex
- The original index of the character in the text node's
text string.public boolean isLeftToRight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |