Package org.fxmisc.richtext.TwoDimensional

Examples of org.fxmisc.richtext.TwoDimensional.Position


        assertEquals(10, pos.getMinor());
    }

    @Test
    public void testPositiveOffsetWithForwardBias() {
        Position pos = navigator.offsetToPosition(10, Forward);
        assertEquals(1, pos.getMajor());
        assertEquals(0, pos.getMinor());
    }
View Full Code Here


        assertEquals(0, pos.getMinor());
    }

    @Test
    public void testNegativeOffsetWithBackwardBias() {
        Position pos = navigator.position(4, 10);
        pos = pos.offsetBy(-10, Backward);
        assertEquals(3, pos.getMajor());
        assertEquals(10, pos.getMinor());
    }
View Full Code Here

        assertEquals(10, pos.getMinor());
    }

    @Test
    public void testNegativeOffsetWithForwardBias() {
        Position pos = navigator.position(4, 10);
        pos = pos.offsetBy(-10, Forward);
        assertEquals(4, pos.getMajor());
        assertEquals(0, pos.getMinor());
    }
View Full Code Here

        assertEquals(0, pos.getMinor());
    }

    @Test
    public void testZeroOffsetWithBackwardBias() {
        Position pos = navigator.position(3, 0);
        pos = pos.offsetBy(0, Backward);
        assertEquals(2, pos.getMajor());
        assertEquals(10, pos.getMinor());

        // additional zero backward offset should have no effect
        assertEquals(pos, pos.offsetBy(0, Backward));
    }
View Full Code Here

        assertEquals(pos, pos.offsetBy(0, Backward));
    }

    @Test
    public void testZeroOffsetWithForwardBias() {
        Position pos = navigator.position(2, 10);
        pos = pos.offsetBy(0, Forward);
        assertEquals(3, pos.getMajor());
        assertEquals(0, pos.getMinor());

        // additional zero forward offset should have no effect
        assertEquals(pos, pos.offsetBy(0, Forward));
    }
View Full Code Here

        assertEquals(pos, pos.offsetBy(0, Forward));
    }

    @Test
    public void testRightBoundary() {
        Position pos = navigator.offsetToPosition(100, Forward);
        assertEquals(4, pos.getMajor());
        assertEquals(60, pos.getMinor());

        pos = pos.clamp();
        assertEquals(4, pos.getMajor());
        assertEquals(9, pos.getMinor());
    }
View Full Code Here

        assertEquals(9, pos.getMinor());
    }

    @Test
    public void testLeftBoundary() {
        Position pos = navigator.offsetToPosition(25, Forward).offsetBy(-50, Forward);
        assertEquals(0, pos.getMajor());
        assertEquals(0, pos.getMinor());
    }
View Full Code Here

TOP

Related Classes of org.fxmisc.richtext.TwoDimensional.Position

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.