org.apache.batik.gvt.renderer

Class BasicTextPainter

public abstract class BasicTextPainter extends Object implements TextPainter

Basic implementation of TextPainter which renders the attributed character iterator of a TextNode. Suitable for use with "standard" java.awt.font.TextAttributes only.

See Also: java.awt.font.TextAttribute

Nested Class Summary
protected static classBasicTextPainter.BasicMark
This TextPainter's implementation of the Mark interface.
Field Summary
protected FontRenderContextaaOffFontRenderContext
protected FontRenderContextfontRenderContext
The font render context to use.
Method Summary
Rectangle2DgetGeometryBounds(TextNode node)
Get a Rectangle2D in userspace coords which encloses the textnode glyphs just including the geometry info.
protected TextLayoutFactorygetTextLayoutFactory()
protected abstract MarkhitTest(double x, double y, TextNode node)
Returns the mark for the specified parameters.
MarkselectAt(double x, double y, TextNode node)
Given an X, y coordinate, AttributedCharacterIterator, return a Mark which encapsulates a "selection start" action.
MarkselectTo(double x, double y, Mark beginMark)
Given an X, y coordinate, starting Mark, AttributedCharacterIterator, return a Mark which encapsulates a "selection continued" action.

Field Detail

aaOffFontRenderContext

protected FontRenderContext aaOffFontRenderContext

fontRenderContext

protected FontRenderContext fontRenderContext
The font render context to use.

Method Detail

getGeometryBounds

public Rectangle2D getGeometryBounds(TextNode node)
Get a Rectangle2D in userspace coords which encloses the textnode glyphs just including the geometry info.

Parameters: node the TextNode to measure

getTextLayoutFactory

protected TextLayoutFactory getTextLayoutFactory()

hitTest

protected abstract Mark hitTest(double x, double y, TextNode node)
Returns the mark for the specified parameters.

selectAt

public Mark selectAt(double x, double y, TextNode node)
Given an X, y coordinate, AttributedCharacterIterator, return a Mark which encapsulates a "selection start" action. The standard order of method calls for selection is: selectAt(); [selectTo(),...], selectTo(); getSelection().

selectTo

public Mark selectTo(double x, double y, Mark beginMark)
Given an X, y coordinate, starting Mark, AttributedCharacterIterator, return a Mark which encapsulates a "selection continued" action. The standard order of method calls for selection is: selectAt(); [selectTo(),...], selectTo(); getSelection().
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.