protected void ensureRowsAreVisible(int beginRow,int endRow){
  if (tree != null && beginRow >= 0 && endRow < getRowCount(tree)) {
    boolean scrollVert=DefaultLookup.getBoolean(tree,this,"Tree.scrollsHorizontallyAndVertically",false);
    if (beginRow == endRow) {
      Rectangle scrollBounds=getPathBounds(tree,getPathForRow(tree,beginRow));
      if (scrollBounds != null) {
        if (!scrollVert) {
          scrollBounds.x=tree.getVisibleRect().x;
          scrollBounds.width=1;
        }
        tree.scrollRectToVisible(scrollBounds);
      }
    }
 else {
      Rectangle beginRect=getPathBounds(tree,getPathForRow(tree,beginRow));
      if (beginRect != null) {
        Rectangle visRect=tree.getVisibleRect();
        Rectangle testRect=beginRect;
        int beginY=beginRect.y;
        int maxY=beginY + visRect.height;
        for (int counter=beginRow + 1; counter <= endRow; counter++) {
          testRect=getPathBounds(tree,getPathForRow(tree,counter));
          if (testRect == null) {
            return;
          }
          if ((testRect.y + testRect.height) > maxY)           counter=endRow;
        }
        tree.scrollRectToVisible(new Rectangle(visRect.x,beginY,1,testRect.y + testRect.height - beginY));
      }
    }
  }
}

protected void ensureRowsAreVisible ( int beginRow , int endRow ) { if ( tree != null && beginRow >= 0 && endRow < getRowCount ( tree ) ) { boolean scrollVert = DefaultLookup . getBoolean ( tree , this , "Tree.scrollsHorizontallyAndVertically" , false ) ; if ( beginRow == endRow ) { Rectangle scrollBounds = getPathBounds ( tree , getPathForRow ( tree , beginRow ) ) ; if ( scrollBounds != null ) { if ( ! scrollVert ) { scrollBounds . x = tree . getVisibleRect ( ) . x ; scrollBounds . width = 1 ; } tree . scrollRectToVisible ( scrollBounds ) ; } } else { Rectangle beginRect = getPathBounds ( tree , getPathForRow ( tree , beginRow ) ) ; if ( beginRect != null ) { Rectangle visRect = tree . getVisibleRect ( ) ; Rectangle testRect = beginRect ; int beginY = beginRect . y ; int maxY = beginY + visRect . height ; for ( int counter = beginRow + 1 ; counter <= endRow ; counter ++ ) { testRect = getPathBounds ( tree , getPathForRow ( tree , counter ) ) ; if ( testRect == null ) { return ; } if ( ( testRect . y + testRect . height ) > maxY ) counter = endRow ; } tree . scrollRectToVisible ( new Rectangle ( visRect . x , beginY , 1 , testRect . y + testRect . height - beginY ) ) ; } } } }
ensures that the rows identified by beginrow through endrow are visible .
