public class ParagraphFormat extends PVIObject implements IParagraphFormat, IChartParagraphFormat
This class contains the paragraph formatting properties. Unlike ParagraphFormatEffectiveData
, all properties of this class are writeable.
This class is used to return and manipulate paragraph formatting properties defined for the particular paragraph. This means that no inheritance is applied when getting values so for the majority of cases you will get values meaning "undefined".
In order to get the effective formatting parameter values including inherited you need to use getEffective()
method
which returns a ParagraphFormatEffectiveData
instance.
Constructor and Description |
---|
ParagraphFormat()
Initializes a new instance of
ParagraphFormat class. |
Modifier and Type | Method and Description |
---|---|
int |
getAlignment()
Returns or sets the text alignment in a paragraph with no inheritance.
|
IBulletFormat |
getBullet()
Returns bullet format of the paragraph.
|
IPortionFormat |
getDefaultPortionFormat()
Returns default portion format of a paragraph.
|
float |
getDefaultTabSize()
Returns or sets default tabulation size with no inheritance.
|
short |
getDepth()
Returns or sets depth of the paragraph.
|
byte |
getEastAsianLineBreak()
Determines whether the East Asian line break is used in a paragraph.
|
IParagraphFormatEffectiveData |
getEffective()
Gets effective paragraph formatting data with the inheritance applied.
|
int |
getFontAlignment()
Returns or sets a font alignment in a paragraph with no inheritance.
|
byte |
getHangingPunctuation()
Determines whether the hanging punctuation is used in a paragraph.
|
float |
getIndent()
Returns or sets paragraph First Line Indent/Hanging Indent with no inheritance.
|
byte |
getLatinLineBreak()
Determines whether the Latin line break is used in a paragraph.
|
float |
getMarginLeft()
Returns or sets the left margin in a paragraph with no inheritance.
|
float |
getMarginRight()
Returns or sets the right margin in a paragraph with no inheritance.
|
byte |
getRightToLeft()
Determines whether the Right to Left writing is used in a paragraph.
|
float |
getSpaceAfter()
Returns or sets the amount of space after the last line in a paragraph with no inheritance.
|
float |
getSpaceBefore()
Returns or sets the amount of space before the first line in a paragraph with no inheritance.
|
float |
getSpaceWithin()
Returns or sets the amount of space between base lines in a paragraph.
|
ITabCollection |
getTabs()
Returns tabulations of a paragraph.
|
long |
getVersion()
Version.
|
void |
setAlignment(int value)
Returns or sets the text alignment in a paragraph with no inheritance.
|
void |
setDefaultTabSize(float value)
Returns or sets default tabulation size with no inheritance.
|
void |
setDepth(short value)
Returns or sets depth of the paragraph.
|
void |
setEastAsianLineBreak(byte value)
Determines whether the East Asian line break is used in a paragraph.
|
void |
setFontAlignment(int value)
Returns or sets a font alignment in a paragraph with no inheritance.
|
void |
setHangingPunctuation(byte value)
Determines whether the hanging punctuation is used in a paragraph.
|
void |
setIndent(float value)
Returns or sets paragraph First Line Indent/Hanging Indent with no inheritance.
|
void |
setLatinLineBreak(byte value)
Determines whether the Latin line break is used in a paragraph.
|
void |
setMarginLeft(float value)
Returns or sets the left margin in a paragraph with no inheritance.
|
void |
setMarginRight(float value)
Returns or sets the right margin in a paragraph with no inheritance.
|
void |
setRightToLeft(byte value)
Determines whether the Right to Left writing is used in a paragraph.
|
void |
setSpaceAfter(float value)
Returns or sets the amount of space after the last line in a paragraph with no inheritance.
|
void |
setSpaceBefore(float value)
Returns or sets the amount of space before the first line in a paragraph with no inheritance.
|
void |
setSpaceWithin(float value)
Returns or sets the amount of space between base lines in a paragraph.
|
equals, getParent_Immediate, getParent_IPresentationComponent, getParent_ISlideComponent, getPresentation, getSlide, hashCode, reset_Parent_IPresentationComponent
public ParagraphFormat()
Initializes a new instance of ParagraphFormat
class.
public final IBulletFormat getBullet()
Returns bullet format of the paragraph.
Read-only IBulletFormat
.
getBullet
in interface IParagraphFormat
public final short getDepth()
Returns or sets depth of the paragraph.
Value 0 means undefined value.
Read/write short
.
getDepth
in interface IParagraphFormat
public final void setDepth(short value)
Returns or sets depth of the paragraph.
Value 0 means undefined value.
Read/write short
.
setDepth
in interface IParagraphFormat
public final int getAlignment()
Returns or sets the text alignment in a paragraph with no inheritance.
Read/write TextAlignment
.
getAlignment
in interface IChartParagraphFormat
getAlignment
in interface IParagraphFormat
public final void setAlignment(int value)
Returns or sets the text alignment in a paragraph with no inheritance.
Read/write TextAlignment
.
setAlignment
in interface IChartParagraphFormat
setAlignment
in interface IParagraphFormat
public final float getSpaceWithin()
Returns or sets the amount of space between base lines in a paragraph. Positive value means percentage, negative - size in points. No inheritance applied.
Read/write float
.
getSpaceWithin
in interface IChartParagraphFormat
getSpaceWithin
in interface IParagraphFormat
public final void setSpaceWithin(float value)
Returns or sets the amount of space between base lines in a paragraph. Positive value means percentage, negative - size in points. No inheritance applied.
Read/write float
.
setSpaceWithin
in interface IChartParagraphFormat
setSpaceWithin
in interface IParagraphFormat
public final float getSpaceBefore()
Returns or sets the amount of space before the first line in a paragraph with no inheritance.
A positive value specifies the percentage of the font size that the white space should be.
A negative value specifies the size of the white space in point size.
Read/write float
.
getSpaceBefore
in interface IChartParagraphFormat
getSpaceBefore
in interface IParagraphFormat
public final void setSpaceBefore(float value)
Returns or sets the amount of space before the first line in a paragraph with no inheritance.
A positive value specifies the percentage of the font size that the white space should be.
A negative value specifies the size of the white space in point size.
Read/write float
.
setSpaceBefore
in interface IChartParagraphFormat
setSpaceBefore
in interface IParagraphFormat
public final float getSpaceAfter()
Returns or sets the amount of space after the last line in a paragraph with no inheritance.
A positive value specifies the percentage of the font size that the white space should be.
A negative value specifies the size of the white space in point size.
Read/write float
.
getSpaceAfter
in interface IChartParagraphFormat
getSpaceAfter
in interface IParagraphFormat
public final void setSpaceAfter(float value)
Returns or sets the amount of space after the last line in a paragraph with no inheritance.
A positive value specifies the percentage of the font size that the white space should be.
A negative value specifies the size of the white space in point size.
Read/write float
.
setSpaceAfter
in interface IChartParagraphFormat
setSpaceAfter
in interface IParagraphFormat
public final byte getEastAsianLineBreak()
Determines whether the East Asian line break is used in a paragraph. No inheritance applied.
Read/write NullableBool
.
getEastAsianLineBreak
in interface IChartParagraphFormat
getEastAsianLineBreak
in interface IParagraphFormat
public final void setEastAsianLineBreak(byte value)
Determines whether the East Asian line break is used in a paragraph. No inheritance applied.
Read/write NullableBool
.
setEastAsianLineBreak
in interface IChartParagraphFormat
setEastAsianLineBreak
in interface IParagraphFormat
public final byte getRightToLeft()
Determines whether the Right to Left writing is used in a paragraph. No inheritance applied.
Read/write NullableBool
.
getRightToLeft
in interface IChartParagraphFormat
getRightToLeft
in interface IParagraphFormat
public final void setRightToLeft(byte value)
Determines whether the Right to Left writing is used in a paragraph. No inheritance applied.
Read/write NullableBool
.
setRightToLeft
in interface IChartParagraphFormat
setRightToLeft
in interface IParagraphFormat
public final byte getLatinLineBreak()
Determines whether the Latin line break is used in a paragraph. No inheritance applied.
Read/write NullableBool
.
getLatinLineBreak
in interface IChartParagraphFormat
getLatinLineBreak
in interface IParagraphFormat
public final void setLatinLineBreak(byte value)
Determines whether the Latin line break is used in a paragraph. No inheritance applied.
Read/write NullableBool
.
setLatinLineBreak
in interface IChartParagraphFormat
setLatinLineBreak
in interface IParagraphFormat
public final byte getHangingPunctuation()
Determines whether the hanging punctuation is used in a paragraph. No inheritance applied.
Read/write NullableBool
.
getHangingPunctuation
in interface IChartParagraphFormat
getHangingPunctuation
in interface IParagraphFormat
public final void setHangingPunctuation(byte value)
Determines whether the hanging punctuation is used in a paragraph. No inheritance applied.
Read/write NullableBool
.
setHangingPunctuation
in interface IChartParagraphFormat
setHangingPunctuation
in interface IParagraphFormat
public final float getMarginLeft()
Returns or sets the left margin in a paragraph with no inheritance.
Read/write float
.
getMarginLeft
in interface IChartParagraphFormat
getMarginLeft
in interface IParagraphFormat
public final void setMarginLeft(float value)
Returns or sets the left margin in a paragraph with no inheritance.
Read/write float
.
setMarginLeft
in interface IChartParagraphFormat
setMarginLeft
in interface IParagraphFormat
public final float getMarginRight()
Returns or sets the right margin in a paragraph with no inheritance.
Read/write float
.
getMarginRight
in interface IChartParagraphFormat
getMarginRight
in interface IParagraphFormat
public final void setMarginRight(float value)
Returns or sets the right margin in a paragraph with no inheritance.
Read/write float
.
setMarginRight
in interface IChartParagraphFormat
setMarginRight
in interface IParagraphFormat
public final float getIndent()
Returns or sets paragraph First Line Indent/Hanging Indent with no inheritance. Hanging Indent can be defined with negative values.
Read/write float
.
getIndent
in interface IChartParagraphFormat
getIndent
in interface IParagraphFormat
public final void setIndent(float value)
Returns or sets paragraph First Line Indent/Hanging Indent with no inheritance. Hanging Indent can be defined with negative values.
Read/write float
.
setIndent
in interface IChartParagraphFormat
setIndent
in interface IParagraphFormat
public final float getDefaultTabSize()
Returns or sets default tabulation size with no inheritance.
Read/write float
.
getDefaultTabSize
in interface IChartParagraphFormat
getDefaultTabSize
in interface IParagraphFormat
public final void setDefaultTabSize(float value)
Returns or sets default tabulation size with no inheritance.
Read/write float
.
setDefaultTabSize
in interface IChartParagraphFormat
setDefaultTabSize
in interface IParagraphFormat
public final ITabCollection getTabs()
Returns tabulations of a paragraph. No inheritance applied.
Read-only ITabCollection
.
getTabs
in interface IChartParagraphFormat
getTabs
in interface IParagraphFormat
public final int getFontAlignment()
Returns or sets a font alignment in a paragraph with no inheritance.
Read/write FontAlignment
.
getFontAlignment
in interface IChartParagraphFormat
getFontAlignment
in interface IParagraphFormat
public final void setFontAlignment(int value)
Returns or sets a font alignment in a paragraph with no inheritance.
Read/write FontAlignment
.
setFontAlignment
in interface IChartParagraphFormat
setFontAlignment
in interface IParagraphFormat
public final IPortionFormat getDefaultPortionFormat()
Returns default portion format of a paragraph. No inheritance applied.
Read-only IPortionFormat
.
getDefaultPortionFormat
in interface IParagraphFormat
public final IParagraphFormatEffectiveData getEffective()
Gets effective paragraph formatting data with the inheritance applied.
This example demonstrates getting some effective paragraph format properties.Presentation pres = new Presentation("MyPresentation.pptx"); try { IAutoShape shape = (IAutoShape)pres.getSlides().get_Item(0).getShapes().get_Item(0); IParagraphFormatEffectiveData effectiveParagraphFormat = shape.getTextFrame().getParagraphs().get_Item(0).getParagraphFormat().getEffective(); System.out.println("Text alignment: " + effectiveParagraphFormat.getAlignment()); System.out.println("Indent: " + effectiveParagraphFormat.getIndent()); System.out.println("Bullet type: " + effectiveParagraphFormat.getBullet().getType()); } finally { if (pres != null) pres.dispose(); }
getEffective
in interface IParagraphFormat
IParagraphFormatEffectiveData
.public long getVersion()
Version.
Read-only long
.
getVersion
in class PVIObject