package mil.nga.mapcache.wizards.createtile;

import java.util.Observable;

/**
 * The model that contains all the possible layers from a given server.
 */
public class LayersModel extends Observable {

    /**
     * The layers property.
     */
    public static String LAYERS_PROP = "layers";

    /**
     * The selected layer.
     */
    public static String SELECTED_LAYER_PROP = "selectedLayers";

    /**
     * The available layers from a server.
     */
    private LayerModel[] layers;

    /**
     * The selected layer.
     */
    private LayerModel selectedLayer;

    /**
     * Gets the available layers from a server.
     *
     * @return The available layers from a server.
     */
    public LayerModel[] getLayers() {
        return layers;
    }

    /**
     * Sets the available layers from a server.
     *
     * @param layers The available layers.
     */
    public void setLayers(LayerModel[] layers) {
        this.layers = layers;
        setChanged();
        notifyObservers(LAYERS_PROP);
    }

    /**
     * Gets the selected layer.
     *
     * @return The selected layer.
     */
    public LayerModel getSelectedLayer() {
        return selectedLayer;
    }

    /**
     * Sets the selected layer.
     *
     * @param selectedLayer The selected layer.
     */
    public void setSelectedLayer(LayerModel selectedLayer) {
        this.selectedLayer = selectedLayer;
        setChanged();
        notifyObservers(SELECTED_LAYER_PROP);
    }
}

@@ -391,32 +391,248 @@
 lectedLayers%22;%0A%0A
+    /**%0A     * The image formats property.%0A     */%0A    public static String IMAGE_FORMATS_PROP = %22imageFormats%22;%0A%0A    /**%0A     * The available image formats for the tiles.%0A     */%0A    private String%5B%5D imageFormats;%0A%0A
     /**%0A     * T
@@ -1691,11 +1691,530 @@
 );%0A    %7D
+%0A%0A    /**%0A     * Gets the available image formats for the layers tiles.%0A     *%0A     * @return The available image formats.%0A     */%0A    public String%5B%5D getImageFormats() %7B%0A        return imageFormats;%0A    %7D%0A%0A    /**%0A     * Sets the available image formats for the layers tiles.%0A     *%0A     * @param imageFormats The availabel image formats.%0A     */%0A    public void setImageFormats(String%5B%5D imageFormats) %7B%0A        this.imageFormats = imageFormats;%0A        setChanged();%0A        notifyObservers(IMAGE_FORMATS_PROP);%0A    %7D
 %0A%7D%0A

Add image formats to model