Package org.foray.area

Examples of org.foray.area.AreaTree


     */
    public AreaTree buildAreaTree(final String file) throws FOrayException {
        final FoDocumentReader foReader = FoDocumentReader.getInstance();
        final FOTreeBuilder foTree = foReader.buildFoTree(file);
        final Root root = foTree.getRootFo();
        final AreaTree areaTree = this.areaTreeFactory.makeAreaTree(root);
        final PioneerLS layout = this.layoutFactory.makeLayout();
        final Iterator<PageSequence> iterator = root.getPageSequenceIterator();
        while (iterator.hasNext()) {
            final PageSequence pageSequence = iterator.next();
            try {
                final PageCollection collection = areaTree.makePageCollection(
                        pageSequence);
                layout.formatPageSequence(collection);
            } catch (final AreaTreeException e) {
                throw new FOrayException(e);
            }
View Full Code Here


     * @throws FOrayException For errors creating the FO Tree or Area Tree.
     */
    @Test
    public void testGraphic002() throws FOrayException {
        final AreaTreeCreator creator = AreaTreeCreator.getInstance();
        final AreaTree areaTree = creator.buildAreaTree(
                "fo/graphic-002.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);

        /* There are two block areas. */
 
View Full Code Here

     * @throws FOrayException For errors creating the FO Tree or Area Tree.
     */
    @Test
    public void testInline001() throws FOrayException {
        final AreaTreeCreator creator = AreaTreeCreator.getInstance();
        final AreaTree areaTree = creator.buildAreaTree(
                "fo/inline-001.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);
        assertEquals(1, firstNormalFlowArea.getChildCount());

View Full Code Here

     * @throws FOrayException For errors creating the FO Tree or Area Tree.
     */
    @Test
    public void testMetadata001() throws FOrayException {
        final AreaTreeCreator creator = AreaTreeCreator.getInstance();
        final AreaTree areaTree = creator.buildAreaTree(
                "fo/metadata-001.fo");
        assertNotNull(areaTree);
        assertEquals("Test Title", areaTree.getTitle());
        assertEquals("Test Author", areaTree.getAuthor());
        assertEquals("Test Subject", areaTree.getSubject());
        assertEquals("Test Keywords", areaTree.getKeywords());
    }
View Full Code Here

     * @throws FOrayException For errors creating the FO Tree or Area Tree.
     */
    @Test
    public void testVertical001() throws FOrayException {
        final AreaTreeCreator creator = AreaTreeCreator.getInstance();
        final AreaTree areaTree = creator.buildAreaTree("fo/vertical-001.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);

        /* The block area. */
        AreaNode node = firstNormalFlowArea.getChildAt(0);
View Full Code Here

     * @throws FOrayException For errors creating the FO Tree or Area Tree.
     */
    @Test
    public void testBlock001() throws FOrayException {
        final AreaTreeCreator creator = AreaTreeCreator.getInstance();
        final AreaTree areaTree = creator.buildAreaTree(
                "fo/block-001.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);

        /* The outer block area. */
 
View Full Code Here

     * @throws FOrayException For errors creating the FO Tree or Area Tree.
     */
    @Test
    public void testBlock002() throws FOrayException {
        final AreaTreeCreator creator = AreaTreeCreator.getInstance();
        final AreaTree areaTree = creator.buildAreaTree(
                "fo/block-002.fo");
        final PageCollection pageCollection = this.getPageCollection(areaTree,
                1);
        final int numPages = pageCollection.getChildCount();
        assertEquals(2, numPages);
View Full Code Here

     */
    @Test
    public void testBlock003() throws FOrayException, FontException {
        final AreaTreeCreator creator = AreaTreeCreator.getInstance();

        final AreaTree areaTree = creator.buildAreaTree(
                "fo/block-003.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);

        /* Test location and dimensions of the block area. */
 
View Full Code Here

     * @throws FontException For font system errors in obtaining the font.
     */
    @Test
    public void testBlock004() throws FOrayException, FontException {
        final AreaTreeCreator creator = AreaTreeCreator.getInstance();
        final AreaTree areaTree = creator.buildAreaTree(
                "fo/block-004.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);

        /* Test location and dimensions of the block area. */
 
View Full Code Here

     * @throws FOrayException For errors creating the FO Tree or Area Tree.
     */
    @Test
    public void testBorderStyle001() throws FOrayException {
        final AreaTreeCreator creator = AreaTreeCreator.getInstance();
        final AreaTree areaTree = creator.buildAreaTree(
                "fo/border-style-001.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);

        final AreaNode node = firstNormalFlowArea.getChildAt(0);
View Full Code Here

TOP

Related Classes of org.foray.area.AreaTree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.