question: protected void rebuildListModel ( ) { DefaultListModel dlm = ( DefaultListModel ) getListModel ( ) ; OMGraphicList list = getList ( ) ; int [ ] selectedIndicies = null ; if ( list != null ) { if ( selectedTiles != null && selectedTiles . length > 0 ) { selectedIndicies = new int [ selectedTiles . length ] ; } int tileCount = 0 ; int selectedIndex = 0 ; if ( selectedIndicies != null ) { for ( OMGraphic omg : list ) { ImageTile imageTile = ( ImageTile ) omg ; if ( imageTile . isSelected ( ) && selectedIndex < selectedIndicies . length ) { selectedIndicies [ selectedIndex ++ ] = tileCount ; } tileCount ++ ; } } dlm . clear ( ) ; for ( OMGraphic omg : list ) { tileCount ++ ; dlm . addElement ( omg ) ; } } if ( resultsList != null ) { if ( selectedIndicies != null ) { resultsList . setSelectedIndices ( selectedIndicies ) ; } resultsList . repaint ( ) ; } }
target:  Rebuild the list model contents based on the ImageTiles contained on the OMGraphicList.