Package org.apache.batik.bridge
Interface TextPainter
-
- All Known Implementing Classes:
BasicTextPainter,ConcreteTextPainter,FlowExtTextPainter,FlowTextPainter,StrokingTextPainter
public interface TextPainterRenders the attributed character iterator of aTextNode.- Version:
- $Id: TextPainter.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.awt.geom.Rectangle2DgetBounds2D(TextNode node)Get a Rectangle2D in userspace coords which encloses the textnode glyphs rendered bounds (includes stroke etc).java.awt.geom.Rectangle2DgetGeometryBounds(TextNode node)Get a Rectangle2D in userspace coords which encloses the textnode glyphs just including the geometry info.java.awt.ShapegetHighlightShape(Mark beginMark, Mark endMark)Get a Shape in userspace coords which encloses the textnode glyphs bounded by two Marks.MarkgetMark(TextNode node, int index, boolean beforeGlyph)Returns a mark for the char at index in node's AttributedCharacterIterator.java.awt.ShapegetOutline(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.voidpaint(TextNode node, java.awt.Graphics2D g2d)Paints the specified attributed character iterator using the specified Graphics2D and context and font context.MarkselectAt(double x, double y, TextNode node)Initiates a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.MarkselectFirst(TextNode node)Selects the first glyph in the text node.MarkselectLast(TextNode node)Selects the last glyph in the text node.MarkselectTo(double x, double y, Mark beginMark)Continues a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
-
-
-
Method Detail
-
paint
void paint(TextNode node, java.awt.Graphics2D g2d)
Paints the specified attributed character iterator using the specified Graphics2D and context and font context.- Parameters:
node- the TextNode to paintg2d- the Graphics2D to use
-
selectAt
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.
-
selectTo
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.
-
getMark
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
-
getSelected
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.
-
getHighlightShape
java.awt.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.
-
getOutline
java.awt.Shape getOutline(TextNode node)
Get a Shape in userspace coords which defines the textnode glyph outlines.- Parameters:
node- the TextNode to measure
-
getBounds2D
java.awt.geom.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
-
getGeometryBounds
java.awt.geom.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
-
-