u.p("TableLayout2.calculateBoxes(" + avail_width  + " , " + box + " , " + c + " , " + table);
    public void calculateBoxes( int avail_width, TableBox box, Context c, Table table ) {        u.p("TableLayout2.calculateBoxes(" + avail_width  +            " , " + box + " , " + c + " , " + table);        box.width = avail_width;        box.height = 100;        box.x = 5;        box.y = 5;        // create a dummy prev row        RowBox prev_row = new RowBox( 0, 0, 0, 0 );        int max_width = 0;        // loop throw the rows        CellGrid grid = table.getCellGrid();        for ( int y = 0; y < grid.getHeight(); y++ ) {            // create a new row box for this row            RowBox row_box = new RowBox( 0, 0, 0, 0 );            //row_box.node = row.node;            box.rows.add( row_box );            int row_height = 0;            int column_count = 0;            // loop through the cells            for ( int x = 0; x < grid.getWidth(); x++ ) {                //u.p("x = " + x);                //u.p("grid width = " + grid.getWidth());                if ( grid.isReal( x, y ) ) {                    //u.p("it's real");                    //u.p("getting real cell: " + x + " , " + y);                    Cell cell = grid.getCell( x, y );                    if ( cell == null ) {                        System.err.println( "Hit the null cell error in " + this.getClass().getName() );                        continue;                    }                    // create a new cell box for this cell                    CellBox cell_box = new CellBox( 0, 0, 10, 10 );                    cell.cb = cell_box;                    cell_box.rb = row_box;                    // set the x coord based on the current column                    cell_box.x = table.calcColumnX( column_count );                    // set the width                    //u.p("column count = " + column_count + " col span = " + cell.col_span);                    cell_box.width = table.calcColumnWidth( column_count, cell.col_span );                    cell_box.node = cell.node;                    // do the internal layout                    // save the old extents and create new with smaller width                    Rectangle oe = c.getExtents();                    c.setExtents( new Rectangle( c.getExtents().x, c.getExtents().y,                            cell_box.width, 100 ) );                    // do child layout                    Layout layout = c.getLayout( cell.node );                    //u.p("cell box = " + cell_box);                    //u.p("doing child layout on: " + layout + " for " + cell_box.node);                    //u.p("cell_box properly = " + cell_box);                    c.setSubBlock( true );                    Box cell_contents = layout.layout( c, (Element)cell_box.node );                    c.setSubBlock( false );                    cell_box.sub_box = cell_contents;                    cell_box.height = cell_box.sub_box.height;                    column_count += cell.col_span;                    //u.p("cellbox = " + cell_box);                    //u.p("sub box = " + cell_box.sub_box);                    // restore old extents                    c.setExtents( oe );                    // y is relative to the rowbox so it's just 0                    cell_box.y = 0;                    // add the cell to the row                    row_box.cells.add( cell_box );                    //u.p("cell box width = " + cell_box.width);                    // if this is a non row spanning cell then                    // adjust the row height to fit this cell                    if ( cell.row_span == 1 ) {                        if ( cell_box.height > row_box.height ) {                            row_box.height = cell_box.height;                        }                    }                    row_box.width += cell_box.width;                } else {                    //u.p("it's virtual");                    Cell cell = grid.getCell( x, y );                    // create a virtual cell box for this cell                    CellBox cell_box = CellBox.createVirtual( cell.cb );                    // skip doing layout                    row_box.cells.add( cell_box );                    // skip adjusting the row height for now                    // set row height based on real cell contents                    // set row width based on real cell contents                }                //u.p("looping");            }            //u.p("loop done");            // move the row to the right y position            row_height = 0;            row_box.y = prev_row.y + prev_row.height;            prev_row = row_box;            // adjust the max width            if ( row_box.width > max_width ) {                max_width = row_box.width;            }            // adjust the height of each cell in this row to be the height of            // the row            for ( int k = 0; k < row_box.cells.size(); k++ ) {                CellBox cb = (CellBox)row_box.cells.get( k );                if ( cb.isReal() ) {                    cb.height = row_box.height;                    cb.sub_box.height = row_box.height;                } else {                    // adjusting height based on virtual                    //u.p("adjusting height based on virtual");                    CellBox real = cb.getReal();                    //u.p("the real cb = " + real);                    RowBox orig_row = real.rb;                    //u.p("orig row = " + orig_row);                    RowBox cur_row = row_box;                    //u.p("cur row = " + cur_row);                    real.height = cur_row.y - orig_row.y + cur_row.height;                    real.sub_box.height = real.height;                    //u.p("now real = " + real);                }                //u.p("cell = " + cb);            }        }        box.height = prev_row.y + prev_row.height;        box.width = max_width;        //return box;    }