Package org.foray.area

Examples of org.foray.area.InlineArea


        assertEquals("Lighter(1), ", textArea1.getText().toString());

        /* The second child of the line area is the outside inline area. */
        node = lineArea.getChildAt(1);
        assertTrue(node instanceof InlineArea);
        final InlineArea inlineArea1 = (InlineArea) node;
        assertEquals(3, inlineArea1.getChildCount());

        /* The first child of the outside inline area is a text area. */
        node = inlineArea1.getChildAt(0);
        assertTrue(node instanceof TextArea);
        final TextArea textArea2 = (TextArea) node;
        assertEquals("Bolder(1), ", textArea2.getText().toString());

        /* The second child of the outside inline area is the inside inline area. */
        node = inlineArea1.getChildAt(1);
        assertTrue(node instanceof InlineArea);
        final InlineArea inlineArea2 = (InlineArea) node;
        assertEquals(1, inlineArea2.getChildCount());

        /* The first and only child of the inside inline area is a text area. */
        node = inlineArea2.getChildAt(0);
        assertTrue(node instanceof TextArea);
        final TextArea textArea3 = (TextArea) node;
        final String textArea3Text = textArea3.getText().toString();
        assertEquals("Lighter(2), ", textArea3Text);

View Full Code Here


        final int lineY = lineArea.alignmentPointY();

        /* The second child of the line area is an inline-area. */
        node = lineArea.getChildAt(1);
        assertTrue(node instanceof InlineArea);
        final InlineArea inlineArea = (InlineArea) node;
        final int inlineY = inlineArea.baselineY();

        /* The current algorithm for computing the "super" baseline shift for the Base14-Courier
         * font is 2/3 of the font's ascender, which, per the AFM file is 629. */
        final int adjustment = Math.round(629 * 12 * 2 / 3);
        final int expectedInlineY = lineY + adjustment;
        assertEquals(expectedInlineY, inlineY);

        /* The first child of the inline-area is a text area. */
        node = inlineArea.getChildAt(0);
        assertTrue(node instanceof TextArea);
        final TextArea textArea = (TextArea) node;
        final int inlineYTextArea = textArea.baselineY();
        assertEquals(expectedInlineY, inlineYTextArea);
    }
View Full Code Here

TOP

Related Classes of org.foray.area.InlineArea

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.