Package nextapp.echo2.app

Examples of nextapp.echo2.app.Grid


     * |__|_____|__|
     *
     * 0   1     2   (rendered column)
     */
    public void testReduceColumnSimple() {
        Grid grid = new Grid();
        grid.setSize(4);
        for (int i = 0; i < 6; ++i) {
            Label label = new Label(Integer.toString(i));
            if (i == 1 || i == 4) {
                GridLayoutData layoutData = new GridLayoutData();
                layoutData.setColumnSpan(2);
                label.setLayoutData(layoutData);
            }
            grid.add(label);
        }
        GridProcessor gridProcessor = new GridProcessor(grid);
        assertEquals(3, gridProcessor.getColumnCount());
        assertEquals(2, gridProcessor.getRowCount());
        assertEquals(0, gridProcessor.getComponentIndex(0, 0));
View Full Code Here


     * |  |     |     5        4
     * |  |     |
     * |__|_____|     6
     */
    public void testReduceRowComplex() {
        Grid grid = new Grid();
       
        // Configure Grid Content
        grid.setSize(3);
        for (int i = 0; i < 12; ++i) {
            Label label = new Label(Integer.toString(i));
            if (i == 3 || i == 4 || i == 5 || i == 6 || i == 8 || i == 10 || i == 11) {
                GridLayoutData layoutData = new GridLayoutData();
                layoutData.setRowSpan(2);
                if (i == 11) {
                    layoutData.setColumnSpan(2);
                }
                label.setLayoutData(layoutData);
            }
            grid.add(label);
        }
       
        // Set Row Sizes
        grid.setRowHeight(0, new Extent(1));
        grid.setRowHeight(1, new Extent(2));
        grid.setRowHeight(2, new Extent(4));
        grid.setRowHeight(3, new Extent(8));
        grid.setRowHeight(4, new Extent(16));
        grid.setRowHeight(5, new Extent(32));
        grid.setRowHeight(6, new Extent(64));

        GridProcessor gridProcessor = new GridProcessor(grid);
       
        // Verify Grid size is correct.
        assertEquals(3, gridProcessor.getColumnCount());
View Full Code Here

     * |__|__|
     * |4 |5 3
     * |__|__|
     */
    public void testReduceRowSimple() {
        Grid grid = new Grid();
        grid.setSize(2);
        for (int i = 0; i < 6; ++i) {
            Label label = new Label(Integer.toString(i));
            if (i == 2 || i == 3) {
                GridLayoutData layoutData = new GridLayoutData();
                layoutData.setRowSpan(2);
                label.setLayoutData(layoutData);
            }
            grid.add(label);
        }
        GridProcessor gridProcessor = new GridProcessor(grid);
        assertEquals(2, gridProcessor.getColumnCount());
        assertEquals(3, gridProcessor.getRowCount());
        assertEquals(0, gridProcessor.getComponentIndex(0, 0));
View Full Code Here

     *
     * 0   1
     * (rendered)
     */
    public void testReduceColumnAndRowSimple() {
        Grid grid = new Grid();
        grid.setSize(3);
        for (int i = 0; i < 4; ++i) {
            Label label = new Label(Integer.toString(i));
            if (i > 0) {
                GridLayoutData layoutData = new GridLayoutData();
                if (i == 1 || i == 3) {
                    layoutData.setColumnSpan(2);
                }
                if (i == 2 || i == 3) {
                    layoutData.setRowSpan(2);
                }
                label.setLayoutData(layoutData);
            }
            grid.add(label);
        }

        GridProcessor gridProcessor = new GridProcessor(grid);
       
        // Verify Grid size is correct.
View Full Code Here

     * |________|__|
     *
     *  0        1  (rendered)        
     */
    public void testReduceColumnLong() {
        Grid grid = new Grid();
        grid.setSize(4);
       
        for (int i = 0; i < 6; ++i) {
            Label label = new Label(Integer.toString(i));
            if (i % 2 == 0) {
                GridLayoutData layoutData = new GridLayoutData();
                layoutData.setColumnSpan(3);
                label.setLayoutData(layoutData);
            }
            grid.add(label);
        }

        GridProcessor gridProcessor = new GridProcessor(grid);
       
        // Verify Grid size is correct.
View Full Code Here

     * |__|__|__|   2
     * |  |  |  |
     * |__|__|__|   3      1
     */
    public void testReduceRowLong() {
        Grid grid = new Grid();
        grid.setSize(3);
       
        for (int i = 0; i < 6; ++i) {
            Label label = new Label(Integer.toString(i));
            if (i < 3) {
                GridLayoutData layoutData = new GridLayoutData();
                layoutData.setRowSpan(3);
                label.setLayoutData(layoutData);
            }
            grid.add(label);
        }
       
        GridProcessor gridProcessor = new GridProcessor(grid);
       
        // Verify Grid size is correct.
View Full Code Here

     * |        |
     * |        |  4
     * |________|
     */
    public void testReduceColumnAndRowOneBigCell() {
        Grid grid = new Grid();
        grid.setSize(3);
        Label label = new Label("0");
        GridLayoutData layoutData = new GridLayoutData();
        layoutData.setColumnSpan(3);
        layoutData.setRowSpan(5);
        label.setLayoutData(layoutData);
        grid.add(label);

        GridProcessor gridProcessor = new GridProcessor(grid);
       
        // Verify Grid size is correct.
        assertEquals(1, gridProcessor.getColumnCount());
View Full Code Here

     * |__|__|
     * |5 |6 |
     * |__|__|
     */
    public void testRowSpanSimple() {
        Grid grid = new Grid();
        for (int i = 0; i < 7; ++i) {
            Label label = new Label(Integer.toString(i));
            if (i == 2) {
                GridLayoutData layoutData = new GridLayoutData();
                layoutData.setRowSpan(2);
                label.setLayoutData(layoutData);
            }
            grid.add(label);
        }
       
        GridProcessor gridProcessor = new GridProcessor(grid);
       
        // Verify Grid size is correct.
View Full Code Here

     * |__|__|
     * |8 |9 |
     * |__|__|
     */
    public void testSimple() {
        Grid grid = new Grid();
        for (int i = 0; i < 10; ++i) {
            grid.add(new Label("test"));
        }

        GridProcessor gridProcessor = new GridProcessor(grid);
       
        // Verify Grid size is correct.
View Full Code Here

     * |__|__|
     * |9 |XX|
     * |__|XX|
     */
    public void testSimpleWithColumnSpan() {
        Grid grid = new Grid();
        for (int i = 0; i < 10; ++i) {
            Label label = new Label();
            if (i == 4) {
                GridLayoutData layoutData = new GridLayoutData();
                layoutData.setColumnSpan(2);
                label.setLayoutData(layoutData);
            }
            grid.add(label);
        }
       
        GridProcessor gridProcessor = new GridProcessor(grid);
       
        // Verify Grid size is correct.
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Grid

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.