org.odftoolkit.simple.style
Class PageLayoutProperties

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

public class PageLayoutProperties
extends Object

This class represents the page layout style settings. It provides methods to access borders, margins,number format, page width, page height and etc. More functions will be added latter.

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

Since:
0.8

Constructor Summary
protected PageLayoutProperties()
          Create an instance of PageLayoutProperties
protected PageLayoutProperties(StylePageLayoutPropertiesElement pageLayoutProperties)
          Create an instance of PageLayoutProperties from an element
 
Method Summary
 Border getBorder()
          Return the border setting for all four borders.
 Border getBottomBorder()
          Return the border setting for the bottom border.
 double getFootnoteMaxHeight()
          Get the max height of a footnote area on a page.
 String getFootnoteSepAdjustment()
          Get the way in which a footnote separator line is aligned on a page.
 String getFootnoteSepColor()
          Get the color of footnote separator line.
 double getFootnoteSepDistanceAfterSep()
          Get the distance between a footnote separator line and the footnote text.
 double getFootnoteSepDistanceBeforeSep()
          Get the distance between the text area and a footnote separator line.
 String getFootnoteSepLineStyle()
          Get the line style of a footnote separator line.
 double getFootnoteSepThickness()
          Get the thickness of a footnote separator line.
 double getFootnoteSepWidth()
          Get the width of a footnote separator line.
 Border getLeftBorder()
          Return the border setting for the left border.
 double getMarginBottom()
          Get the size of the bottom margin of this PageLayoutProperties
 double getMarginLeft()
          Get the size of the left margin of this PageLayoutProperties
 double getMarginRight()
          Get the size of the right margin of this PageLayoutProperties
 double getMarginTop()
          Get the size of the top margin of this PageLayoutProperties
 String getNumberFormat()
          Get the number format of this PageLayoutProperties
static PageLayoutProperties getOrCreatePageLayoutProperties(OdfStyleBase style)
          Return an instance of PageLayoutProperties
 double getPageHeight()
          Get the page height of this PageLayoutProperties
static PageLayoutProperties getPageLayoutProperties(OdfStyleBase style)
          Return an instance of PageLayoutProperties
 double getPageWidth()
          Get the page width of this PageLayoutProperties
 String getPrintOrientation()
          Get the print orientation of this PageLayoutProperties
 Border getRightBorder()
          Return the border setting for the right border.
 Border getTopBorder()
          Return the border setting for the top border.
 String getWritingMode()
          Get the writing mode of this PageLayoutProperties
 void setBorder(Border border)
          Set the border definition for all four borders.
 void setBorders(StyleTypeDefinitions.CellBordersType bordersType, Border border)
          Set the border style.
 void setBottomBorder(Border border)
          Set the border definition for the bottom border.
 void setFootnoteMaxHeight(double height)
          Set the max height of a footnote area on a page.
 void setFootnoteSepProperties(StyleTypeDefinitions.AdjustmentStyle adjustment, Color color, double distanceAfterSep, double distanceBeforeSep, StyleTypeDefinitions.LineStyle lineStyle, Percent width, double thickness)
          Set the formatting of footnote separator of this PageLayoutProperties
 void setLeftBorder(Border border)
          Set the border definition for the left border.
 void setMarginBottom(double marginBottom)
          Set the bottom margin of this PageLayoutProperties
 void setMarginLeft(double marginLeft)
          Set the left margin of this PageLayoutProperties
 void setMarginRight(double marginRight)
          Set the right margin of this PageLayoutProperties
 void setMarginTop(double marginTop)
          Set the top margin of this PageLayoutProperties
 void setNumberFormat(String format)
          Set the number format of this PageLayoutProperties
 void setPageHeight(double pageHeight)
          Set the page height of this PageLayoutProperties
 void setPageWidth(double pageWidth)
          Set the page width of this PageLayoutProperties
 void setPrintOrientation(StyleTypeDefinitions.PrintOrientation orientation)
          Set the print orientation of this PageLayoutProperties
 void setRightBorder(Border border)
          Set the border definition for the right border.
 void setTopBorder(Border border)
          Set the border definition for the top border.
 void setWritingMode(StyleTypeDefinitions.WritingMode mode)
          Set the writing mode of this PageLayoutProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageLayoutProperties

