Index: WMTSParamsPanel.java
===================================================================
--- WMTSParamsPanel.java	(revision 2612)
+++ WMTSParamsPanel.java	(revision 2613)
@@ -52,7 +52,6 @@
 import javax.swing.event.TreeSelectionListener;
 import javax.swing.tree.TreePath;
 
-import org.gvsig.andami.PluginServices;
 import org.gvsig.fmap.dal.DataParameters;
 import org.gvsig.fmap.dal.DataStoreParameters;
 import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
@@ -63,10 +62,12 @@
 import org.gvsig.gui.beans.listeners.BeanListener;
 import org.gvsig.raster.wmts.io.WMTSDataParameters;
 import org.gvsig.raster.wmts.io.WMTSServerExplorer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSDimension;
 import org.gvsig.raster.wmts.ogc.struct.WMTSStyle;
 import org.gvsig.raster.wmts.ogc.struct.WMTSTheme;
 import org.gvsig.raster.wmts.swing.WMTSWizardListener;
 import org.gvsig.raster.wmts.swing.WmtsGUI;
+import org.gvsig.raster.wmts.swing.impl.panel.dimension.DimensionPanel;
 import org.gvsig.raster.wmts.swing.impl.panel.format.IFormatsPanel;
 import org.gvsig.raster.wmts.swing.impl.panel.layer.ILayerPanel;
 import org.gvsig.raster.wmts.swing.impl.panel.layer.LayerList;
