org.odftoolkit.simple.style
public class MasterPage extends Object
This class is a corresponding high level class for element "style:master-page". It provides methods to access the attributes and children of "style:master-page".
Modifier and Type | Method and Description |
---|---|
double |
getFootnoteMaxHeight()
Get the footnote max height of the the
PageLayoutProperties
referenced by this master page. |
String |
getFootnoteSepAdjustment()
Get the way in which a footnote separator line aligned to a page, which
is set by the
PageLayoutProperties referenced by this master
page. |
String |
getFootnoteSepColor()
Get the color of a footnote separator which is set by the
PageLayoutProperties referenced by this master page. |
double |
getFootnoteSepDistanceAfterSep()
Get the distance between a footnote separator and the footnote area,
which is set by the
PageLayoutProperties referenced by this
master page. |
double |
getFootnoteSepDistanceBeforeSep()
Get the distance between the text area and the footnote separator, which
is set by the
PageLayoutProperties referenced by this master
page. |
String |
getFootnoteSepLineStyle()
Get the line style of a footnote separator which is set by the
PageLayoutProperties referenced by this master page. |
double |
getFootnoteSepThickness()
Get the thickness of a footnote separator which is set by the
PageLayoutProperties referenced by this master page. |
double |
getFootnoteSepWidth()
Get the real width of a footnote separator which is set by the
PageLayoutProperties referenced by this master page. |
double |
getMarginBottom()
Get the bottom margin of the
PageLayoutProperties referenced
by this master page. |
double |
getMarginLeft()
Get the left margin of the
PageLayoutProperties referenced
by this master page. |
double |
getMarginRight()
Get the right margin of the
PageLayoutProperties referenced
by this master page. |
double |
getMarginTop()
Get the top margin of the
PageLayoutProperties referenced by
this master page. |
String |
getName()
Get the name of this master page.
|
String |
getNumberFormat()
Get the number format of the the
PageLayoutProperties
referenced by this master page. |
static MasterPage |
getOrCreateMasterPage(Document doc,
String name)
Return a master page according to its name and its document.
|
double |
getPageHeight()
Get the page height of the the
PageLayoutProperties
referenced by this master page. |
double |
getPageWidth()
Get the page width of the the
PageLayoutProperties
referenced by this master page. |
String |
getPrintOrientation()
Get the print orientation of the the
PageLayoutProperties
referenced by this master page. |
String |
getWritingMode()
Get the writing mode of the the
PageLayoutProperties
referenced by this master page. |
void |
setFootnoteMaxHeight(double height)
Set the footnote max height of the
PageLayoutProperties
referenced by this master page. |
void |
setFootnoteSepProperties(StyleTypeDefinitions.AdjustmentStyle adjustment,
Color color,
double distanceAfterSep,
double distanceBeforeSep,
StyleTypeDefinitions.LineStyle lineStyle,
Percent width,
double thickness)
Set the foot note separator properties of the
PageLayoutProperties referenced by this master page. |
void |
setMargins(double marginTop,
double marginBottom,
double marginLeft,
double marginRight)
Set the margins of the
PageLayoutProperties referenced by
this master page. |
void |
setNumberFormat(String format)
Set the number format of the
PageLayoutProperties referenced
by this master page. |
void |
setPageHeight(double pageHeight)
Set the page height of the
PageLayoutProperties referenced
by this master page. |
void |
setPageWidth(double pageWidth)
Set the page width of the
PageLayoutProperties referenced by
this master page. |
void |
setPrintOrientation(StyleTypeDefinitions.PrintOrientation orientation)
Set the print orientation of the
PageLayoutProperties
referenced by this master page. |
void |
setWritingMode(StyleTypeDefinitions.WritingMode mode)
Set the writing mode of the
PageLayoutProperties referenced
by this master page. |
public static MasterPage getOrCreateMasterPage(Document doc, String name) throws Exception
If there is no existing master page defined by this name in the document, a new master with this name will be created and returned.
doc
- - the document to which the master page belongs.name
- - the name of the master pageException
- if the style DOM cannot be initializedpublic String getName()
This represents the attribute style:name
of
style:master-page
.
public double getMarginTop()
PageLayoutProperties
referenced by
this master page.public double getMarginRight()
PageLayoutProperties
referenced
by this master page.public double getMarginLeft()
PageLayoutProperties
referenced
by this master page.public double getMarginBottom()
PageLayoutProperties
referenced
by this master page.public void setMargins(double marginTop, double marginBottom, double marginLeft, double marginRight) throws Exception
PageLayoutProperties
referenced by
this master page.
If the margin size is set to zero, the corresponding margin definition will be removed.
marginTop
- the size of the top margin (in Millimeter)marginBottom
- the size of the bottom margin (in Millimeter)marginLeft
- the size of the left margin (in Millimeter)marginRight
- the size of the right margin (in Millimeter)Exception
- if the corresponding StylePageLayoutElement
cannot be accessed for write.public double getPageWidth()
PageLayoutProperties
referenced by this master page.public void setPageWidth(double pageWidth) throws Exception
PageLayoutProperties
referenced by
this master page.
If the size is set to zero, the page width definition will be removed.
pageWidth
- the size of the page width (in Millimeter)Exception
- if the corresponding StylePageLayoutElement
cannot be accessed for write.public double getPageHeight()
PageLayoutProperties
referenced by this master page.public void setPageHeight(double pageHeight) throws Exception
PageLayoutProperties
referenced
by this master page.
If the size is set to zero, the page height definition will be removed.
pageHeight
- the size of the page height (in Millimeter)Exception
- if the corresponding StylePageLayoutElement
cannot be accessed for write.public String getNumberFormat()
PageLayoutProperties
referenced by this master page.public void setNumberFormat(String format) throws Exception
PageLayoutProperties
referenced
by this master page.format
- specify the number format. The values of the style:num-format
attribute are 1, i, I, string, an empty string, a or A.Exception
- if the corresponding StylePageLayoutElement
cannot be accessed for write.public String getPrintOrientation()
PageLayoutProperties
referenced by this master page.public void setPrintOrientation(StyleTypeDefinitions.PrintOrientation orientation) throws Exception
PageLayoutProperties
referenced by this master page.
If the parameter orientation
is null, the print orientation
definition will be removed.
orientation
- - the print orientationException
- if the corresponding StylePageLayoutElement
cannot be accessed for write.public String getWritingMode()
PageLayoutProperties
referenced by this master page.public void setWritingMode(StyleTypeDefinitions.WritingMode mode) throws Exception
PageLayoutProperties
referenced
by this master page.mode
- - writing modeException
- if the corresponding StylePageLayoutElement
cannot be accessed for write.public double getFootnoteMaxHeight()
PageLayoutProperties
referenced by this master page.public void setFootnoteMaxHeight(double height) throws Exception
PageLayoutProperties
referenced by this master page.height
- - the max height of a footnote areaException
- if the corresponding StylePageLayoutElement
cannot be accessed for write.public String getFootnoteSepAdjustment()
PageLayoutProperties
referenced by this master
page.public String getFootnoteSepColor()
PageLayoutProperties
referenced by this master page.public double getFootnoteSepDistanceAfterSep()
PageLayoutProperties
referenced by this
master page.public double getFootnoteSepDistanceBeforeSep()
PageLayoutProperties
referenced by this master
page.public String getFootnoteSepLineStyle()
PageLayoutProperties
referenced by this master page.public double getFootnoteSepWidth()
PageLayoutProperties
referenced by this master page.public double getFootnoteSepThickness()
PageLayoutProperties
referenced by this master page.public void setFootnoteSepProperties(StyleTypeDefinitions.AdjustmentStyle adjustment, Color color, double distanceAfterSep, double distanceBeforeSep, StyleTypeDefinitions.LineStyle lineStyle, Percent width, double thickness) throws Exception
PageLayoutProperties
referenced by this master page.Exception
- if the corresponding StylePageLayoutElement
cannot be accessed for write.PageLayoutProperties#setFootnoteSepProperties(AdjustmentStyle,
Color, double, double, LineStyle, Percent, double)
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.