Package org.apache.poi.sl.draw
Class DrawTextFragment
- java.lang.Object
-
- org.apache.poi.sl.draw.DrawTextFragment
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.poi.sl.draw.Drawable
Drawable.DrawableHint
-
-
Field Summary
-
Fields inherited from interface org.apache.poi.sl.draw.Drawable
BUFFERED_IMAGE, CACHE_IMAGE_SOURCE, 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 Summary
Constructors Constructor Description DrawTextFragment(TextLayout layout, AttributedString str)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyTransform(Graphics2D graphics)
Apply 2-D transforms before drawing this shape.void
draw(Graphics2D graphics)
Draw this shape into the supplied canvasvoid
drawContent(Graphics2D graphics)
draw any content within this shape (image, text, etc.).AttributedString
getAttributedString()
float
getHeight()
TextLayout
getLayout()
float
getLeading()
String
getString()
float
getWidth()
void
setPosition(double x, double y)
String
toString()
-
-
-
Constructor Detail
-
DrawTextFragment
public DrawTextFragment(TextLayout layout, AttributedString str)
-
-
Method Detail
-
setPosition
public void setPosition(double x, double y)
-
draw
public void draw(Graphics2D graphics)
Description copied from interface:Drawable
Draw this shape into the supplied canvas
-
applyTransform
public void applyTransform(Graphics2D graphics)
Description copied from interface:Drawable
Apply 2-D transforms before drawing this shape. This includes rotation and flipping.- Specified by:
applyTransform
in interfaceDrawable
- Parameters:
graphics
- the graphics whose transform matrix will be modified
-
drawContent
public void drawContent(Graphics2D graphics)
Description copied from interface:Drawable
draw any content within this shape (image, text, etc.).- Specified by:
drawContent
in interfaceDrawable
- Parameters:
graphics
- the graphics to draw into
-
getLayout
public TextLayout getLayout()
-
getAttributedString
public AttributedString getAttributedString()
-
getHeight
public float getHeight()
- Returns:
- full height of this text run which is sum of ascent, descent and leading
-
getLeading
public float getLeading()
- Returns:
- the leading height before/after a text line
-
getWidth
public float getWidth()
- Returns:
- width if this text run
-
getString
public String getString()
- Returns:
- the string to be painted
-
-