@@ -87,21 +88,22 @@
  * @author Nacho Brodin (nachobrodin@gmail.com)
  */
 public class WMTSParamsPanel extends WmtsGUI implements ActionListener, ItemListener, KeyListener, ListSelectionListener, MouseListener, TreeSelectionListener {
-	private static final long      serialVersionUID           = 1L;
+	private static final long        serialVersionUID           = 1L;
 
-	private InfoPanel              tabInfo                    = null;
-	private ILayerPanel            layerPanel                 = null;
-	private StylesPanel            tabStyle                   = null;
-	private IFormatsPanel          formatsPanel               = null;
+	private InfoPanel                tabInfo                    = null;
+	private ILayerPanel              layerPanel                 = null;
+	private StylesPanel              tabStyle                   = null;
+	private IFormatsPanel            formatsPanel               = null;
+	private DimensionPanel           dimensionPanel             = null;
 
-	private ArrayList<TreePath>    selectedPaths              = new ArrayList<TreePath>();
-	private WMTSWizardListener     listenerSupport            = null;
-	private JTabbedPane            jTabbedPane                = null;
-	private int                    dimensionTabIndex;
-	private int                    stylesTabIndex;
-	protected WMTSServerExplorer   explorer                   = null;
-	public static Preferences      fPrefs                     = Preferences.userRoot().node("gvsig.wmts-wizard");
-	private boolean                deleteCache                = false;
+	private ArrayList<TreePath>      selectedPaths              = new ArrayList<TreePath>();
+	private WMTSWizardListener       listenerSupport            = null;
+	private JTabbedPane              jTabbedPane                = null;
+	protected WMTSServerExplorer     explorer                   = null;
+	public static Preferences        fPrefs                     = Preferences.userRoot().node("gvsig.wmts-wizard");
+	private boolean                  deleteCache                = false;
+	private HashMap<Object, Integer> tabsIndexes                = new HashMap<Object, Integer>();
+	//private Logger                   log                        = LoggerFactory.getLogger(WMTSParamsPanel.class);
 
 	/**
 	 * Layer to add to the selected layers box 
@@ -132,7 +134,6 @@
 		initialize();
 	}
 
-	// TODO: crear nuevo constructor para a�adir los panels que quieras...
 	public WMTSParamsPanel(WMTSServerExplorer data) {
 		super();
 		setWizardData(data);
@@ -141,17 +142,22 @@
 		if (jTabbedPane == null) {
 			jTabbedPane = new JTabbedPane();
 			jTabbedPane.setBounds(4, 4, 502, 415);
-			StylesPanel sp = getTabStyle();
 
-			jTabbedPane.addTab(PluginServices.getText(this, "capas"), null, getLayerPanel(), null);
-			jTabbedPane.addTab(PluginServices.getText(this, "estilos"), null, sp, null);
-			stylesTabIndex = jTabbedPane.getTabCount() - 1;
-			dimensionTabIndex = jTabbedPane.getTabCount() - 1;
-			jTabbedPane.addTab(PluginServices.getText(this, "formatos"), null, getJPanelFormatsAndSrs(), null);
-			jTabbedPane.setEnabledAt(dimensionTabIndex, false);
-			jTabbedPane.setEnabledAt(stylesTabIndex, false);
+			jTabbedPane.addTab(Messages.getText("capas"), null, getLayerPanel(), null);
+			jTabbedPane.addTab(Messages.getText("estilos"), null, getTabStyle(), null);
+			jTabbedPane.addTab(Messages.getText("dimensions"), null, getJPanelDimension(), null);
+			jTabbedPane.addTab(Messages.getText("formatos"), null, getJPanelFormatsAndSrs(), null);
+			
+			tabsIndexes.put(getLayerPanel(), 0);
+			tabsIndexes.put(getTabStyle(), 1);
+			tabsIndexes.put(getJPanelDimension(), 2);
+			tabsIndexes.put(getJPanelFormatsAndSrs(), 3);
 		}
 		this.add(jTabbedPane, null);
+		
+		jTabbedPane.setEnabledAt(1, false);
+		jTabbedPane.setEnabledAt(2, false);
+		jTabbedPane.setEnabledAt(3, false);
 	}
 
 	/**
@@ -177,19 +183,29 @@
 			InfoPanel ip = getTabInfo();
 			ip.addFocusListener(new FocusListener() {
 				public void focusGained(FocusEvent e) {
-					refreshInfo();
+					refreshInfoPanel();
 				}
 
 				public void focusLost(FocusEvent e) {
 				}
 			});
 
-			jTabbedPane.addTab(PluginServices.getText(this, "info"), null, ip, null);
-			jTabbedPane.addTab(PluginServices.getText(this, "capas"), null, getLayerPanel(), null);
-			jTabbedPane.addTab(PluginServices.getText(this, "estilos"), null, getTabStyle(), null);
-			stylesTabIndex = jTabbedPane.getTabCount() - 1;
-			jTabbedPane.addTab(PluginServices.getText(this, "formatos"), null, getJPanelFormatsAndSrs(), null);
-			jTabbedPane.setEnabledAt(stylesTabIndex, false);
+			jTabbedPane.addTab(Messages.getText("info"), null, ip, null);
+			jTabbedPane.addTab(Messages.getText("capas"), null, getLayerPanel(), null);
+			jTabbedPane.addTab(Messages.getText("estilos"), null, getTabStyle(), null);
+			jTabbedPane.addTab(Messages.getText("dimensions"), null, getJPanelDimension(), null);
+			jTabbedPane.addTab(Messages.getText("formatos"), null, getJPanelFormatsAndSrs(), null);
+			
+			tabsIndexes.clear();
+			tabsIndexes.put(ip, 0);
+			tabsIndexes.put(getLayerPanel(), 1);
+			tabsIndexes.put(getTabStyle(), 2);
+			tabsIndexes.put(getJPanelDimension(), 3);
+			tabsIndexes.put(getJPanelFormatsAndSrs(), 4);
+			
+			jTabbedPane.setEnabledAt(2, false);
+			jTabbedPane.setEnabledAt(3, false);
+			jTabbedPane.setEnabledAt(4, false);
 		}
 		return jTabbedPane;
 	}
@@ -238,7 +254,7 @@
 			tabStyle.setEnabled(false);
 			tabStyle.addListener(new BeanListener() {
 				public void beanValueChanged(Object value) {
-					fireWizardComplete(isCorrectlyConfigured());
+					fireWizardComplete();
 				};
 			});
 			tabStyle.addFocusListener(new FocusAdapter() {
@@ -264,6 +280,31 @@
 		}
 		return formatsPanel;
 	}
+	
+	/**
+	 * This method initializes the panel with the formats and SRSs
+	 * @return Panel
+	 */
+	private DimensionPanel getJPanelDimension() {
+		if (dimensionPanel == null) {
+			dimensionPanel = new DimensionPanel();
+		}
+		return dimensionPanel;
+	}
+	
+	/**
+	 * Fires a notification to this wizard listeners telling them if the
+	 * configuration is fair enough to send a GetMap request.
+	 *
+	 * @param b
+	 */
+	private void fireWizardComplete() {
+		listenerSupport.correctlyConfiguredEvent(isCorrectlyConfigured());
+	}
+	
+	public void setListenerSupport(WMTSWizardListener support) {
+		listenerSupport = support;
+	}
 
 	/**
 	 * Returns the index of the CRS within the CRS list.
@@ -338,7 +379,7 @@
 			getInfoFormats().setSelectedIndex(index);
 		}
 
-		refreshInfo();
+		refreshInfoPanel();
 	}
 
 	private void setSelectedLayer(String name) {
@@ -354,7 +395,6 @@
 
 	/**
 	 * Gets the available layers in WMTS maintaining the tree structure
-	 *
 	 * @return
 	 */
 	public LayerTree getLayerStructure() {
@@ -365,6 +405,7 @@
 	 * Gets the list of the styles
 	 * @return
 	 */
+	@SuppressWarnings("rawtypes")
 	public Vector getStyleTitles() {
 		return getTabStyle().getStyleTree().getStyleSelectionTitles();
 	}
@@ -373,6 +414,7 @@
 	 * Gets the list of the selected layers
 	 * @return
 	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
 	public Vector getSelectedLayersVector() {
 		JDnDListModel mod = (JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel();
 		Vector lyrs = new Vector();
@@ -394,6 +436,7 @@
 	 * Gets an array with the list of layers
 	 * @return
 	 */
+	@SuppressWarnings({ "unchecked", "rawtypes" })
 	public LayerUI[] selectedLayersToArray() {
 		JDnDListModel modelo = ((JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel());
 		ArrayList elements = modelo.getElements();
@@ -439,55 +482,103 @@
 		getLayerPanel().getBtnDel().setEnabled(values != null && values.length > 0);
 		return (values == null || values.length == 0) ? false : true;
 	}
-
+	
 	/**
-	 * DOCUMENT ME!
+	 * Method called when pressing the Add layer button or when double-clicking
+	 * on a layer from the server's layer tree.
 	 */
-	private void delLayer() {
-		int[] indices = getLayerPanel().getLstSelectedLayers().getSelectedIndices();
+	public void addLayer() {
+		boolean alguno = false;
 
+		TreePath[] selecciones = getLayerPanel().getTreeLayers().getSelectionPaths();
+		if (selecciones == null) {
+			return;
+		}
+
+		//**************
+		//Limpiar la lista. 
+		//Quitar este bloque si se quiere a�adir una lista de elementos y no solo uno
 		try {
-			ArrayList removeList = new ArrayList();
 			LayerUI[] infos = selectedLayersToArray();
 			JDnDListModel modelo = ((JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel());
-			for (int i = 0; i < indices.length; i++) {
-				removeList.add(infos[indices[i]]);
-			}
-			modelo.delIndices(indices);
+			modelo.delIndices(new int[infos.length]);
 			layerPanel.getLstSelectedLayers().clearSelection();
-			fireWizardComplete(isCorrectlyConfigured());
+			selectedPaths.clear();
+		} catch (ArrayIndexOutOfBoundsException ex) {
+			ex.printStackTrace();
+		}
+		//**************
 
-			// delete from selectedPaths as well
-			WMTSTheme elemento = null;
-			WMTSTheme last = null;
-			TreePath path = null;
-			for (int i = removeList.size() - 1; i >= 0; i--) {
-				elemento = ((LayerUI)removeList.get(i)).theme;
-				for (int j = 0; j < selectedPaths.size(); j++) {
-					path = (TreePath) selectedPaths.get(j);
-					last = (WMTSTheme) path.getLastPathComponent();
-					if (last.getTitle().compareTo(elemento.getTitle()) == 0) {
-						selectedPaths.remove(path);
-					}
-				}
+		for (int i = 0; i < selecciones.length && i < 1 /*Se a�ade solo uno: quitar para lista*/; i++) {
+			if(!(selecciones[i].getLastPathComponent() instanceof WMTSTheme))
+				continue;
+			selectedPaths.add(selecciones[i]);
+			WMTSTheme nodo = (WMTSTheme) selecciones[i].getLastPathComponent();
+
+			if (nodo.getTitle() == null || nodo.getTitle().equals("")) {
+				continue;
 			}
 
+			JDnDListModel modelo = (JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel();
+			if(getLayerPanel().getThemesViewSelection().isSelected() && nodo.getLayerRef().size() == 0) {
+				JOptionPane.showOptionDialog(this,
+						Messages.getText("theme_without_reference"),
+						Messages.getText("confirmacion"),
+						JOptionPane.OK_OPTION,
+						JOptionPane.INFORMATION_MESSAGE,
+						null,
+						new Object[]{Messages.getText("accept")},
+						Messages.getText("accept"));
+				return;
+			}
+				
+			if (modelo.addElement(0, new LayerUI(nodo))) {
+				alguno = true;
+			}
+			getLayerPanel().getLstSelectedLayers().setSelectedIndex(0);
+		}
+
+		if (alguno) {
 			refreshSelectedLayerData();
-			refreshInfo();
-		} catch (ArrayIndexOutOfBoundsException ex) {
-			// if you reach this, please, tell me how you did it.
-			ex.printStackTrace();
 		}
+		refreshInfoPanel();
+		fireWizardComplete();
+		listenerSupport.addLayerEvent();
 	}
 
-	/**
-	 * Fires a notification to this wizard listeners telling them if the
-	 * configuration is fair enough to send a GetMap request.
-	 *
-	 * @param b
-	 */
-	private void fireWizardComplete(boolean b) {
-		listenerSupport.callStateChanged(b);
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	private void delLayer() {
+		int[] indices = getLayerPanel().getLstSelectedLayers().getSelectedIndices();
+
+		ArrayList removeList = new ArrayList();
+		LayerUI[] infos = selectedLayersToArray();
+		JDnDListModel modelo = ((JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel());
+		for (int i = 0; i < indices.length; i++) {
+			removeList.add(infos[indices[i]]);
+		}
+		modelo.delIndices(indices);
+		layerPanel.getLstSelectedLayers().clearSelection();
+
+		// delete from selectedPaths as well
+		WMTSTheme elemento = null;
+		WMTSTheme last = null;
+		TreePath path = null;
+		for (int i = removeList.size() - 1; i >= 0; i--) {
+			elemento = ((LayerUI)removeList.get(i)).theme;
+			for (int j = 0; j < selectedPaths.size(); j++) {
+				path = (TreePath) selectedPaths.get(j);
+				last = (WMTSTheme) path.getLastPathComponent();
+				if (last.getTitle().compareTo(elemento.getTitle()) == 0) {
+					selectedPaths.remove(path);
+				}
+			}
+		}
+
+		refreshSelectedLayerData();
+		refreshInfoPanel();
+		fireWizardComplete();
+		listenerSupport.removeLayerEvent();
 	}
 
 	/**
@@ -501,12 +592,13 @@
 		refreshInfoFormats();
 		getLayerPanel().getLstSelectedLayers().repaint();
 		refreshStyleTree();
+		refreshDimension();
 	}
 
 	/**
 	 * Refreshes the info tab
 	 */
-	public void refreshInfo() {
+	public void refreshInfoPanel() {
 		getTabInfo().refresh(explorer, getSelectedLayersVector(),
 				getStyleTitles(), getSelectedImageFormat(), getSelectedSRS());
 	}
@@ -515,8 +607,9 @@
 	 * Refreshes the style tab
 	 */
 	private void refreshStyleTree() {
-		StyleTreeModel model = new StyleTreeModel(PluginServices.getText(this, "selected_layers"));
-		jTabbedPane.setEnabledAt(stylesTabIndex, false);
+		StyleTreeModel model = new StyleTreeModel(Messages.getText("selected_layers"));
+		int tabIndex = tabsIndexes.get(getTabStyle());
+		jTabbedPane.setEnabledAt(tabIndex, false);
 
 		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
 		if(selectedValues != null && selectedValues.length == 1) {
@@ -530,7 +623,7 @@
 			LayerUI layerUI = ((LayerUI)listModel.getElementAt(i));
 			// If any of the layers defines styles, the tab will be enabled.
 			if (model.addLayerBranch(layerUI)) {
-				jTabbedPane.setEnabledAt(stylesTabIndex, true);
+				jTabbedPane.setEnabledAt(tabIndex, true);
 			}
 		}
 
@@ -544,16 +637,21 @@
 	 */
 	private void refreshImageFormats() {
 		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+		
+		int tabIndex = tabsIndexes.get(getJPanelFormatsAndSrs());
+		jTabbedPane.setEnabledAt(tabIndex, false);
+		
 		if( (selectedValues == null || selectedValues.length == 0) &&
 				getImageFormats().getModel() != null && 
 				getImageFormats().getModel() instanceof WMTSParametersListModel) {
 			((WMTSParametersListModel)getImageFormats().getModel()).removeAllItems();
 		}
-		if(selectedValues != null && selectedValues.length == 1) {
+		if(selectedValues != null && selectedValues.length >= 1) {
 			List<String> formats = ((LayerUI)selectedValues[0]).theme.getLayer().getFormat();
 			WMTSParametersListModel model = new WMTSParametersListModel(formats);
 			getImageFormats().setModel(model);
 			getImageFormats().setSelectedIndex(((LayerUI)selectedValues[0]).imageFormatSelected);
+			jTabbedPane.setEnabledAt(tabIndex, true);
 		}
 	}
 
@@ -592,73 +690,22 @@
 			getLstSRSs().setSelectedIndex(((LayerUI)selectedValues[0]).srsFormatSelected);
 		}
 	}
-
-	/**
-	 * Method called when pressing the Add layer button or when double-clicking
-	 * on a layer from the server's layer tree.
-	 */
-	public void addLayer() {
-		boolean alguno = false;
-
-		TreePath[] selecciones = getLayerPanel().getTreeLayers().getSelectionPaths();
-		if (selecciones == null) {
-			return;
-		}
-
-		//**************
-		//Limpiar la lista. 
-		//Quitar este bloque si se quiere a�adir una lista de elementos y no solo uno
-		try {
-			LayerUI[] infos = selectedLayersToArray();
-			JDnDListModel modelo = ((JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel());
-			modelo.delIndices(new int[infos.length]);
-			layerPanel.getLstSelectedLayers().clearSelection();
-			fireWizardComplete(isCorrectlyConfigured());
-			selectedPaths.clear();
-		} catch (ArrayIndexOutOfBoundsException ex) {
-			ex.printStackTrace();
-		}
-		//**************
-
-		for (int i = 0; i < selecciones.length && i < 1 /*Se a�ade solo uno: quitar para lista*/; i++) {
-			if(!(selecciones[i].getLastPathComponent() instanceof WMTSTheme))
-				continue;
-			selectedPaths.add(selecciones[i]);
-			WMTSTheme nodo = (WMTSTheme) selecciones[i].getLastPathComponent();
-
-			if (nodo.getTitle() == null || nodo.getTitle().equals("")) {
-				continue;
-			}
-
-			JDnDListModel modelo = (JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel();
-			if(getLayerPanel().getThemesViewSelection().isSelected() && nodo.getLayerRef().size() == 0) {
-				JOptionPane.showOptionDialog(this,
-						Messages.getText("theme_without_reference"),
-						Messages.getText("confirmacion"),
-						JOptionPane.OK_OPTION,
-						JOptionPane.INFORMATION_MESSAGE,
-						null,
-						new Object[]{Messages.getText("accept")},
-						Messages.getText("accept"));
+	
+	private void refreshDimension() {
+		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+		int tabIndex = tabsIndexes.get(getJPanelDimension());
+		jTabbedPane.setEnabledAt(tabIndex, false);
+		
+		if(selectedValues != null && selectedValues.length >= 1) {
+			List<WMTSDimension> dimensions = ((LayerUI)selectedValues[0]).theme.getLayer().getDimensions();
+			if(dimensions == null || dimensions.size() == 0) {
 				return;
 			}
-				
-			if (modelo.addElement(0, new LayerUI(nodo))) {
-				alguno = true;
-			}
-			getLayerPanel().getLstSelectedLayers().setSelectedIndex(0);
+			jTabbedPane.setEnabledAt(tabIndex, true);
+			getJPanelDimension().setDimensions(dimensions);
 		}
-
-		if (alguno) {
-			refreshSelectedLayerData();
-		}
-		refreshInfo();
 	}
 
-	public void setListenerSupport(WMTSWizardListener support) {
-		listenerSupport = support;
-	}
-
 	/**
 	 * Sets the explorer
 	 * @param data
@@ -669,10 +716,11 @@
 		layerPanel.getLstSelectedLayers().repaint();
 
 		getLayerPanel().getTreeLayers().setModel(new LayerTreeModel(explorer.getOGCClient().getLayerListAsThemes()));
-		refreshInfo();
+		refreshInfoPanel();
 	}
 
 
+	@SuppressWarnings({ "rawtypes", "unchecked" })
 	public String getLayersQuery() {
 		ArrayList elements = ((JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel()).getElements();
 		LayerUI[] layers = (LayerUI[]) elements.toArray(new LayerUI[0]);
@@ -689,9 +737,6 @@
 
 	/**
 	 * Sets the focus to the tab next to the current one.
-	 *
-	 * Enfoca a la solapa siguiente a la actualmente enfocada del TabbedPane
-	 *
 	 */
 	public void setNextTab() {
 		int currentPage = currentPage();
@@ -703,9 +748,6 @@
 
 	/**
 	 * Sets the focus to the tab previous to the current one.
-	 *
-	 * Enfoca a la solapa anterior a la actualmente enfocada del TabbedPane
-	 *
 	 */
 	public void setPreviousTab() {
 		this.getJTabbedPane().setSelectedIndex(previousEnabledPage());
@@ -714,9 +756,6 @@
 
 	/**
 	 * Returns the index of the current tab.
-	 *
-	 * Devuelve el �ndice de la p�gina actual del wizard.
-	 *
 	 * @return
 	 */
 	public int currentPage() {
@@ -725,9 +764,6 @@
 
 	/**
 	 * Returns the tab amount that the WMTSParamsPanel currently have
-	 *
-	 * Devuelve el n�mero de solapas que tiene actualmente el WMTSParamsPanel
-	 *
 	 * @return int
 	 */
 	public int getNumTabs() {
@@ -738,11 +774,6 @@
 	 * <p>
 	 * Returns the index of the previous enabled tab.
 	 * </p>
-	 * <p>
-	 * Devuelve el �ndice de la anterior p�gina habilitada del wizard o -1
-	 * si no hay ninguna.
-	 * </p>
-	 *
 	 * @return The index, or -1 if there is no one.
 	 */
 	public int previousEnabledPage() {
@@ -764,11 +795,6 @@
 	 * <p>
 	 * Returns the previous of the previous enabled tab.
 	 * </p>
-	 * <p>
-	 * Devuelve el �ndice de la siguiente p�gina habilitada del wizard o -1
-	 * si no hay ninguna.
-	 * </p>
-	 *
 	 * @return The index, or -1 if there is no one.
 	 */
 	public int nextEnabledPage() {
@@ -787,51 +813,11 @@
 
 	/**
 	 * Selects/deselects the transparency checkbox.
-	 *
 	 * @param b
 	 */
 	public void setTransparent(boolean b) {
 		getJPanelFormatsAndSrs().getChkTransparency().setSelected(b);
 	}
-
-//	public FLyrWMTS[] getLayers() throws LoadLayerException {
-//		ListModel model = getLayerPanel().getLstSelectedLayers().getModel();
-//		FLyrWMTS[] layerList = new FLyrWMTS[model.getSize()];
-//
-//		for (int i = 0; i < model.getSize(); i++) {
-//			WMTSTheme theme = ((LayerUI)model.getElementAt(i)).theme;
-//			DataStoreParameters parameters = explorer.getStoredParameters();
-//			WMTSDataParameters par = null;
-//			if(parameters instanceof WMTSDataParameters) {
-//				par = (WMTSDataParameters) parameters;
-//			}
-//			if(parameters instanceof TileDataParameters) {
-//				DataParameters p = ((TileDataParameters) parameters).getDataParameters();
-//				if(p instanceof WMTSDataParameters)
-//					par = (WMTSDataParameters) p;
-//			}
-//			par.setURI(explorer.getHost());
-//			par.setImageFormat(getSelectedImageFormat());
-//			par.setInfoFormat(getSelectedInfoFormat());
-//			par.setSRS(getSelectedSRS());
-//			par.setLayer(theme.getLayer());
-//			par.setStyle(getSelectedStyle(theme.getLayer().getTitle()));
-//
-//			FLyrWMTS layer = new FLyrWMTS();
-//			layer.deleteCache(deleteCache);
-//			try {
-//				layer.setParameters(parameters);
-//				layer.setName(theme.getLayer().getTitle());
-//				layer.setExplorer(explorer);
-//				//Ojo! Pruebas!
-//				//layer.setTileServer(FileTileServer.class);
-//			} catch (InitializeException e) {
-//				throw new LoadLayerException("Error initializating layer", e);
-//			}
-//			layerList[i] = layer;
-//		}
-//		return layerList;
-//	}
 	
 	public RasterDataParameters[] getDataParameters() throws LoadLayerException {
 		ListModel model = getLayerPanel().getLstSelectedLayers().getModel();
@@ -854,6 +840,8 @@
 			par.setInfoFormat(getSelectedInfoFormat());
 			par.setSRS(getSelectedSRS());
 			par.setLayer(theme.getLayer());
+			par.setDimension(getSelectedDimension());
+			par.setDimensionSelectedValue(getSelectedValueForDimension());
 			WMTSStyle style = getSelectedStyle(theme.getLayer().getTitle());
 			if(style != null)
 				par.setStyle(style);
@@ -863,6 +851,14 @@
 		return paramList;
 	}
 
+	private String getSelectedValueForDimension() {
+		return getJPanelDimension().getSelectedValuePanel().getSelectedValue().getText();
+	}
+
+	private String getSelectedDimension() {
+		return getJPanelDimension().getDimensionPanel().getSelectedDimension();
+	}
+
 	/**
 	 * Returns the current selected SRS.
 	 * @return
@@ -971,7 +967,7 @@
 			layerPanel.getLstSelectedLayers().repaint();
 
 			getLayerPanel().getTreeLayers().setModel(new LayerTreeModel(explorer.getOGCClient().getLayerListAsThemes()));
-			refreshInfo();
+			refreshInfoPanel();
 		}
 		
 		if(e.getSource() == getLayerPanel().getThemesViewSelection()) {
@@ -980,7 +976,7 @@
 				layerPanel.getLstSelectedLayers().repaint();
 
 				getLayerPanel().getTreeLayers().setModel(new LayerTreeModel(explorer.getOGCClient().getThemes()));
-				refreshInfo();
+				refreshInfoPanel();
 			} else {
 				getLayerPanel().getLayerListViewSelection().setSelected(true);
 				JOptionPane.showOptionDialog(this,
@@ -1006,14 +1002,11 @@
 		}
 
 		if(e.getSource() == getJPanelFormatsAndSrs().getChkTransparency()) {
-			fireWizardComplete(isCorrectlyConfigured());
+			fireWizardComplete();
 		}
 	}
 
 	public void keyTyped(KeyEvent e) {
-		/*if(e.getSource() == getLayerPanel().getJTxtNomCapa()) {
-			fireWizardComplete(isCorrectlyConfigured());
-		}*/
 	}
 
 	public void keyPressed(KeyEvent e) {
@@ -1023,7 +1016,7 @@
 	}
 
 	public void valueChanged(ListSelectionEvent e) {
-		fireWizardComplete(isCorrectlyConfigured());
+		fireWizardComplete();
 	}
 
 	public void mouseClicked(MouseEvent e) {
@@ -1049,7 +1042,6 @@
 		}
 	}
 
-
 	public void valueChanged(TreeSelectionEvent e) {
 		if(e.getSource() == getLayerPanel().getTreeLayers()) {
 			boolean isGetMapable = false;
@@ -1065,7 +1057,7 @@
 
 			}
 			getLayerPanel().getBtnAdd().setEnabled(isGetMapable);
-			fireWizardComplete(isCorrectlyConfigured());
+			fireWizardComplete();
 		}
 	}
 
