private void findStandaloneAreas ( Box boxroot , Area arearoot ) { if ( boxroot . isVisible ( ) ) { for ( int i = 0 ; i < boxroot . getChildCount ( ) ; i ++ ) { Box child = boxroot . getChildAt ( i ) ; if ( child . isVisible ( ) ) { if ( isVisuallySeparated ( child ) ) { Area newnode = new AreaImpl ( child ) ; if ( newnode . getWidth ( ) > 1 || newnode . getHeight ( ) > 1 ) { findStandaloneAreas ( child , newnode ) ; arearoot . appendChild ( newnode ) ; } } else findStandaloneAreas ( child , arearoot ) ; } } } }
Goes through a box tree and tries to identify the boxes that form standalone visual areas . From these boxes new areas are created which are added to the area tree . Other boxes are ignored .