|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.hslf.usermodel.HSLFTextRun
public final class HSLFTextRun
Represents a run of text, all with the same style
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TextRun |
---|
TextRun.FieldType, TextRun.TextCap |
Field Summary | |
---|---|
protected POILogger |
logger
|
Constructor Summary | |
---|---|
HSLFTextRun(HSLFTextParagraph parentParagraph)
Create a new wrapper around a rich text string |
Method Summary | |
---|---|
HSLFHyperlink |
createHyperlink()
Creates a new hyperlink and assigns it to this text run. |
TextPropCollection |
getCharacterStyle()
|
TextRun.FieldType |
getFieldType()
Experimental method to determine the field type, e.g. |
protected boolean |
getFlag(int index)
|
PaintStyle.SolidPaint |
getFontColor()
Returns the font color. |
java.lang.String |
getFontFamily()
Get the font family - convenience method for TextRun.getFontInfo(FontGroup) |
java.lang.String |
getFontFamily(FontGroup fontGroup)
Get the font family - convenience method for TextRun.getFontInfo(FontGroup) |
int |
getFontIndex()
Gets the font index |
HSLFFontInfo |
getFontInfo(FontGroup fontGroup)
Get the font info for the given font group |
java.lang.Double |
getFontSize()
Returns the font size which is either set directly on this text run or given from the slide layout |
HSLFHyperlink |
getHyperlink()
Return the associated hyperlink |
int |
getLength()
Get the length of the text |
byte |
getPitchAndFamily()
|
java.lang.String |
getRawText()
Fetch the text, in raw storage form |
int |
getSuperscript()
Gets the subscript/superscript option |
TextRun.TextCap |
getTextCap()
|
HSLFTextParagraph |
getTextParagraph()
|
boolean |
isBold()
|
boolean |
isEmbossed()
Is this text embossed? |
boolean |
isItalic()
|
boolean |
isShadowed()
Does the text have a shadow? |
boolean |
isStrikethrough()
|
boolean |
isSubscript()
|
boolean |
isSuperscript()
|
boolean |
isUnderlined()
|
void |
setBold(boolean bold)
Sets the bold state |
void |
setCharacterStyle(TextPropCollection characterStyle)
|
void |
setCharTextPropVal(java.lang.String propName,
java.lang.Integer val)
Sets the value of the given Paragraph TextProp, add if required |
void |
setEmbossed(boolean flag)
Is this text embossed? |
protected void |
setFlag(int index,
boolean value)
|
void |
setFontColor(java.awt.Color color)
Sets the (solid) font color - convenience function |
void |
setFontColor(int bgr)
Sets color of the text, as a int bgr. |
void |
setFontColor(PaintStyle color)
Sets the font color |
void |
setFontFamily(java.lang.String typeface)
Specifies the typeface, or name of the font that is to be used for this text run - convenience method for calling TextRun.setFontInfo(FontInfo, FontGroup) with just a font name |
void |
setFontFamily(java.lang.String typeface,
FontGroup fontGroup)
Specifies the typeface, or name of the font that is to be used for this text run - convenience method for calling TextRun.setFontInfo(FontInfo, FontGroup) with just a font name |
void |
setFontIndex(int idx)
Sets the font index |
void |
setFontInfo(FontInfo fontInfo,
FontGroup fontGroup)
Specifies the font to be used for this text run. |
void |
setFontSize(java.lang.Double fontSize)
Sets the font size directly on this text run, if null is given, the font size defaults to the values given from the slide layout |
protected void |
setHyperlink(HSLFHyperlink link)
Sets the hyperlink - used when parsing the document |
void |
setItalic(boolean italic)
Sets the italic state |
void |
setShadowed(boolean flag)
Does the text have a shadow? |
void |
setStrikethrough(boolean flag)
Sets the strikethrough state |
void |
setSuperscript(int val)
Sets the subscript/superscript option |
void |
setText(java.lang.String text)
Change the text |
void |
setUnderlined(boolean underlined)
Sets the underlined state |
void |
updateSheet()
Supply the SlideShow we belong to |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected POILogger logger
Constructor Detail |
---|
public HSLFTextRun(HSLFTextParagraph parentParagraph)
parentParagraph
- the parent paragraphMethod Detail |
---|
public TextPropCollection getCharacterStyle()
public void setCharacterStyle(TextPropCollection characterStyle)
public void updateSheet()
public int getLength()
public java.lang.String getRawText()
getRawText
in interface TextRun
public void setText(java.lang.String text)
setText
in interface TextRun
protected boolean getFlag(int index)
public void setCharTextPropVal(java.lang.String propName, java.lang.Integer val)
propName
- The name of the Paragraph TextPropval
- The value to set for the TextProppublic boolean isBold()
isBold
in interface TextRun
public void setBold(boolean bold)
TextRun
setBold
in interface TextRun
bold
- set to true for bold text, false for normal weightpublic boolean isItalic()
isItalic
in interface TextRun
public void setItalic(boolean italic)
TextRun
setItalic
in interface TextRun
italic
- set to true for italic text, false for non-italicspublic boolean isUnderlined()
isUnderlined
in interface TextRun
public void setUnderlined(boolean underlined)
TextRun
setUnderlined
in interface TextRun
underlined
- set to true for underlined text, false for no underliningpublic boolean isShadowed()
public void setShadowed(boolean flag)
public boolean isEmbossed()
public void setEmbossed(boolean flag)
public boolean isStrikethrough()
isStrikethrough
in interface TextRun
public void setStrikethrough(boolean flag)
TextRun
setStrikethrough
in interface TextRun
flag
- set to true for stroked text, false for no strokingpublic int getSuperscript()
public void setSuperscript(int val)
val
- the percentage of the font size. If the value is positive, it is superscript, otherwise it is subscriptpublic java.lang.Double getFontSize()
TextRun
getFontSize
in interface TextRun
public void setFontSize(java.lang.Double fontSize)
TextRun
setFontSize
in interface TextRun
fontSize
- font size in points, if null the underlying fontsize will be unsetpublic int getFontIndex()
public void setFontIndex(int idx)
public void setFontFamily(java.lang.String typeface)
TextRun
TextRun.setFontInfo(FontInfo, FontGroup)
with just a font name
setFontFamily
in interface TextRun
typeface
- the font to apply to this text run.
The value of null
removes the run specific font setting, so the default setting is activated again.public void setFontFamily(java.lang.String typeface, FontGroup fontGroup)
TextRun
TextRun.setFontInfo(FontInfo, FontGroup)
with just a font name
setFontFamily
in interface TextRun
typeface
- the font to apply to this text run.
The value of null
removes the run specific font setting, so the default setting is activated again.fontGroup
- the font group, i.e. the range of glpyhs to be covered.
if null
, the font group matching the first character will be returnedpublic void setFontInfo(FontInfo fontInfo, FontGroup fontGroup)
TextRun
setFontInfo
in interface TextRun
fontInfo
- the font to apply to this text run.
The value of null
removes the run specific font setting, so the default setting is activated again.fontGroup
- the font group, i.e. the range of glpyhs to be covered. defaults to latin, if null
.public java.lang.String getFontFamily()
TextRun
TextRun.getFontInfo(FontGroup)
getFontFamily
in interface TextRun
public java.lang.String getFontFamily(FontGroup fontGroup)
TextRun
TextRun.getFontInfo(FontGroup)
getFontFamily
in interface TextRun
fontGroup
- the font group, i.e. the range of glpyhs to be covered.
if null
, the font group matching the first character will be returned
public HSLFFontInfo getFontInfo(FontGroup fontGroup)
TextRun
getFontInfo
in interface TextRun
fontGroup
- the font group, i.e. the range of glpyhs to be covered.
if null
, the font group matching the first character will be returned
null
if not setpublic PaintStyle.SolidPaint getFontColor()
TextRun
PaintStyle.SolidPaint
, but but also other classes are possible
getFontColor
in interface TextRun
DrawPaint.getPaint(java.awt.Graphics2D, PaintStyle)
,
PaintStyle.SolidPaint.getSolidColor()
,
DrawPaint.applyColorTransform(ColorStyle)
public void setFontColor(int bgr)
Color
public void setFontColor(java.awt.Color color)
TextRun
setFontColor
in interface TextRun
color
- the colorpublic void setFontColor(PaintStyle color)
TextRun
setFontColor
in interface TextRun
color
- the colorDrawPaint.createSolidPaint(Color)
protected void setFlag(int index, boolean value)
public HSLFTextParagraph getTextParagraph()
public TextRun.TextCap getTextCap()
getTextCap
in interface TextRun
public boolean isSubscript()
isSubscript
in interface TextRun
public boolean isSuperscript()
isSuperscript
in interface TextRun
public byte getPitchAndFamily()
getPitchAndFamily
in interface TextRun
protected void setHyperlink(HSLFHyperlink link)
link
- the hyperlinkpublic HSLFHyperlink getHyperlink()
TextRun
getHyperlink
in interface TextRun
public HSLFHyperlink createHyperlink()
TextRun
createHyperlink
in interface TextRun
public TextRun.FieldType getFieldType()
TextRun
getFieldType
in interface TextRun
null
if text run is not a field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |