Package org.foray.area

Examples of org.foray.area.AreaNode


        final PageCollection pageCollection = getPageCollection(areaTree, 1);
        final PageRA firstPage = getPage(pageCollection, 1);
        final RegionRABody regionBody = firstPage.getRegionBody(
                "xsl-region-body");
        final MainRA main = regionBody.getMainRefArea();
        AreaNode node = main.getChildAt(0);
        assertTrue(node instanceof SpanRA);
        final SpanRA span = (SpanRA) node;
        node = span.getChildAt(0);
        assertTrue(node instanceof NormalFlowRA);
        final NormalFlowRA nfa = (NormalFlowRA) node;
View Full Code Here


     * etc.
     * @return The requested page collection, or null if it does not exist.
     */
    protected PageCollection getPageCollection(final AreaTree areaTree,
            final int collectionNum) {
        final AreaNode node = areaTree.getChildAt(0);
        assertTrue(node instanceof PageCollection);
        final PageCollection pageCollection = (PageCollection) node;
        return pageCollection;
    }
View Full Code Here

        assertNotNull(pageCollection);
        /* Convert the ordinal page number to an index into the children. */
        final int index = pageNum - 1;
        assertTrue(index >= 0);
        assertTrue(index < pageCollection.getChildCount());
        final AreaNode node = pageCollection.getChildAt(index);
        assertTrue(node instanceof PageRA);
        final PageRA page = (PageRA) node;
        return page;
    }
View Full Code Here

        /* There are two block areas. */
        assertEquals(2, firstNormalFlowArea.getChildCount());

        /* The second one contains the graphic. */
        AreaNode node = firstNormalFlowArea.getChildAt(1);
        assertTrue(node instanceof NormalBlockArea);

        /* It has one child, a LineArea ... */
        assertEquals(1, node.getChildCount());
        node = node.getChildAt(0);
        assertTrue(node instanceof LineArea);

        /* ... which has one child, an ExternalGraphicArea. */
        assertEquals(1, node.getChildCount());
        node = node.getChildAt(0);
        assertTrue(node instanceof ExternalGraphicArea);

        /* First test the size of the viewport. */
        final ExternalGraphicArea ega = (ExternalGraphicArea) node;
        final int width = ega.crIpd();
View Full Code Here

        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);
        assertEquals(1, firstNormalFlowArea.getChildCount());

        /* The block area. */
        AreaNode node = firstNormalFlowArea.getChildAt(0);
        assertTrue(node instanceof NormalBlockArea);
        final NormalBlockArea blockArea = (NormalBlockArea) node;
        assertEquals(1, blockArea.getChildCount());

        /* The only child of the block area is a line area. */
 
View Full Code Here

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

        /* The block area. */
        AreaNode node = firstNormalFlowArea.getChildAt(0);
        assertTrue(node instanceof NormalBlockArea);
        final NormalBlockArea blockArea = (NormalBlockArea) node;
        final FontUse font = blockArea.getPrimaryFont();
        assertEquals("Courier", font.getFont().getPostscriptName());
        assertEquals(12000, blockArea.traitFontSize());
View Full Code Here

                "fo/block-001.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);

        /* The outer block area. */
        AreaNode node = firstNormalFlowArea.getChildAt(0);
        assertTrue(node instanceof NormalBlockArea);
        final NormalBlockArea outerBlockArea = (NormalBlockArea) node;
        /* 1 inch left margin. */
        assertEquals(72000, outerBlockArea.crOriginX());
        /* 10 inches from bottom (11 inches high, 1 inch top margin). */
 
View Full Code Here

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

        /* Test location and dimensions of the block area. */
        AreaNode node = firstNormalFlowArea.getChildAt(0);
        assertTrue(node instanceof NormalBlockArea);
        final NormalBlockArea blockArea = (NormalBlockArea) node;
        /* 1 inch left margin. */
        assertEquals(72000, blockArea.crOriginX());
        /* 10 inches from bottom (11 inches high, 1 inch top margin). */
 
View Full Code Here

                "fo/block-004.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);

        /* Test location and dimensions of the block area. */
        AreaNode node = firstNormalFlowArea.getChildAt(0);
        assertTrue(node instanceof NormalBlockArea);
        final NormalBlockArea blockArea = (NormalBlockArea) node;
        /* 1 inch left margin. */
        assertEquals(72000, blockArea.crOriginX());
        /* 10 inches from bottom (11 inches high, 1 inch top margin). */
 
View Full Code Here

        final AreaTree areaTree = creator.buildAreaTree(
                "fo/border-style-001.fo");
        final NormalFlowRA firstNormalFlowArea = this.getFirstNormalFlowArea(
                areaTree);

        final AreaNode node = firstNormalFlowArea.getChildAt(0);
        assertTrue(node instanceof NormalBlockArea);
        final NormalBlockArea blockArea = (NormalBlockArea) node;
        assertEquals(72000, blockArea.brOriginX());
        assertEquals(720000, blockArea.brOriginY());
        assertEquals(432000, blockArea.brIpd());
View Full Code Here

TOP

Related Classes of org.foray.area.AreaNode

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.