LinkedList backgroundPanes = new LinkedList();
// populate the arrays of CheckBoxes and strings used to fill
// the JPanel for the panes
for (int i = 0; i < layers.length; i++) {
Layer layer = layers[i];
if (layer == null) {
Debug.output("LayersPanel caught null layer, " + i + " out of "
+ layers.length);
continue;
}
LayerPane lpane = (LayerPane) paneLookUp.get(layer);
if (lpane == null) {
if (Debug.debugging("layercontrol")) {
Debug.output("LayersPanel: Creating LayerPane for "
+ layer.getName());
}
lpane = createLayerPaneForLayer(layer, layerHandler, bg);
lpane.addPropertyChangeListener(LayerSelectedCmd, this);
lpane.addPropertyChangeListener(LayerDeselectedCmd, this);
paneLookUp.put(layer, lpane);
} else {
// In case this has been modified elsewhere...
lpane.setLayerOn(layer.isVisible());
}
if (layer.getAddAsBackground() && backgroundLayerSeparator != null) {
backgroundPanes.add(lpane);
} else {
panes.add(lpane);
gridbag.setConstraints(lpane, c);