public void addLayer(Layer layer){
  if (allLayers == null) {
    addLayer(layer,0);
    return;
  }
  if (!allLayers.contains(layer)) {
    allLayers.add(layer);
  }
}

public void addLayer ( Layer layer ) { if ( allLayers == null ) { addLayer ( layer , 0 ) ; return ; } if ( ! allLayers . contains ( layer ) ) { allLayers . add ( layer ) ; } }
add a layer to the bottom of the layer stack . if the layer is already part of the layer stack , nothing is done .
