Package org.apache.poi.sl.draw
Class DrawTextParagraph
- java.lang.Object
-
- org.apache.poi.sl.draw.DrawTextParagraph
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.poi.sl.draw.Drawable
Drawable.DrawableHint
-
-
Field Summary
Fields Modifier and Type Field Description protected intautoNbrIdxprotected DrawTextFragmentbulletprotected booleanfirstParagraphstatic org.apache.poi.sl.draw.DrawTextParagraph.XlinkAttributeHYPERLINK_HREFKeys for passing hyperlinks to the graphics contextstatic org.apache.poi.sl.draw.DrawTextParagraph.XlinkAttributeHYPERLINK_LABELprotected java.util.List<DrawTextFragment>linesprotected TextParagraph<?,?,?>paragraphprotected java.lang.StringrawText-
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 DrawTextParagraph(TextParagraph<?,?,?> paragraph)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyTransform(java.awt.Graphics2D graphics)Apply 2-D transforms before drawing this shape.protected voidbreakText(java.awt.Graphics2D graphics)break text into lines, each representing a line of text that fits in the wrapping widthvoiddraw(java.awt.Graphics2D graphics)Draw this shape into the supplied canvasvoiddrawContent(java.awt.Graphics2D graphics)draw any content within this shape (image, text, etc.).protected java.util.List<org.apache.poi.sl.draw.DrawTextParagraph.AttributedStringData>getAttributedString(java.awt.Graphics2D graphics, java.lang.StringBuilder text)protected DrawTextFragmentgetBullet(java.awt.Graphics2D graphics, java.text.AttributedCharacterIterator firstLineAttr)floatgetFirstLineHeight()floatgetFirstLineLeading()floatgetLastLineHeight()protected java.lang.StringgetRenderableText(java.awt.Graphics2D graphics, TextRun tr)java.lang.StringgetRenderableText(TextRun tr)protected doublegetWrappingWidth(boolean firstLine, java.awt.Graphics2D graphics)Returns wrapping width to break lines in this paragraphdoublegetY()booleanisEmptyParagraph()protected booleanisFirstParagraph()protected booleanisHSLF()voidsetAutoNumberingIdx(int index)Sets the auto numbering index of the handled paragraphprotected voidsetFirstParagraph(boolean firstParagraph)voidsetPosition(double x, double y)
-
-
-
Field Detail
-
HYPERLINK_HREF
public static final org.apache.poi.sl.draw.DrawTextParagraph.XlinkAttribute HYPERLINK_HREF
Keys for passing hyperlinks to the graphics context
-
HYPERLINK_LABEL
public static final org.apache.poi.sl.draw.DrawTextParagraph.XlinkAttribute HYPERLINK_LABEL
-
paragraph
protected TextParagraph<?,?,?> paragraph
-
lines
protected java.util.List<DrawTextFragment> lines
-
rawText
protected java.lang.String rawText
-
bullet
protected DrawTextFragment bullet
-
autoNbrIdx
protected int autoNbrIdx
-
firstParagraph
protected boolean firstParagraph
-
-
Constructor Detail
-
DrawTextParagraph
public DrawTextParagraph(TextParagraph<?,?,?> paragraph)
-
-
Method Detail
-
setPosition
public void setPosition(double x, double y)
-
getY
public double getY()
-
setAutoNumberingIdx
public void setAutoNumberingIdx(int index)
Sets the auto numbering index of the handled paragraph- Parameters:
index- the auto numbering index
-
draw
public void draw(java.awt.Graphics2D graphics)
Description copied from interface:DrawableDraw this shape into the supplied canvas
-
getFirstLineLeading
public float getFirstLineLeading()
-
getFirstLineHeight
public float getFirstLineHeight()
-
getLastLineHeight
public float getLastLineHeight()
-
isEmptyParagraph
public boolean isEmptyParagraph()
-
applyTransform
public void applyTransform(java.awt.Graphics2D graphics)
Description copied from interface:DrawableApply 2-D transforms before drawing this shape. This includes rotation and flipping.- Specified by:
applyTransformin interfaceDrawable- Parameters:
graphics- the graphics whose transform matrix will be modified
-
drawContent
public void drawContent(java.awt.Graphics2D graphics)
Description copied from interface:Drawabledraw any content within this shape (image, text, etc.).- Specified by:
drawContentin interfaceDrawable- Parameters:
graphics- the graphics to draw into
-
breakText
protected void breakText(java.awt.Graphics2D graphics)
break text into lines, each representing a line of text that fits in the wrapping width- Parameters:
graphics- The drawing context for computing text-lengths.
-
getBullet
protected DrawTextFragment getBullet(java.awt.Graphics2D graphics, java.text.AttributedCharacterIterator firstLineAttr)
-
getRenderableText
protected java.lang.String getRenderableText(java.awt.Graphics2D graphics, TextRun tr)
-
getWrappingWidth
protected double getWrappingWidth(boolean firstLine, java.awt.Graphics2D graphics)Returns wrapping width to break lines in this paragraph- Parameters:
firstLine- whether the first line is breaking- Returns:
- wrapping width in points
-
getAttributedString
protected java.util.List<org.apache.poi.sl.draw.DrawTextParagraph.AttributedStringData> getAttributedString(java.awt.Graphics2D graphics, java.lang.StringBuilder text)
-
isHSLF
protected boolean isHSLF()
- Returns:
trueif the HSLF implementation is used
-
isFirstParagraph
protected boolean isFirstParagraph()
-
setFirstParagraph
protected void setFirstParagraph(boolean firstParagraph)
-
-