public class DrawTextShape extends DrawSimpleShape
Drawable.DrawableHint
BUFFERED_IMAGE, CURRENT_SLIDE, DEFAULT_CHARSET, DRAW_FACTORY, EMF_FORCE_HEADER_BOUNDS, FONT_FALLBACK, FONT_HANDLER, FONT_MAP, GRADIENT_SHAPE, GRESTORE, GROUP_TRANSFORM, GSAVE, IMAGE_RENDERER, PRESET_GEOMETRY_CACHE, TEXT_AS_CHARACTERS, TEXT_AS_SHAPES, TEXT_RENDERING_MODE
Constructor and Description |
---|
DrawTextShape(TextShape<?,?> shape) |
Modifier and Type | Method and Description |
---|---|
void |
drawContent(java.awt.Graphics2D graphics)
draw any content within this shape (image, text, etc.).
(在此形状内绘制任何内容(图像、文本等)。)
|
double |
drawParagraphs(java.awt.Graphics2D graphics, double x, double y)
paint the paragraphs starting from top left (x,y)
(从左上角开始绘制段落 (x,y))
|
protected TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> |
getShape() |
double |
getTextHeight()
Compute the cumulative height occupied by the text
(计算文本占用的累积高度)
|
double |
getTextHeight(java.awt.Graphics2D oldGraphics)
Compute the cumulative height occupied by the text
(计算文本占用的累积高度)
|
computeOutlines, draw, drawDecoration, drawShadow, getFillPaint, getHeadDecoration, getLinePaint, getStroke, getTailDecoration
applyTransform, getAnchor, getAnchor, getStroke
public DrawTextShape(TextShape<?,?> shape)
public void drawContent(java.awt.Graphics2D graphics)
Drawable
drawContent
in interface
Drawable
(接口Drawable中的drawContent)
drawContent
in class
DrawShape
graphics
- the graphics to draw into
(graphics - 要绘制的图形)
public double drawParagraphs(java.awt.Graphics2D graphics, double x, double y)
public double getTextHeight()
public double getTextHeight(java.awt.Graphics2D oldGraphics)
oldGraphics
- the graphics context, which properties are to be copied, may be null
(oldGraphics - 要复制哪些属性的图形上下文可能为空)
protected TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> getShape()
getShape
in class
DrawSimpleShape
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.