Package java.awt.font

Examples of java.awt.font.GlyphJustificationInfo


    /*
     * Test method for 'java.awt.font.GlyphJustificationInfo.GlyphJustificationInfo(float, boolean, int, float, float, boolean, int, float, float)'
     */
    public final void testGlyphJustificationInfo() {
        GlyphJustificationInfo gji = new GlyphJustificationInfo(weight, growAbsorb,
                growPriority, growLeftLimit, growRightLimit, shrinkAbsorb,
                shrinkPriority, shrinkLeftLimit, shrinkRightLimit);
       
        assertEquals("weight", weight, gji.weight, 0F);
        assertEquals("growAbsorb", growAbsorb, gji.growAbsorb);
View Full Code Here


     */
    public final void testGlyphJustificationInfo_parametersCheck() {
       
        // negative weight
        try{
            new GlyphJustificationInfo(-1, growAbsorb,
                growPriority, growLeftLimit, growRightLimit, shrinkAbsorb,
                shrinkPriority, shrinkLeftLimit, shrinkRightLimit);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            // expected
        }
       
        // growPriority illegal level value
        try{
            new GlyphJustificationInfo(weight, growAbsorb,
                5, growLeftLimit, growRightLimit, shrinkAbsorb,
                shrinkPriority, shrinkLeftLimit, shrinkRightLimit);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            // expected
        }

        try{
            new GlyphJustificationInfo(weight, growAbsorb,
                    -1, growLeftLimit, growRightLimit, shrinkAbsorb,
                    shrinkPriority, shrinkLeftLimit, shrinkRightLimit);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            // expected
        }

        // negative growLeftLimit
        try{
            new GlyphJustificationInfo(weight, growAbsorb,
                growPriority, -1, growRightLimit, shrinkAbsorb,
                shrinkPriority, shrinkLeftLimit, shrinkRightLimit);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            // expected
        }
       
        // negative growRightLimit
        try{
            new GlyphJustificationInfo(weight, growAbsorb,
                growPriority, growLeftLimit, -1, shrinkAbsorb,
                shrinkPriority, shrinkLeftLimit, shrinkRightLimit);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            // expected
        }

        // shrinkPriority illegal level value
        try{
            new GlyphJustificationInfo(weight, growAbsorb,
                growPriority, growLeftLimit, growRightLimit, shrinkAbsorb,
                5, shrinkLeftLimit, shrinkRightLimit);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            // expected
        }

        try{
            new GlyphJustificationInfo(weight, growAbsorb,
                    growPriority, growLeftLimit, growRightLimit, shrinkAbsorb,
                    -1, shrinkLeftLimit, shrinkRightLimit);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            // expected
        }

        // negative shrinkLeftLimit
        try{
            new GlyphJustificationInfo(weight, growAbsorb,
                growPriority, growLeftLimit, growRightLimit, shrinkAbsorb,
                shrinkPriority, -1, shrinkRightLimit);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            // expected
        }
       
        // negative shrinkRightLimit
        try{
            new GlyphJustificationInfo(weight, growAbsorb,
                growPriority, growLeftLimit, growRightLimit, shrinkAbsorb,
                shrinkPriority, -1, shrinkRightLimit);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            // expected
View Full Code Here

     * Test method for 'java.awt.font.GraphicAttribute.getJustificationInfo()'
     */
    public final void testGetJustificationInfo() {
        iga = new ImageGraphicAttribute(img, alignment);
        float advance = iga.getAdvance();
        GlyphJustificationInfo gji = new GlyphJustificationInfo(
                advance,
                false,
                GlyphJustificationInfo.PRIORITY_INTERCHAR,
                advance / 3,
                advance / 3,
View Full Code Here

     * Test method for 'java.awt.font.GraphicAttribute.getJustificationInfo()'
     */
    public final void testGetJustificationInfo() {
        sga = new ShapeGraphicAttribute(shape, alignment, stroke);
        float advance = sga.getAdvance();
        GlyphJustificationInfo gji = new GlyphJustificationInfo(
                advance,
                false,
                GlyphJustificationInfo.PRIORITY_INTERCHAR,
                advance / 3,
                advance / 3,
View Full Code Here

TOP

Related Classes of java.awt.font.GlyphJustificationInfo

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.