|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.gvt.text.GlyphLayout
Implementation of TextSpanLayout which uses java.awt.font.GlyphVector.
org.apache.batik.gvt.TextSpanLayout.
Inner Class Summary | |
protected class |
GlyphLayout.ReorderedCharacterIterator
|
Fields inherited from interface org.apache.batik.gvt.text.TextSpanLayout |
DECORATION_ALL, DECORATION_OVERLINE, DECORATION_STRIKETHROUGH, DECORATION_UNDERLINE |
Constructor Summary | |
GlyphLayout(java.text.AttributedCharacterIterator aci,
java.awt.geom.Point2D offset,
java.awt.font.FontRenderContext frc)
Creates the specified text layout using the specified AttributedCharacterIterator and rendering context. |
Method Summary | |
protected void |
adjustTextSpacing()
|
protected void |
applySpacingParams(java.lang.Float length,
java.lang.Integer lengthAdjust,
java.lang.Float kern,
java.lang.Float letterSpacing,
java.lang.Float wordSpacing)
|
protected java.awt.geom.AffineTransform |
computeStretchTransform(java.lang.Float length)
|
protected void |
doExplicitGlyphLayout(boolean applyOffset)
|
protected void |
doPathLayout()
|
protected java.awt.geom.Point2D |
doSpacing(java.lang.Float kern,
java.lang.Float letterSpacing,
java.lang.Float wordSpacing)
|
void |
draw(java.awt.Graphics2D g2d,
GraphicsNodeRenderContext context)
Paints the specified text layout using the specified Graphics2D and rendering context. |
float |
getAdvance()
Returns the dimension of the completed glyph layout in the primary text advance direction (e.g. |
java.awt.geom.Point2D |
getAdvance2D()
Returns the current text position at the completion of glyph layout. |
java.awt.geom.Rectangle2D |
getBounds()
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.geom.Rectangle2D |
getDecoratedBounds()
Returns the rectangular bounds of the completed glyph layout, inclusive of "decoration" (underline, overline, etc.) |
java.awt.Shape |
getDecorationOutline(int decorationType)
Returns the outline of the specified decorations on the glyphs, |
protected GVTFont |
getFont(java.text.AttributedCharacterIterator aci)
|
int |
getGlyphCount()
Returns the number of glyphs in this layout. |
java.awt.Shape |
getLogicalHighlightShape(int begin,
int end)
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 beginning of glyph layout, before the application of explicit glyph positioning attributes. |
java.awt.Shape |
getOutline()
Returns the outline of the completed glyph layout. |
protected java.awt.Shape |
getOverlineShape()
Returns a shape describing the overline decoration for a given ACI. |
protected java.awt.Shape |
getStrikethroughShape()
Returns a shape describing the strikethrough line for a given ACI. |
protected java.awt.Shape |
getUnderlineShape()
Returns a shape describing the strikethrough line for a given ACI. |
TextHit |
hitTestChar(float x,
float y)
Perform hit testing for coordinate at x, y. |
protected boolean |
isLatinChar(char c)
|
boolean |
isVertical()
Returns true if the advance direction of this text is vertical. |
protected void |
rescaleSpacing(float xscale,
float yscale)
|
void |
setOffset(java.awt.geom.Point2D offset)
Sets the text position used for the implicit origin of glyph layout. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GlyphLayout(java.text.AttributedCharacterIterator aci, java.awt.geom.Point2D offset, java.awt.font.FontRenderContext frc)
aci
- the AttributedCharacterIterator whose text is to
be laid outfrc
- the FontRenderContext to use for generating glyphs.Method Detail |
public void draw(java.awt.Graphics2D g2d, GraphicsNodeRenderContext context)
draw
in interface TextSpanLayout
g2d
- the Graphics2D to usecontext
- The current render contextpublic java.awt.Shape getOutline()
getOutline
in interface TextSpanLayout
public java.awt.geom.Point2D getOffset()
getOffset
in interface TextSpanLayout
public void setOffset(java.awt.geom.Point2D offset)
setOffset
in interface TextSpanLayout
public java.awt.Shape getDecorationOutline(int decorationType)
getDecorationOutline
in interface TextSpanLayout
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 getBounds()
getBounds
in interface TextSpanLayout
public java.awt.geom.Rectangle2D getDecoratedBounds()
getDecoratedBounds
in interface TextSpanLayout
public float getAdvance()
getAdvance
in interface TextSpanLayout
public java.awt.geom.Point2D getAdvance2D()
getAdvance2D
in interface TextSpanLayout
public java.awt.Shape getLogicalHighlightShape(int begin, int end)
getLogicalHighlightShape
in interface TextSpanLayout
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)
hitTestChar
in interface TextSpanLayout
x
- the x coordinate of the point to be tested.y
- the y coordinate of the point to be tested.public boolean isVertical()
isVertical
in interface TextSpanLayout
public int getGlyphCount()
getGlyphCount
in interface TextSpanLayout
public int getCharacterCount(int startGlyphIndex, int endGlyphIndex)
getCharacterCount
in interface TextSpanLayout
startGlyphIndex
- The index of the first glyph in the range.endGlyphIndex
- The index of the last glyph in the range.protected java.awt.Shape getOverlineShape()
protected java.awt.Shape getUnderlineShape()
protected java.awt.Shape getStrikethroughShape()
protected GVTFont getFont(java.text.AttributedCharacterIterator aci)
protected void doPathLayout()
protected void adjustTextSpacing()
protected java.awt.geom.AffineTransform computeStretchTransform(java.lang.Float length)
protected void applySpacingParams(java.lang.Float length, java.lang.Integer lengthAdjust, java.lang.Float kern, java.lang.Float letterSpacing, java.lang.Float wordSpacing)
protected java.awt.geom.Point2D doSpacing(java.lang.Float kern, java.lang.Float letterSpacing, java.lang.Float wordSpacing)
protected void rescaleSpacing(float xscale, float yscale)
protected boolean isLatinChar(char c)
protected void doExplicitGlyphLayout(boolean applyOffset)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |