Package org.eclipse.nebula.widgets.nattable.test.fixture.layer

Examples of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ViewportLayerFixture


        this.viewportLayer.getClientAreaProvider().getClientArea().height = 100;
    }

    @Test
    public void testMoveColumnPositionIntoViewportSimpleCase() {
        this.viewportLayer = new ViewportLayerFixture();
        assertEquals(0, this.viewportLayer.getColumnIndexByPosition(0));
        assertEquals(1, this.viewportLayer.getColumnIndexByPosition(1));
        assertEquals(2, this.viewportLayer.getColumnIndexByPosition(2));

        this.viewportLayer.moveColumnPositionIntoViewport(3);
View Full Code Here


        assertEquals(0, this.viewportLayer.getColumnIndexByPosition(0));
    }

    @Test
    public void testMoveColumnPositionIntoViewportForAColumnAlreadyInTheViewport() {
        this.viewportLayer = new ViewportLayerFixture(new Rectangle(0, 0, 285, 100));
        this.viewportLayer.moveColumnPositionIntoViewport(2);
        assertEquals(0, this.viewportLayer.getColumnIndexByPosition(0));
        assertEquals(1, this.viewportLayer.getColumnIndexByPosition(1));
        assertEquals(2, this.viewportLayer.getColumnIndexByPosition(2));
    }
View Full Code Here

    @Test
    public void moveColumnIntoViewportByMovingLeftAndRight() throws Exception {
        // width of each column = 80
        // total width = 800
        // client area width = 200 = 80 + 80 + 40
        this.viewportLayer = new ViewportLayerFixture(10, 5, 80, 40);
        assertEquals(200, this.viewportLayer.getClientAreaWidth());
        assertEquals(3, this.viewportLayer.getColumnCount());

        this.viewportLayer.setOriginX(600);
        assertEquals(3, this.viewportLayer.getColumnCount());
View Full Code Here

    /**
     * Rows 0 1 2 3 4 |----|----|----|----|----|
     */
    @Test
    public void moveRowIntoViewportByMovingUpAndDown() throws Exception {
        this.viewportLayer = new ViewportLayerFixture(10, 5, 80, 80);
        assertEquals(100, this.viewportLayer.getClientAreaHeight());
        assertEquals(3, this.viewportLayer.getColumnCount());

        this.viewportLayer.setOriginY(this.viewportLayer.getStartYOfRowPosition(3));
        assertEquals(3, this.viewportLayer.getRowIndexByPosition(0));
View Full Code Here

    }

    @Test
    public void moveIntoViewportForAColPartiallyDisplayedAtTheRightEdge()
            throws Exception {
        this.viewportLayer = new ViewportLayerFixture(new Rectangle(0, 0, 260, 100));
        assertEquals(0, this.viewportLayer.getColumnIndexByPosition(0));
        assertEquals(1, this.viewportLayer.getColumnIndexByPosition(1));
        assertEquals(2, this.viewportLayer.getColumnIndexByPosition(2)); // Partially
        // visible
View Full Code Here

    /**
     * 0 1 2 3 4 5 6 7 8 9 |----|----|----|----|----|----|----|----|----|----|
     */
    @Test
    public void getColumnIndexByPosition() {
        this.viewportLayer = new ViewportLayerFixture(10, 5, 80, 40);

        assertEquals(3, this.viewportLayer.getColumnCount());
        assertEquals(0, this.viewportLayer.getColumnIndexByPosition(0));
        assertEquals(1, this.viewportLayer.getColumnIndexByPosition(1));
        assertEquals(2, this.viewportLayer.getColumnIndexByPosition(2));
View Full Code Here

        assertTrue(event instanceof IVisualChangeEvent);
    }

    @Test
    public void setViewportMinOriginColumnPosition() throws Exception {
        this.viewportLayer = new ViewportLayerFixture(10, 20, 50, 20);

        this.viewportLayer.setMinimumOriginX(100);
        assertEquals(2, this.viewportLayer.getMinimumOriginColumnPosition());
        assertEquals(100, this.viewportLayer.getOrigin().getX());
        assertEquals(2, this.viewportLayer.getColumnIndexByPosition(0));
View Full Code Here

        assertTrue(event instanceof IVisualChangeEvent);
    }

    @Test
    public void setViewportMinOriginRowPosition() throws Exception {
        this.viewportLayer = new ViewportLayerFixture(10, 20, 50, 20);

        this.viewportLayer.setMinimumOriginY(40);
        assertEquals(2, this.viewportLayer.getMinimumOriginRowPosition());
        assertEquals(40, this.viewportLayer.getOrigin().getY());
        assertEquals(2, this.viewportLayer.getRowIndexByPosition(0));
View Full Code Here

        assertEquals(2, command.getStepSize().intValue());
    }

    @Test
    public void adjustRowOrigin() throws Exception {
        this.viewportLayer = new ViewportLayerFixture(10, 20, 100, 20);
        // Default client area: width 200, height 100
        assertEquals(5, this.viewportLayer.getRowCount());

        assertEquals(200, this.viewportLayer.getStartYOfRowPosition(10));
        assertEquals(200, this.viewportLayer.adjustOriginY(this.viewportLayer
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ViewportLayerFixture

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.