|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.gvt.renderer.BasicTextPainter | +--org.apache.batik.gvt.renderer.StrokingTextPainter
More sophisticated implementation of TextPainter which renders the attributed character iterator of a TextNode. StrokingTextPainter includes support for stroke, fill, opacity, text-decoration, and other attributes.
TextPainter
,
GVTAttributedCharacterIterator
Inner Class Summary | |
class |
StrokingTextPainter.TextRun
Inner convenience class for associating a TextLayout for sub-spans, and the ACI which iterates over that subspan. |
Inner classes inherited from class org.apache.batik.gvt.renderer.BasicTextPainter |
BasicTextPainter.BasicMark |
Field Summary | |
static java.text.AttributedCharacterIterator.Attribute |
ANCHOR_TYPE
|
static java.text.AttributedCharacterIterator.Attribute |
BIDI_LEVEL
|
static java.text.AttributedCharacterIterator.Attribute |
GVT_FONT
|
static java.text.AttributedCharacterIterator.Attribute |
GVT_FONT_FAMILIES
|
protected static TextPainter |
singleton
A unique instance of this class. |
static java.text.AttributedCharacterIterator.Attribute |
TEXT_COMPOUND_DELIMITER
|
static java.text.AttributedCharacterIterator.Attribute |
TEXTPATH
|
static java.text.AttributedCharacterIterator.Attribute |
XPOS
|
static java.text.AttributedCharacterIterator.Attribute |
YPOS
|
Fields inherited from class org.apache.batik.gvt.renderer.BasicTextPainter |
fontRenderContext |
Constructor Summary | |
StrokingTextPainter()
|
Method Summary | |
protected java.awt.geom.Rectangle2D |
getBounds(TextNode node,
boolean includeDecoration,
boolean includeStrokeWidth)
Get a Rectangle2D in userspace coords which encloses the textnode glyphs composed from an AttributedCharacterIterator. |
java.awt.Shape |
getHighlightShape(Mark beginMark,
Mark endMark)
Return a Shape, in the coordinate system of the text layout, which encloses the text selection delineated by two Mark instances. |
static TextPainter |
getInstance()
Returns a unique instance of this class. |
Mark |
getMark(TextNode node,
int index,
boolean leadingEdge)
Returns a mark for the char at index in node's AttributedCharacterIterator. |
protected java.awt.Shape |
getOutline(TextNode node,
boolean includeDecoration)
Get a Shape in userspace coords which defines the textnode glyph outlines. |
int[] |
getSelected(Mark startMark,
Mark finishMark)
Returns an array of ints representing begin/end index pairs into an AttributedCharacterIterator which represents the text selection delineated by two Mark instances. |
protected java.awt.Shape |
getStrokeOutline(TextNode node,
boolean includeDecoration)
Get a Shape in userspace coords which defines the stroked textnode glyph outlines. |
java.util.List |
getTextRuns(TextNode node,
java.text.AttributedCharacterIterator aci)
|
protected Mark |
hitTest(double x,
double y,
TextNode node)
Returns the mark for the specified parameters. |
void |
paint(TextNode node,
java.awt.Graphics2D g2d)
Paints the specified text node using the specified Graphics2D. |
Mark |
selectFirst(TextNode node)
Selects the first glyph in the text node. |
Mark |
selectLast(TextNode node)
Selects the last glyph in the text node. |
Methods inherited from class org.apache.batik.gvt.renderer.BasicTextPainter |
getBounds, getDecoratedBounds, getDecoratedShape, getPaintedBounds, getShape, getTextLayoutFactory, selectAt, selectTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.text.AttributedCharacterIterator.Attribute TEXT_COMPOUND_DELIMITER
public static final java.text.AttributedCharacterIterator.Attribute GVT_FONT
public static final java.text.AttributedCharacterIterator.Attribute GVT_FONT_FAMILIES
public static final java.text.AttributedCharacterIterator.Attribute BIDI_LEVEL
public static final java.text.AttributedCharacterIterator.Attribute XPOS
public static final java.text.AttributedCharacterIterator.Attribute YPOS
public static final java.text.AttributedCharacterIterator.Attribute TEXTPATH
public static final java.text.AttributedCharacterIterator.Attribute ANCHOR_TYPE
protected static TextPainter singleton
Constructor Detail |
public StrokingTextPainter()
Method Detail |
public static TextPainter getInstance()
public void paint(TextNode node, java.awt.Graphics2D g2d)
node
- the text node to paintg2d
- the Graphics2D to usepublic java.util.List getTextRuns(TextNode node, java.text.AttributedCharacterIterator aci)
protected java.awt.geom.Rectangle2D getBounds(TextNode node, boolean includeDecoration, boolean includeStrokeWidth)
getBounds
in class BasicTextPainter
org.apache.batik.gvt.renderer.BasicTextPainter
node
- the TextNode to measureincludeDecoration
- whether to include text decoration in bounds
computation.includeStrokeWidth
- whether to include the effect of stroke width
in bounds computation.protected java.awt.Shape getOutline(TextNode node, boolean includeDecoration)
getOutline
in class BasicTextPainter
node
- the TextNode to measureincludeDecoration
- whether to include text decoration
outlines.protected java.awt.Shape getStrokeOutline(TextNode node, boolean includeDecoration)
getStrokeOutline
in class BasicTextPainter
node
- the TextNode to measureincludeDecoration
- whether to include text decoration
outlines.public Mark getMark(TextNode node, int index, boolean leadingEdge)
TextPainter
protected Mark hitTest(double x, double y, TextNode node)
BasicTextPainter
hitTest
in class BasicTextPainter
public Mark selectFirst(TextNode node)
public Mark selectLast(TextNode node)
public int[] getSelected(Mark startMark, Mark finishMark)
public java.awt.Shape getHighlightShape(Mark beginMark, Mark endMark)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |