org.apache.batik.gvt
Interface TextPainter
public
interface
TextPainter
Renders the attributed character iterator of a TextNode.
Method Summary |
Rectangle2D | getBounds2D(TextNode node)
Get a Rectangle2D in userspace coords which encloses the textnode
glyphs rendered bounds (includes stroke etc). |
Rectangle2D | getGeometryBounds(TextNode node)
Get a Rectangle2D in userspace coords which encloses the textnode
glyphs just including the geometry info. |
Shape | getHighlightShape(Mark beginMark, Mark endMark)
Get a Shape in userspace coords which encloses the textnode
glyphs bounded by two Marks.
|
Mark | getMark(TextNode node, int index, boolean beforeGlyph)
Returns a mark for the char at index in node's
AttributedCharacterIterator. |
Shape | getOutline(TextNode node)
Get a Shape in userspace coords which defines the textnode
glyph outlines. |
int[] | getSelected(Mark start, Mark finish)
Get an array of index pairs corresponding to the indices within an
AttributedCharacterIterator regions bounded by two Marks.
|
void | paint(TextNode node, Graphics2D g2d)
Paints the specified attributed character iterator using the specified
Graphics2D and context and font context.
|
Mark | selectAt(double x, double y, TextNode node)
Initiates a text selection on a particular AttributedCharacterIterator,
using the text/font metrics employed by this TextPainter instance. |
Mark | selectFirst(TextNode node)
Selects the first glyph in the text node. |
Mark | selectLast(TextNode node)
Selects the last glyph in the text node. |
Mark | selectTo(double x, double y, Mark beginMark)
Continues a text selection on a particular AttributedCharacterIterator,
using the text/font metrics employed by this TextPainter instance. |
public Rectangle2D getBounds2D(
TextNode node)
Get a Rectangle2D in userspace coords which encloses the textnode
glyphs rendered bounds (includes stroke etc).
Parameters: node the TextNode to measure
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
public Shape getHighlightShape(
Mark beginMark,
Mark endMark)
Get a Shape in userspace coords which encloses the textnode
glyphs bounded by two Marks.
Note that the instances of Mark passed to this function
must come
from the same TextPainter that generated them via selectAt() and
selectTo(), since the TextPainter implementation may rely on hidden
implementation details of its own Mark implementation.
public
Mark getMark(
TextNode node, int index, boolean beforeGlyph)
Returns a mark for the char at index in node's
AttributedCharacterIterator. Leading edge indicates if the
mark should be considered immediately 'before' glyph or
after
Get a Shape in userspace coords which defines the textnode
glyph outlines.
Parameters: node the TextNode to measure
public int[] getSelected(
Mark start,
Mark finish)
Get an array of index pairs corresponding to the indices within an
AttributedCharacterIterator regions bounded by two Marks.
Note that the instances of Mark passed to this function must
come from the same TextPainter that generated them via selectAt()
and selectTo(), since the TextPainter implementation may rely on hidden
implementation details of its own Mark implementation.
public void paint(
TextNode node, Graphics2D g2d)
Paints the specified attributed character iterator using the specified
Graphics2D and context and font context.
Parameters: node the TextNode to paint g2d the Graphics2D to use
Initiates a text selection on a particular AttributedCharacterIterator,
using the text/font metrics employed by this TextPainter instance.
Selects the first glyph in the text node.
Selects the last glyph in the text node.
public
Mark selectTo(double x, double y,
Mark beginMark)
Continues a text selection on a particular AttributedCharacterIterator,
using the text/font metrics employed by this TextPainter instance.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.