Package org.foray.fotree.fo.obj

Examples of org.foray.fotree.fo.obj.Flow


     */
    public void testFontFamily001() throws FOrayException {
        final FoDocumentReader reader = FoDocumentReader.getInstance();
        final FOTreeBuilder foTree = reader.buildFoTree(
                "fo/font-family-001.fo");
        final Flow flow = this.getFlow(foTree);

        FObj node = flow.getChildAt(0);
        assertTrue(node instanceof Block);
        Block block = (Block) node;
        String[] fontFamilies = block.traitFontFamily(null);
        assertEquals(1, fontFamilies.length);
        /* The default font-family is "serif". */
        assertEquals("serif", fontFamilies[0]);

        node = flow.getChildAt(1);
        assertTrue(node instanceof Block);
        block = (Block) node;
        fontFamilies = block.traitFontFamily(null);
        assertEquals(1, fontFamilies.length);
        assertEquals("Base14-Courier", fontFamilies[0]);
View Full Code Here


     * @throws FOrayException For errors creating the FO Tree.
     */
    public void testFontSize001() throws FOrayException {
        final FoDocumentReader reader = FoDocumentReader.getInstance();
        final FOTreeBuilder foTree = reader.buildFoTree("fo/font-size-001.fo");
        final Flow flow = this.getFlow(foTree);

        FObj node = flow.getChildAt(0);
        assertTrue(node instanceof Block);
        Block block = (Block) node;
        int fontSize = block.traitFontSize(null);
        /* The default font size is 12 points. */
        assertEquals(12000, fontSize);

        node = flow.getChildAt(1);
        assertTrue(node instanceof Block);
        block = (Block) node;
        fontSize = block.traitFontSize(null);
        assertEquals(8000, fontSize);

        node = flow.getChildAt(2);
        assertTrue(node instanceof Block);
        block = (Block) node;
        final Font font = node.getPrimaryFont(null).getFont();
        assertEquals("Courier", font.getFamilyName());
        assertEquals(426, font.getXHeight(1000));
View Full Code Here

        FObj node = root.getChildAt(1);
        assertTrue(node instanceof PageSequence);
        final PageSequence sequence = (PageSequence) node;
        node = sequence.getChildAt(0);
        assertTrue(node instanceof Flow);
        final Flow flow = (Flow) node;
        return flow;
    }
View Full Code Here

     */
    public void testGraphic001() throws FOrayException {
        final FoDocumentReader reader = FoDocumentReader.getInstance();
        final FOTreeBuilder foTree = reader.buildFoTree(
                "fo/graphic-001.fo");
        final Flow flow = this.getFlow(foTree);

        /* The second child should be a block ... */
        FObj node = flow.getChildAt(1);
        assertTrue(node instanceof Block);
        final Block block = (Block) node;

        /* ... which contains an InstreamForeignObject ... */
        node = block.getChildAt(0);
View Full Code Here

            return new Float(parent, propertyList);
        }
        case FLOW: {
            final PageSequence pageSequence = parentPageSequence(enumeration,
                    parent, locator);
            return new Flow(pageSequence, propertyList);
        }
        case FLOW_ASSIGNMENT: {
            final FlowMap flowMap = parentFlowMap(enumeration, parent, locator);
            return new FlowAssignment(flowMap, propertyList);
        }
View Full Code Here

TOP

Related Classes of org.foray.fotree.fo.obj.Flow

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.