public int getMaxYForOwner ( BlockBox owner , boolean requireVisible ) { int maxy = 0 ; for ( int i = 0 ; i < size ( ) ; i ++ ) { Box box = getBox ( i ) ; if ( ( ! requireVisible || box . isDeclaredVisible ( ) ) && box . getContainingBlockBox ( ) == owner ) { int ny = box . bounds . y + box . bounds . height ; //TODO: -1 here? if ( ny > maxy ) maxy = ny ; } } return maxy ; }
Goes through all the boxes and computes the Y coordinate of the bottom edge of the lowest box . Only the boxes with the owner containing block are taken into account .