| Method from org.apache.poi.hslf.usermodel.RichTextRun Detail: |
public TextPropCollection _getRawCharacterStyle() {
return characterStyle;
}
Internal Use Only - get the underlying character style collection.
For normal use, use the friendly setters and getters |
public TextPropCollection _getRawParagraphStyle() {
return paragraphStyle;
}
Internal Use Only - get the underlying paragraph style collection.
For normal use, use the friendly setters and getters |
public boolean _isCharacterStyleShared() {
return sharingCharacterStyle;
}
Internal Use Only - are the Character styles shared? |
public boolean _isParagraphStyleShared() {
return sharingParagraphStyle;
}
Internal Use Only - are the Paragraph styles shared? |
public int getAlignment() {
return getParaTextPropVal("alignment");
}
Returns the type of horizontal alignment for the text.
One of the Align* constants defined in the TextBox class. |
public char getBulletChar() {
return (char)getParaTextPropVal("bullet.char");
}
Returns the bullet character |
public Color getBulletColor() {
int rgb = getParaTextPropVal("bullet.color");
if(rgb == -1) return getFontColor();
int cidx = rgb > > 24;
if (rgb % 0x1000000 == 0){
ColorSchemeAtom ca = parentRun.getSheet().getColorScheme();
if(cidx >= 0 && cidx < = 7) rgb = ca.getColor(cidx);
}
Color tmp = new Color(rgb, true);
return new Color(tmp.getBlue(), tmp.getGreen(), tmp.getRed());
}
|
public int getBulletFont() {
return getParaTextPropVal("bullet.font");
}
|
public int getBulletOffset() {
return getParaTextPropVal("bullet.offset")*Shape.POINT_DPI/Shape.MASTER_DPI;
}
Returns the bullet offset |
public int getBulletSize() {
return getParaTextPropVal("bullet.size");
}
|
public int getEndIndex() {
return startPos + length;
}
The ending index, exclusive. |
public Color getFontColor() {
int rgb = getCharTextPropVal("font.color");
int cidx = rgb > > 24;
if (rgb % 0x1000000 == 0){
ColorSchemeAtom ca = parentRun.getSheet().getColorScheme();
if(cidx >= 0 && cidx < = 7) rgb = ca.getColor(cidx);
}
Color tmp = new Color(rgb, true);
return new Color(tmp.getBlue(), tmp.getGreen(), tmp.getRed());
}
|
public int getFontIndex() {
return getCharTextPropVal("font.index");
}
|
public String getFontName() {
if (slideShow == null) {
return _fontname;
} else {
int fontIdx = getCharTextPropVal("font.index");
if(fontIdx == -1) { return null; }
return slideShow.getFontCollection().getFontWithId(fontIdx);
}
}
|
public int getFontSize() {
return getCharTextPropVal("font.size");
}
|
public int getIndentLevel() {
return paragraphStyle == null ? 0 : paragraphStyle.getReservedField();
}
|
public int getLength() {
return length;
}
Get the length of the text |
public int getLineSpacing() {
int val = getParaTextPropVal("linespacing");
return val == -1 ? 0 : val;
}
Returns the line spacing
If linespacing >= 0, then linespacing is a percentage of normal line height.
If linespacing < 0, the absolute value of linespacing is the spacing in master coordinates.
|
public String getRawText() {
return parentRun.getRawText().substring(startPos, startPos+length);
}
Fetch the text, in raw storage form |
public int getSpaceAfter() {
int val = getParaTextPropVal("spaceafter");
return val == -1 ? 0 : val;
}
Returns spacing after a paragraph
If spaceafter >= 0, then spaceafter is a percentage of normal line height.
If spaceafter < 0, the absolute value of spaceafter is the spacing in master coordinates.
|
public int getSpaceBefore() {
int val = getParaTextPropVal("spacebefore");
return val == -1 ? 0 : val;
}
Returns spacing before a paragraph
If spacebefore >= 0, then spacebefore is a percentage of normal line height.
If spacebefore < 0, the absolute value of spacebefore is the spacing in master coordinates.
|
public int getStartIndex() {
return startPos;
}
The beginning index, inclusive. |
public int getSuperscript() {
int val = getCharTextPropVal("superscript");
return val == -1 ? 0 : val;
}
Gets the subscript/superscript option |
public String getText() {
return parentRun.getText().substring(startPos, startPos+length);
}
Fetch the text, in output suitable form |
public int getTextOffset() {
return getParaTextPropVal("text.offset")*Shape.POINT_DPI/Shape.MASTER_DPI;
}
|
public boolean isBold() {
return isCharFlagsTextPropVal(CharFlagsTextProp.BOLD_IDX);
}
|
public boolean isBullet() {
return getFlag(false, ParagraphFlagsTextProp.BULLET_IDX);
}
Returns whether this rich text run has bullets |
public boolean isBulletHard() {
return getFlag(false, ParagraphFlagsTextProp.BULLET_IDX);
}
Returns whether this rich text run has bullets |
public boolean isEmbossed() {
return isCharFlagsTextPropVal(CharFlagsTextProp.RELIEF_IDX);
}
|
public boolean isItalic() {
return isCharFlagsTextPropVal(CharFlagsTextProp.ITALIC_IDX);
}
|
public boolean isShadowed() {
return isCharFlagsTextPropVal(CharFlagsTextProp.SHADOW_IDX);
}
Does the text have a shadow? |
public boolean isStrikethrough() {
return isCharFlagsTextPropVal(CharFlagsTextProp.STRIKETHROUGH_IDX);
}
Gets the strikethrough flag |
public boolean isUnderlined() {
return isCharFlagsTextPropVal(CharFlagsTextProp.UNDERLINE_IDX);
}
|
public void setAlignment(int align) {
setParaTextPropVal("alignment", align);
}
Sets the type of horizontal alignment for the text.
One of the Align* constants defined in the TextBox class. |
public void setBold(boolean bold) {
setCharFlagsTextPropVal(CharFlagsTextProp.BOLD_IDX, bold);
}
|
public void setBullet(boolean flag) {
setFlag(false, ParagraphFlagsTextProp.BULLET_IDX, flag);
}
Sets whether this rich text run has bullets |
public void setBulletChar(char c) {
setParaTextPropVal("bullet.char", c);
}
Sets the bullet character |
public void setBulletColor(Color color) {
int rgb = new Color(color.getBlue(), color.getGreen(), color.getRed(), 254).getRGB();
setParaTextPropVal("bullet.color", rgb);
}
|
public void setBulletFont(int idx) {
setParaTextPropVal("bullet.font", idx);
}
|
public void setBulletOffset(int offset) {
setParaTextPropVal("bullet.offset", offset*Shape.MASTER_DPI/Shape.POINT_DPI);
}
|
public void setBulletSize(int size) {
setParaTextPropVal("bullet.size", size);
}
|
public void setCharTextPropVal(String propName,
int val) {
// Ensure we have the StyleTextProp atom we're going to need
if(characterStyle == null) {
parentRun.ensureStyleAtomPresent();
// characterStyle will now be defined
}
TextProp tp = fetchOrAddTextProp(characterStyle, propName);
tp.setValue(val);
}
Sets the value of the given Paragraph TextProp, add if required |
public void setEmbossed(boolean flag) {
setCharFlagsTextPropVal(CharFlagsTextProp.RELIEF_IDX, flag);
}
|
public void setFlag(boolean isCharacter,
int index,
boolean value) {
TextPropCollection props;
String propname;
if (isCharacter){
props = characterStyle;
propname = CharFlagsTextProp.NAME;
} else {
props = paragraphStyle;
propname = ParagraphFlagsTextProp.NAME;
}
// Ensure we have the StyleTextProp atom we're going to need
if(props == null) {
parentRun.ensureStyleAtomPresent();
props = isCharacter ? characterStyle : paragraphStyle;
}
BitMaskTextProp prop = (BitMaskTextProp) fetchOrAddTextProp(props, propname);
prop.setSubValue(value,index);
}
|
public void setFontColor(int bgr) {
setCharTextPropVal("font.color", bgr);
}
Sets color of the text, as a int bgr.
(PowerPoint stores as BlueGreenRed, not the more
usual RedGreenBlue) |
public void setFontColor(Color color) {
// In PowerPont RGB bytes are swapped, as BGR
int rgb = new Color(color.getBlue(), color.getGreen(), color.getRed(), 254).getRGB();
setFontColor(rgb);
}
Sets color of the text, as a java.awt.Color |
public void setFontIndex(int idx) {
setCharTextPropVal("font.index", idx);
}
|
public void setFontName(String fontName) {
if (slideShow == null) {
//we can't set font since slideshow is not assigned yet
_fontname = fontName;
} else {
// Get the index for this font (adding if needed)
int fontIdx = slideShow.getFontCollection().addFont(fontName);
setCharTextPropVal("font.index", fontIdx);
}
}
Sets the font name to use |
public void setFontSize(int fontSize) {
setCharTextPropVal("font.size", fontSize);
}
|
public void setIndentLevel(int level) {
if(paragraphStyle != null ) paragraphStyle.setReservedField((short)level);
}
|
public void setItalic(boolean italic) {
setCharFlagsTextPropVal(CharFlagsTextProp.ITALIC_IDX, italic);
}
|
public void setLineSpacing(int val) {
setParaTextPropVal("linespacing", val);
}
Sets the line spacing.
If linespacing >= 0, then linespacing is a percentage of normal line height.
If linespacing < 0, the absolute value of linespacing is the spacing in master coordinates.
|
public void setParaTextPropVal(String propName,
int val) {
// Ensure we have the StyleTextProp atom we're going to need
if(paragraphStyle == null) {
parentRun.ensureStyleAtomPresent();
// paragraphStyle will now be defined
}
TextProp tp = fetchOrAddTextProp(paragraphStyle, propName);
tp.setValue(val);
}
Sets the value of the given Character TextProp, add if required |
public void setRawText(String text) {
length = text.length();
parentRun.changeTextInRichTextRun(this,text);
}
|
public void setShadowed(boolean flag) {
setCharFlagsTextPropVal(CharFlagsTextProp.SHADOW_IDX, flag);
}
Does the text have a shadow? |
public void setSpaceAfter(int val) {
setParaTextPropVal("spaceafter", val);
}
Sets spacing after a paragraph.
If spaceafter >= 0, then spaceafter is a percentage of normal line height.
If spaceafter < 0, the absolute value of spaceafter is the spacing in master coordinates.
|
public void setSpaceBefore(int val) {
setParaTextPropVal("spacebefore", val);
}
Sets spacing before a paragraph.
If spacebefore >= 0, then spacebefore is a percentage of normal line height.
If spacebefore < 0, the absolute value of spacebefore is the spacing in master coordinates.
|
public void setStrikethrough(boolean flag) {
setCharFlagsTextPropVal(CharFlagsTextProp.STRIKETHROUGH_IDX, flag);
}
Sets the strikethrough flag |
public void setSuperscript(int val) {
setCharTextPropVal("superscript", val);
}
Sets the subscript/superscript option |
public void setText(String text) {
String s = parentRun.normalize(text);
setRawText(s);
}
|
public void setTextOffset(int offset) {
setParaTextPropVal("text.offset", offset*Shape.MASTER_DPI/Shape.POINT_DPI);
}
|
public void setUnderlined(boolean underlined) {
setCharFlagsTextPropVal(CharFlagsTextProp.UNDERLINE_IDX, underlined);
}
|
public void supplySlideShow(SlideShow ss) {
slideShow = ss;
if (_fontname != null) {
setFontName(_fontname);
_fontname = null;
}
}
Supply the SlideShow we belong to |
public void supplyTextProps(TextPropCollection pStyle,
TextPropCollection cStyle,
boolean pShared,
boolean cShared) {
if(paragraphStyle != null || characterStyle != null) {
throw new IllegalStateException("Can't call supplyTextProps if run already has some");
}
paragraphStyle = pStyle;
characterStyle = cStyle;
sharingParagraphStyle = pShared;
sharingCharacterStyle = cShared;
}
Supply (normally default) textprops, and if they're shared,
when a run gets them |
public void updateStartPosition(int startAt) {
startPos = startAt;
}
Tells the RichTextRun its new position in the parent TextRun |