org.odftoolkit.simple.style
Class ParagraphProperties

java.lang.Object
  extended by org.odftoolkit.simple.style.ParagraphProperties

public class ParagraphProperties
extends Object

This class represents the paragraph style settings. It provides methods to access horizontal alignment. More functions will be added latter.

This class is a corresponded high level class for element "style:paragraph-properties". It provides methods to access the attributes and children of "style:paragraph-properties".

Since:
0.3

Constructor Summary
protected ParagraphProperties()
          Create an empty paragraph style setting object
protected ParagraphProperties(StyleParagraphPropertiesElement properties)
          Create a paragraph style setting object, which has the association with an element "style:paragraph-properties".
 
Method Summary
 StyleTypeDefinitions.HorizontalAlignmentType getHorizontalAlignment()
          Return the horizontal alignment.
 double getMarginBottom()
          Get the size of the bottom margin of this ParagraphProperties
 double getMarginLeft()
          Get the size of the left margin of this ParagraphProperties
 double getMarginRight()
          Get the size of the right margin of this ParagraphProperties
 double getMarginTop()
          Get the size of the top margin of this ParagraphProperties
static ParagraphProperties getOrCreateParagraphProperties(OdfStyleBase style)
          Return an instance of ParagraphProperties
static ParagraphProperties getParagraphProperties(OdfStyleBase style)
          Return an instance of ParagraphProperties
 double getTextIndent()
          Get the size of the text indention of this ParagraphProperties
 void setHorizontalAlignment(StyleTypeDefinitions.HorizontalAlignmentType alignType)
          Set the horizontal alignment.
 void setMarginBottom(double marginBottom)
          Set the bottom margin of this ParagraphProperties
 void setMarginLeft(double marginLeft)
          Set the left margin of this ParagraphProperties
 void setMarginRight(double marginRight)
          Set the right margin of this ParagraphProperties
 void setMarginTop(double marginTop)
          Set the top margin of this ParagraphProperties
 void setTextIndent(double textIndent)
          Set the text indention size of this ParagraphProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParagraphProperties

protected ParagraphProperties()
Create an empty paragraph style setting object


ParagraphProperties

protected ParagraphProperties(StyleParagraphPropertiesElement properties)
Create a paragraph style setting object, which has the association with an element "style:paragraph-properties".

Parameters:
properties - - the element "style:paragraph-properties"
Method Detail

setHorizontalAlignment

public void setHorizontalAlignment(StyleTypeDefinitions.HorizontalAlignmentType alignType)
Set the horizontal alignment.

If the first parameter is null, the horizontal alignment setting will be removed.

Parameters:
alignType - - the horizontal alignment

getHorizontalAlignment

public StyleTypeDefinitions.HorizontalAlignmentType getHorizontalAlignment()
Return the horizontal alignment.

Null will be returned if there is no horizontal alignment setting.

Returns:
- the horizontal alignment; null if there is no horizontal alignment setting.

setMarginLeft

public void setMarginLeft(double marginLeft)
Set the left margin of this ParagraphProperties

Parameters:
marginLeft - the size of the left margin (in Millimeter)
Since:
0.7

getMarginLeft

public double getMarginLeft()
Get the size of the left margin of this ParagraphProperties

Returns:
the size of the left margin (in Millimeter)
Since:
0.7

setMarginRight

public void setMarginRight(double marginRight)
Set the right margin of this ParagraphProperties

Parameters:
marginRight - the size of the right margin (in Millimeter)
Since:
0.7

getMarginRight

public double getMarginRight()
Get the size of the right margin of this ParagraphProperties

Returns:
the size of the right margin (in Millimeter)
Since:
0.7

setMarginTop

public void setMarginTop(double marginTop)
Set the top margin of this ParagraphProperties

Parameters:
marginTop - the size of the right margin (in Millimeter)
Since:
0.7

getMarginTop

public double getMarginTop()
Get the size of the top margin of this ParagraphProperties

Returns:
the size of the top margin (in Millimeter)
Since:
0.7

setMarginBottom

public void setMarginBottom(double marginBottom)
Set the bottom margin of this ParagraphProperties

Parameters:
marginBottom - the size of the bottom margin (in Millimeter)
Since:
0.7

getMarginBottom

public double getMarginBottom()
Get the size of the bottom margin of this ParagraphProperties

Returns:
the size of the bottom margin (in Millimeter)
Since:
0.7

setTextIndent

public void setTextIndent(double textIndent)
Set the text indention size of this ParagraphProperties

Parameters:
textIndent - the size of the text indention (in Millimeter)
Since:
0.7

getTextIndent

public double getTextIndent()
Get the size of the text indention of this ParagraphProperties

Returns:
the size of the text indention (in Millimeter)
Since:
0.7

getOrCreateParagraphProperties

public static ParagraphProperties getOrCreateParagraphProperties(OdfStyleBase style)
Return an instance of ParagraphProperties

to represent the "style:paragraph-properties" in a style element.

If there is no "style:paragraph-properties" defined in the style element, a new "style:paragraph-properties" element will be created.

Parameters:
style - - a style element
Returns:
an instance of ParagraphProperties


getParagraphProperties

public static ParagraphProperties getParagraphProperties(OdfStyleBase style)
Return an instance of ParagraphProperties

to represent the "style:paragraph-properties" in a style element.

If there is no "style:paragraph-properties" defined in the style element, null will be returned.

Parameters:
style - - a style element
Returns:
an instance of ParagraphProperties

;Null if there is no "style:paragraph-properties" defined


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.