protected PageLayoutProperties()
Create an instance of PageLayoutProperties


PageLayoutProperties

protected PageLayoutProperties(StylePageLayoutPropertiesElement pageLayoutProperties)
Create an instance of PageLayoutProperties from an element

Parameters:
pageLayoutProperties - - the element of style:page-layout-properties
Method Detail

setBorders

public void setBorders(StyleTypeDefinitions.CellBordersType bordersType,
                       Border border)
Set the border style.

The first parameter bordersType describes which borders you want to apply the style to, e.g. up border, bottom border, left border, right border or four borders.

The border style information will be removed if the parameter bordersType is NONE.

Parameters:
bordersType - - the type of the borders
border - - the border style description

getBorder

public Border getBorder()
Return the border setting for all four borders.

Null will be returned if there is no border setting for all four borders.

Returns:
the border setting

getTopBorder

public Border getTopBorder()
Return the border setting for the top border.

Null will be returned if there is no border setting for the top border.

Returns:
the border setting

getLeftBorder

public Border getLeftBorder()
Return the border setting for the left border.

Null will be returned if there is no border setting for the left border.

Returns:
the border setting

getRightBorder

public Border getRightBorder()
Return the border setting for the right border.

Null will be returned if there is no border setting for the right border.

Returns:
the border setting

getBottomBorder

public Border getBottomBorder()
Return the border setting for the bottom border.

Null will be returned if there is no border setting for the bottom border.

Returns:
the border setting

setBorder

public void setBorder(Border border)
Set the border definition for all four borders.

If the parameter border is null, the border definition for all four borders will be removed.

If the line type in the border definition is NONE, the border definition for all four borders will be removed.

Parameters:
border - - the border setting

setBottomBorder

public void setBottomBorder(Border border)
Set the border definition for the bottom border.

If the parameter border is null, the border definition for the bottom border will be removed.

If the line type in the border definition is NONE, the border definition for the bottom border will be removed.

Parameters:
border - - the border setting

setTopBorder

public void setTopBorder(Border border)
Set the border definition for the top border.

If the parameter border is null, the border definition for the top border will be removed.

If the line type in the border definition is NONE, the border definition for the top border will be removed.

Parameters:
border - - the border setting

setLeftBorder

public void setLeftBorder(Border border)
Set the border definition for the left border.

If the parameter border is null, the border definition for the left border will be removed.

If the line type in the border definition is NONE, the border definition for the left border will be removed.

Parameters:
border - - the border setting

setRightBorder

public void setRightBorder(Border border)
Set the border definition for the right border.

If the parameter border is null, the border definition for the right border will be removed.

If the line type in the border definition is NONE, the border definition for the right border will be removed.

Parameters:
border - - the border setting

setMarginLeft

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

If the size is set to zero, the left margin definition will be removed.

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

getMarginLeft

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

If the size is set to zero, the left margin definition will be removed.

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

setMarginRight

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

If the size is set to zero, the right margin definition will be removed.

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

getMarginRight

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

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

setMarginTop

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

If the size is set to zero, the top margin definition will be removed.

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

getMarginTop

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

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

setMarginBottom

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

If the size is set to zero, the bottom margin definition will be removed.

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

getMarginBottom

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

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

getNumberFormat

public String getNumberFormat()
Get the number format of this PageLayoutProperties

Returns:
the number format

setNumberFormat

public void setNumberFormat(String format)
Set the number format of this PageLayoutProperties

If the parameter format is null, the definition will be removed.

Parameters:
format - specify the number format. The values of the style:num-format attribute are 1, i, I, string, an empty string, a or A.

getPageWidth

public double getPageWidth()
Get the page width of this PageLayoutProperties

Returns:
the size of page width (in Millimeter)

setPageWidth

public void setPageWidth(double pageWidth)
Set the page width of this PageLayoutProperties

If the size is set to zero, the page width definition will be removed.

Parameters:
pageWidth - the size of the page width (in Millimeter)

getPageHeight

public double getPageHeight()
Get the page height of this PageLayoutProperties

Returns:
the size of page height (in Millimeter)

setPageHeight

public void setPageHeight(double pageHeight)
Set the page height of this PageLayoutProperties

If the size is set to zero, the page height definition will be removed.

Parameters:
pageHeight - the size of the page height (in Millimeter)

