|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odftoolkit.simple.style.PageLayoutProperties
public class PageLayoutProperties
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".
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 |
---|
protected PageLayoutProperties()
protected PageLayoutProperties(StylePageLayoutPropertiesElement pageLayoutProperties)
pageLayoutProperties
- - the element of style:page-layout-propertiesMethod Detail |
---|
public void setBorders(StyleTypeDefinitions.CellBordersType bordersType, Border border)
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.
bordersType
- - the type of the bordersborder
- - the border style descriptionpublic Border getBorder()
Null will be returned if there is no border setting for all four borders.
public Border getTopBorder()
Null will be returned if there is no border setting for the top border.
public Border getLeftBorder()
Null will be returned if there is no border setting for the left border.
public Border getRightBorder()
Null will be returned if there is no border setting for the right border.
public Border getBottomBorder()
Null will be returned if there is no border setting for the bottom border.
public void setBorder(Border border)
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.
border
- - the border settingpublic void setBottomBorder(Border 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.
border
- - the border settingpublic void setTopBorder(Border 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.
border
- - the border settingpublic void setLeftBorder(Border 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.
border
- - the border settingpublic void setRightBorder(Border 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.
border
- - the border settingpublic void setMarginLeft(double marginLeft)
PageLayoutProperties
If the size is set to zero, the left margin definition will be removed.
marginLeft
- the size of the left margin (in Millimeter)public double getMarginLeft()
PageLayoutProperties
If the size is set to zero, the left margin definition will be removed.
public void setMarginRight(double marginRight)
PageLayoutProperties
If the size is set to zero, the right margin definition will be removed.
marginRight
- the size of the right margin (in Millimeter)public double getMarginRight()
PageLayoutProperties
public void setMarginTop(double marginTop)
PageLayoutProperties
If the size is set to zero, the top margin definition will be removed.
marginTop
- the size of the right margin (in Millimeter)public double getMarginTop()
PageLayoutProperties
public void setMarginBottom(double marginBottom)
PageLayoutProperties
If the size is set to zero, the bottom margin definition will be removed.
marginBottom
- the size of the bottom margin (in Millimeter)public double getMarginBottom()
PageLayoutProperties
public String getNumberFormat()
PageLayoutProperties
public void setNumberFormat(String format)
PageLayoutProperties
If the parameter format
is null, the definition will be
removed.
format
- specify the number format. The values of the style:num-format
attribute are 1, i, I, string, an empty string, a or A.public double getPageWidth()
PageLayoutProperties
public void setPageWidth(double pageWidth)
PageLayoutProperties
If the size is set to zero, the page width definition will be removed.
pageWidth
- the size of the page width (in Millimeter)public double getPageHeight()
PageLayoutProperties
public void setPageHeight(double pageHeight)
PageLayoutProperties
If the size is set to zero, the page height definition will be removed.
pageHeight
- the size of the page height (in Millimeter)public String getPrintOrientation()
PageLayoutProperties
public void setPrintOrientation(StyleTypeDefinitions.PrintOrientation orientation)
PageLayoutProperties
If the parameter orientation
is null, the print orientation
definition will be removed.
orientation
- - the print orientationpublic String getFootnoteSepAdjustment()
If there is no style:footnote-sep
element, the default value
"left" will be returned.
public String getFootnoteSepColor()
If there is no style:footnote-sep
element, the null value
will be returned.
public double getFootnoteSepDistanceAfterSep()
If there is no style:footnote-sep
element, null will be
returned.
public double getFootnoteSepDistanceBeforeSep()
If there is no style:footnote-sep
element, null will be
returned.
public String getFootnoteSepLineStyle()
If there is no style:footnote-sep
element, the default value
"NONE" will be returned.
public double getFootnoteSepWidth()
If there is no style:footnote-sep
element, the default value
0 will be returned.
public double getFootnoteSepThickness()
If there is no style:footnote-sep
element, the default value
0 will be returned.
public void setFootnoteSepProperties(StyleTypeDefinitions.AdjustmentStyle adjustment, Color color, double distanceAfterSep, double distanceBeforeSep, StyleTypeDefinitions.LineStyle lineStyle, Percent width, double thickness)
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.
adjustment
- - specifies how a footnote separator line is aligned on a
page.color
- - specifies the color of a column or footnote separator linedistanceAfterSep
- - 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.public void setWritingMode(StyleTypeDefinitions.WritingMode mode)
PageLayoutProperties
If the parameter mode
is null, the default value of writing
node "page" will be set.
mode
- - specifies a writing mode.public String getWritingMode()
PageLayoutProperties
public void setFootnoteMaxHeight(double height)
If the value of this attribute is set to 0, there is no limit to the amount of space that the footnote can occupy.
height
- - the max height which a footnote area can occupypublic double getFootnoteMaxHeight()
public static PageLayoutProperties getOrCreatePageLayoutProperties(OdfStyleBase style)
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
public static PageLayoutProperties getPageLayoutProperties(OdfStyleBase style)
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |