incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kejia Ye (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ODFTOOLKIT-336) Add new APIs to set page style when inserting page break in TextDocument
Date Fri, 07 Sep 2012 06:26:07 GMT

     [ https://issues.apache.org/jira/browse/ODFTOOLKIT-336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kejia Ye updated ODFTOOLKIT-336:
--------------------------------

    Attachment: patch_pagelayout_20120907.patch

A patch is uploaded to implement this feature. Review and comments are welcomed. Thanks.

The contents include:

1. New class of PageLayoutProperties.java . 
  /**
 * 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.
 * 
 * <p>
 * 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
 */

2. New class of MasterPage. java. 
  /**
 * This class represents the master page style settings. It provides methods to
 * access page layout styles. More functions will be added latter.
 * 
 * <p>
 * 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".
 * 
 * @since 0.8
 */

3. New API in TextDocument.java.
/**
	 * Appends a new page break to this document after the reference paragraph,
	 * and the master page style will be applied to the new page.
	 * 
	 * @param refParagraph
	 *            the reference paragraph after where the page break inserted.
	 * @param master
	 *            the master page style applied to the new page.
	 * @since 0.8
	 */

	public void addPageBreak(Paragraph refParagraph, MasterPage master) 

4. New test cases in TextDocumentTest.java and PageLayoutPropertiesTest.java.
 
                
> Add new APIs to set page style when inserting page break in TextDocument
> ------------------------------------------------------------------------
>
>                 Key: ODFTOOLKIT-336
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-336
>             Project: ODF Toolkit
>          Issue Type: New Feature
>          Components: simple api
>    Affects Versions: 0.7
>            Reporter: Kejia Ye
>             Fix For: 0.8
>
>         Attachments: patch_pagelayout_20120907.patch
>
>
> I'd like to propose a new API which would allow customers to set the page style when
inserting a page break. It's a common scenario to change page style when adding page break,
like from "Portrait" to "Landscape" or vice versa. 
> In ODF specs, page style is defined through style:master-page, which specify the page
formatting properties through style:page-layout-name. In text document, a master page can
be assigned to paragraph style using a style:master-page-name attribute. Each time the paragraph
style is applied to text, a page break is inserted before the paragraph. A page that starts
at the page break would use the specified master page. 
> Need provide APIs to do 2 things:
> (1) Define a new master page or get an existing master page. 
> -  New class MasterPage, which would provide get/set methods for page layout properties,
like page width, page height, print orientation, margin and so on.
> (2) Assign the master page to an appointed paragraph to add page break before it.
>  -  TextDocument.addPageBreak(Paragraph refParagraph, MasterPage masterPage)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message