question: public void addLayer ( Layer layer , int position ) { List < Layer > currentLayers = getLayerList ( ) ; currentLayers . remove ( layer ) ; if ( position > allLayers . size ( ) ) { currentLayers . add ( layer ) ; } else { if ( position < 0 ) { position = 0 ; } currentLayers . add ( position , layer ) ; } if ( propertyHandler != null ) { String pre = layer . getPropertyPrefix ( ) ; if ( pre != null && pre . length ( ) > 0 ) { propertyHandler . addUsedPrefix ( pre ) ; } } setLayerList ( currentLayers ) ; BeanContext bc = getBeanContext ( ) ; if ( bc != null && layer . getAddToBeanContext ( ) && layer . getBeanContext ( ) == null ) { bc . add ( layer ) ; } }
target:  Add a layer to a certain position in the layer array. If the position is 0 or less, the layer is put up front (on top). If the position is greater than the length of the current array, the layer is put at the end, (on the bottom). A Layer can only be added once. If you add a layer that is already added to the LayerHandler, it will be moved to the requested position.