public int getLayerIndex ( String name ) { int idx = 0 ; for ( int i = 0 ; i < layers . size ( ) ; i ++ ) { Layer layer = ( Layer ) layers . get ( i ) ; if ( layer . name . equals ( name ) ) { return i ; } } return - 1 ; }
Get the index of the layer with given name