public void normalizeIndentation ( ) { float max = 0 ; Element o ; for ( Iterator i = list . iterator ( ) ; i . hasNext ( ) ; ) { o = ( Element ) i . next ( ) ; if ( o instanceof ListItem ) { max = Math . max ( max , ( ( ListItem ) o ) . getIndentationLeft ( ) ) ; } } for ( Iterator i = list . iterator ( ) ; i . hasNext ( ) ; ) { o = ( Element ) i . next ( ) ; if ( o instanceof ListItem ) { ( ( ListItem ) o ) . setIndentationLeft ( max ) ; } } }
Makes sure all the items in the list have the same indentation .