Package palmed.edit.util

Examples of palmed.edit.util.Coordinate


    public void testWritePartOnSingleLineOfText() throws IOException
    {
        text.read( createInputStreamStub( "this is my string" ) );
        reset();
        text.write( outputStreamStub, new Coordinate( 2, 0 ), new Coordinate( 12, 0 ) );
        assertArrayEquals( "is is my s".getBytes(), outputStreamStub.toByteArray() );
    }
View Full Code Here


    public void testWritePartOnMultipleLinesOfText() throws IOException
    {
        text.read( createInputStreamStub( "\n\nthis \n\nis a test\n\n" ) );
        reset();
        text.write( outputStreamStub, new Coordinate( 1, 2 ), new Coordinate( 2, 4 ) );
        assertArrayEquals( "his \n\nis".getBytes(), outputStreamStub.toByteArray() );
    }
View Full Code Here

    public void testReadPartOnSingleLineOfText() throws IOException
    {
        text.read( createInputStreamStub( "thtring" ) );
        reset();
        text.read( createInputStreamStub( "is is my s" ), new Coordinate( 2, 0 ) );
        reset();
        mockView.modified( false );
        replay();
        text.write( outputStreamStub );
        assertArrayEquals( "this is my string".getBytes(), outputStreamStub.toByteArray() );
View Full Code Here

        content.scroll( 3, 2 );
    }

    public void testScrollUpperLeftOutsideViewIsTruncated()
    {
        mockView.update( new Coordinate( 0, 0 ) );
        mockView.update( 12, 10 );
        mockScrollView.scrolled( new Coordinate( 0, 0 ) );
        replay();
        content.scroll( -3, -2 );
    }
View Full Code Here

        content.scroll( -3, -2 );
    }

    public void testScrollLowerRightOutsideViewIsTruncated()
    {
        mockView.update( new Coordinate( -7, -4 ) );
        mockView.update( 12, 10 );
        mockScrollView.scrolled( new Coordinate( 7, 4 ) );
        replay();
        content.scroll( 15, 15 );
    }
View Full Code Here

    public void testReadPartOnMultipleLinesOfText() throws IOException
    {
        text.read( createInputStreamStub( "\n\nt a test\n\n" ) );
        reset();
        text.read( createInputStreamStub( "his \n\nis" ), new Coordinate( 1, 2 ) );
        reset();
        mockView.modified( false );
        replay();
        text.write( outputStreamStub );
        assertArrayEquals( "\n\nthis \n\nis a test\n\n".getBytes(), outputStreamStub.toByteArray() );
View Full Code Here

        content.scroll( 15, 15 );
    }

    public void testSetCursorOutsideViewAndTypeKeyMovesViewToShowCursor()
    {
        content.update( new Coordinate( 7, 7 ) );
        reset();
        final int keyCode = 12;
        mockContent.type( keyCode );
        mockView.update( new Coordinate( 5, 5 ) );
        mockView.update( 12, 10 );
        mockScrollView.scrolled( new Coordinate( 2, 2 ) );
        replay();
        content.type( keyCode );
    }
View Full Code Here

    {
        content.scroll( 7, 8 );
        reset();
        final int keyCode = 12;
        mockContent.type( keyCode );
        mockView.update( new Coordinate( 0, 0 ) );
        mockView.update( 12, 10 );
        mockScrollView.scrolled( new Coordinate( 0, 0 ) );
        replay();
        content.type( keyCode );
    }
View Full Code Here

    public void testInsertCharacterInNewText()
    {
        mockView.update( 1, 1 );
        mockView.modified( true );
        replay();
        text.insert( new Coordinate( 0, 0 ), '*' );
        assertEquals( "*", text.getLine( 0 ) );
    }
View Full Code Here

        mockView.modified( false );
        reset();
        mockView.update( string.length() + 1, 1 );
        mockView.modified( true );
        replay();
        text.insert( new Coordinate( 7, 0 ), '*' );
        assertEquals( "this is* my string", text.getLine( 0 ) );
    }
View Full Code Here

TOP

Related Classes of palmed.edit.util.Coordinate

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.