getPrintOrientation

public String getPrintOrientation()
Get the print orientation of this PageLayoutProperties

Returns:
the print orientation

setPrintOrientation

public void setPrintOrientation(StyleTypeDefinitions.PrintOrientation orientation)
Set the print orientation of this PageLayoutProperties

If the parameter orientation is null, the print orientation definition will be removed.

Parameters:
orientation - - the print orientation

getFootnoteSepAdjustment

public String getFootnoteSepAdjustment()
Get the way in which a footnote separator line is aligned on a page.

If there is no style:footnote-sep element, the default value "left" will be returned.

Returns:
the adjustment value of footnote separator line.

getFootnoteSepColor

public String getFootnoteSepColor()
Get the color of footnote separator line.

If there is no style:footnote-sep element, the null value will be returned.

Returns:
the color of footnote separator line.

getFootnoteSepDistanceAfterSep

public double getFootnoteSepDistanceAfterSep()
Get the distance between a footnote separator line and the footnote text.

If there is no style:footnote-sep element, null will be returned.

Returns:
the distance after a footnote separator line.

getFootnoteSepDistanceBeforeSep

public double getFootnoteSepDistanceBeforeSep()
Get the distance between the text area and a footnote separator line.

If there is no style:footnote-sep element, null will be returned.

Returns:
the distance before a footnote separator line.

getFootnoteSepLineStyle

public String getFootnoteSepLineStyle()
Get the line style of a footnote separator line.

If there is no style:footnote-sep element, the default value "NONE" will be returned.

Returns:
the line style of a footnote separator line.

getFootnoteSepWidth

public double getFootnoteSepWidth()
Get the width of a footnote separator line.

If there is no style:footnote-sep element, the default value 0 will be returned.

Returns:
the width a footnote separator line.

getFootnoteSepThickness

public double getFootnoteSepThickness()
Get the thickness of a footnote separator line.

If there is no style:footnote-sep element, the default value 0 will be returned.

Returns:
the thickness a footnote separator line.

setFootnoteSepProperties

public void setFootnoteSepProperties(StyleTypeDefinitions.AdjustmentStyle adjustment,
                                     Color color,
                                     double distanceAfterSep,
                                     double distanceBeforeSep,
                                     StyleTypeDefinitions.LineStyle lineStyle,
                                     Percent width,
                                     double thickness)
Set the formatting of footnote separator of this PageLayoutProperties

If the parameter adjustment is null, the adjustment definition will be set as left.
If the parameter lineStyle is null, the line style definition will be set as NONE.
If other parameters, like color, distanceAfterSep, distanceBeforeSep, width or thickness is null, the corresponding definition will be removed.

Parameters:
adjustment - - specifies how a footnote separator line is aligned on a page.
color - - specifies the color of a column or footnote separator line
distanceAfterSep - - specifies the space between a footnote separator line and the footnote text.
distanceBeforeSep - - specifies the space between the body text area and a footnote separator line.
lineStyle - - specifies the style of a footnote separator line.
width - - specifies the length of the footnote separator line as a percentage of the body text area.
thickness - - specifies the width or thickness of a line.

setWritingMode

public void setWritingMode(StyleTypeDefinitions.WritingMode mode)
Set the writing mode of this PageLayoutProperties

If the parameter mode is null, the default value of writing node "page" will be set.

Parameters:
mode - - specifies a writing mode.

getWritingMode

public String getWritingMode()
Get the writing mode of this PageLayoutProperties

Returns:
the value of writing mode

setFootnoteMaxHeight

public void setFootnoteMaxHeight(double height)
Set the max height of a footnote area on a page.

If the value of this attribute is set to 0, there is no limit to the amount of space that the footnote can occupy.

Parameters:
height - - the max height which a footnote area can occupy

getFootnoteMaxHeight

public double getFootnoteMaxHeight()
Get the max height of a footnote area on a page.

Returns:
the value of max height of footnote area.

getOrCreatePageLayoutProperties

public static PageLayoutProperties getOrCreatePageLayoutProperties(OdfStyleBase style)
Return an instance of PageLayoutProperties

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

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

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


getPageLayoutProperties

public static PageLayoutProperties getPageLayoutProperties(OdfStyleBase style)
Return an instance of PageLayoutProperties

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

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

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

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


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