public Rectangle getContainingBlock ( ) { if ( cbox instanceof Viewport ) //initial containing block { Rectangle visible = ( ( Viewport ) cbox ) . getVisibleRect ( ) ; return new Rectangle ( 0 , 0 , visible . width , visible . height ) ; } else //static or relative position return cbox . getContentBounds ( ) ; }
Obtains the containing block bounds .