Index: org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java
===================================================================
--- org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java	(revision 4438)
+++ org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java	(revision 4439)
@@ -19,6 +19,8 @@
 
 import org.cresques.cts.ICoordTrans;
 import org.cresques.cts.IProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import org.gvsig.fmap.dal.DALLocator;
 import org.gvsig.fmap.dal.DataManager;
@@ -74,9 +76,6 @@
 import org.gvsig.tools.task.SimpleTaskStatus;
 import org.gvsig.tools.task.TaskStatusManager;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * WMTS Layer class.
  *
@@ -94,6 +93,9 @@
 	private WMTSServerExplorer           wmtsExplorer              = null;
 	private boolean                      deleteCache               = false;
 
+	/**
+	 * Register the persistence
+	 */
 	public static void registerPersistent() {
 		PersistenceManager manager = ToolsLocator.getPersistenceManager();
 		DynStruct definition = manager.getDefinition("FLyrWMTS_Persistent");
@@ -116,6 +118,9 @@
 		DefaultFLyrRaster.registerPersistence(definition);
 	}
 
+	/**
+	 * Constructor
+	 */
 	public FLyrWMTS() {
 		super();
 		this.updateDrawVersion();
@@ -126,6 +131,12 @@
 		}
 	}
 
+	/**
+	 * @param host
+	 * @param srs
+	 * @return the data store
+	 * @throws InitializeException
+	 */
 	public static DataStore createDataStore(String host, IProjection srs) throws InitializeException {
 		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
 		RasterDataParameters params = null;
@@ -188,8 +199,10 @@
 		} catch (NotAvailableStateException e) {
 			logger.error("Fallo el estado de open. Closed=" + isClosed() + " Awake=" + isAwake(), this, e);
 		}
-		setProjection(this.dataStore.getProjection());
-		setFullExtent(this.dataStore.getExtent().toRectangle2D());
+        if (this.dataStore != null) {
+            setProjection(this.dataStore.getProjection());
+            setFullExtent(this.dataStore.getExtent().toRectangle2D());
+        }
 	}
 
 	@SuppressWarnings("deprecation")
@@ -223,9 +236,10 @@
 		enableStopped();
 
 		if (isWithinScale(scale)) {
-			if (!viewPort.getAdjustedExtent().intersects(getFullEnvelope()))
+		    Envelope adjustedExtent = viewPort.getAdjustedEnvelope();
+			if (!adjustedExtent.intersects(getFullEnvelope())) {
 				return;
-			Envelope adjustedExtent = viewPort.getAdjustedEnvelope();
+			}
 			Extent ext = rManager.getDataStructFactory().createExtent(
 					adjustedExtent.getLowerCorner().getX(),
 					adjustedExtent.getUpperCorner().getY(),
@@ -261,6 +275,12 @@
 
 
 	/**
+	 * @param g
+	 * @param viewPort
+	 * @param cancel
+	 * @param scale
+	 * @param properties
+	 * @throws ReadException
 	 * @see com.iver.cit.gvsig.fmap.layers.FLayer#print(java.awt.Graphics2D,
 	 * 		com.iver.cit.gvsig.fmap.ViewPort,
 	 * 		com.iver.cit.gvsig.fmap.operations.Cancellable)
@@ -268,10 +288,17 @@
 	public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties)
 	throws ReadException {
 
+
 	}
 
-	public void _print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
-			double scale) throws ReadException {
+	/**
+	 * @param g
+	 * @param viewPort
+	 * @param cancel
+	 * @param scale
+	 * @throws ReadException
+	 */
+	public void _print(Graphics2D g, ViewPort viewPort, Cancellable cancel,	double scale) throws ReadException {
 		draw(null, g, viewPort, cancel,scale);
 	}
 
@@ -287,9 +314,8 @@
 
 	/**
 	 * Inserta la extensión total de la capa en la proyeccion original.
+	 * @param envelope
 	 *
-	 * @param fullExtent
-	 *            Rectángulo.
 	 */
 	public void setFullEnvelope(Envelope envelope) {
 		Envelope cur = this.getFullEnvelope();
@@ -304,6 +330,9 @@
 		this.updateDrawVersion();
 	}
 
+	/**
+	 * @return the properties.
+	 */
 	public HashMap<String, Object> getProperties() {
 		HashMap<String, Object> info = new HashMap<String, Object>();
 		WMTSDataParameters par = getWMTSParameters(getParameters());
@@ -496,7 +525,7 @@
     public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel, boolean fast)
     throws LoadLayerException, DataException {
 
-    	Point2D pReal = getMapContext().getViewPort().toMapPoint(p);
+        org.gvsig.fmap.geom.primitive.Point pReal = getMapContext().getViewPort().convertToMapPoint(p);
     	String fInfo = null;
     	try {
     		fInfo = getDataStore().getInfoByPoint(pReal.getX(), pReal.getY(), new CancelTaskImpl(cancel));
@@ -554,6 +583,9 @@
 		}
     }
 
+    /**
+     * @return the data store parameters
+     */
     @SuppressWarnings("deprecation")
 	public DataStoreParameters getParameters() {
     	if(params == null) {
@@ -602,7 +634,7 @@
 
     /**
      * Gets the explorer
-     * @return
+     * @return the server explorer
      */
     public WMTSServerExplorer getExplorer() {
     	return this.wmtsExplorer;
@@ -650,7 +682,7 @@
 
 	/**
 	 * Assigns the flag to delete this layer from the cache
-	 * @param selected
+	 * @param deleteCache
 	 */
 	public void deleteCache(boolean deleteCache) {
 		this.deleteCache = deleteCache;
Index: org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRasterStore.java
===================================================================
--- org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRasterStore.java	(revision 4438)
+++ org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRasterStore.java	(revision 4439)
@@ -108,6 +108,9 @@
 	 */
 	private List<ROI>                        rois                           = null;
 
+	/**
+	 * Constructor
+	 */
 	public DefaultRasterStore() {
 		super();
 	}
@@ -116,6 +119,9 @@
 		provider.reload();
 	}
 
+	/**
+	 * @param provider
+	 */
 	public void setProvider(RasterProvider provider) {
 		this.provider = provider;
 		parameters = (DataStoreParameters)provider.getDataParameters();
@@ -270,6 +276,9 @@
 		return provider.getExtentWithoutRot();
 	}
 
+	/**
+	 * @return the extent
+	 */
 	public Extent getLastSelectedView(){
 		return provider.getView();
 	}
@@ -346,6 +355,10 @@
 		return this;
 	}
 
+	/**
+	 * @param band
+	 * @return the affine transform
+	 */
 	public AffineTransform getAffineTransform(int band){
 		return provider.getAffineTransform();
 	}
@@ -361,7 +374,7 @@
 	 * esta matriz tendrá la georreferenciación asociada en el worldfile o cabecera. Otras librerias como
 	 * ermapper la petición a la libreria se hace en coordenadas geograficas que son las mismas en las
 	 * que pide el usuario de gvSIG por lo que esta matriz en este caso se inicializa con la identidad.
-	 * @return
+	 * @return the own affine transform
 	 */
 	public AffineTransform getOwnTransformation() {
 		return provider.getOwnAffineTransform();
@@ -871,7 +884,7 @@
 
 	/**
 	 * Gets the list of geo points associated to this provider
-	 * @return
+	 * @return GeoPointList
 	 */
 	public GeoPointList getGeoPointList() {
 		return provider.getGeoPointList();
@@ -884,6 +897,9 @@
 		provider.setGeoPointList(geoPointList);
 	}
 
+	/**
+	 * @return the full envelope
+	 */
 	public Envelope getFullEnvelope() {
 		Rectangle2D e = getExtent().toRectangle2D();
 		try {
@@ -929,10 +945,18 @@
 		this.rois = rois;
 	}
 
+	/**
+	 * @param file
+	 * @throws RmfSerializerException
+	 */
 	public void setROIsFiles(List<File> file) throws RmfSerializerException {
 		getDataStore().saveROIFileListToRmf(file);
 	}
 
+	/**
+	 * @return the ROI files
+	 * @throws RmfSerializerException
+	 */
 	public List<File> getROIsFiles() throws RmfSerializerException {
 		return getDataStore().getROIFileListFromRmf();
 	}
@@ -966,6 +990,9 @@
 	//Persistence
 	//******************************
 
+	/**
+	 * Register persistence
+	 */
 	public static void registerPersistence() {
 		PersistenceManager manager = ToolsLocator.getPersistenceManager();
 		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
@@ -1064,7 +1091,6 @@
 			DataServerExplorerParameters explorerParams = null;
 			explorerParams = datamanager.createServerExplorerParameters(explorerName);
 			explorerParams.setDynValue("host", "");
-			explorerParams.setDynValue("axisorder", new Boolean(false));
 			DataServerExplorer e = datamanager.openServerExplorer(explorerName, explorerParams);
 			if(e instanceof RasterDataServerExplorer) {
 				explorer = (RasterDataServerExplorer)e;
Index: org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DatasetBandImpl.java
===================================================================
--- org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DatasetBandImpl.java	(revision 4438)
+++ org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DatasetBandImpl.java	(revision 4439)
@@ -61,6 +61,9 @@
 	//
 	private int                    nBandsInThisProvider    = 0;
 
+	/**
+	 * Constructor
+	 */
 	public DatasetBandImpl() {
 
 	}
@@ -250,14 +253,15 @@
 		try {
 			URI uri = state.getURI("fileName");
 			if(uri != null) {
-				File file = new File(uri);
-				if(file.isFile() && file.exists())
-					fileName = file.getAbsolutePath();
-				else {
-					fileName = uri.toString();
-					if(uri.getScheme() == null || "file".equalsIgnoreCase(uri.getScheme()))
-						fileName = uri.getPath();
-				}
+			    fileName = uri.toString();
+                if (uri.getScheme() != null && "FILE".equalsIgnoreCase(uri.getScheme())) {
+                    File file = new File(uri);
+                    if (file.isFile() && file.exists()) {
+                        fileName = file.getAbsolutePath();
+                    } else {
+                        fileName = uri.getPath();
+                    }
+                }
 			}
 		} catch(ClassCastException e) {
 			fileName = state.getString("fileName");
@@ -289,6 +293,9 @@
 		state.set("rasterBufBandToDrawList", rasterBufBandToDrawList);
 	}
 
+	/**
+	 * Register persistence
+	 */
 	public static void registerPersistence() {
 		PersistenceManager manager = ToolsLocator.getPersistenceManager();
 		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
Index: org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSServerExplorerParameters.java
===================================================================
--- org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSServerExplorerParameters.java	(revision 4438)
+++ org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSServerExplorerParameters.java	(revision 4439)
@@ -27,6 +27,9 @@
 
 package org.gvsig.raster.wms.io;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.gvsig.fmap.dal.DataServerExplorerParameters;
 import org.gvsig.fmap.dal.spi.AbstractDataParameters;
 import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
@@ -35,6 +38,8 @@
 import org.gvsig.tools.dynobject.DynClass;
 import org.gvsig.tools.dynobject.DynStruct;
 import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
 
 /**
  * Parameters for the WMS provider
@@ -44,8 +49,15 @@
 	protected static final String  FIELD_HOST          = "host";
 	protected static DynClass      DYNCLASS            = null;
 	private DelegatedDynObject     delegatedDynObject  = null;
-	private static final String    FIELD_XYAXISORDER          = "xyaxisorder";
-	
+	private static final String    FIELD_XYAXISORDER   = "xyaxisorder";
+    private static final String    OLD_FIELD_AXISORDER   = "axisorder";
+
+    @SuppressWarnings("unused")
+    private static final Logger logger = LoggerFactory.getLogger(WMSServerExplorerParameters.class);
+
+	/**
+	 *
+	 */
 	public WMSServerExplorerParameters() {
 		super();
 		initialize();
@@ -56,7 +68,10 @@
 				.getDynObjectManager().createDynObject(
 						registerDynClass());
 	}
-	
+
+	/**
+	 * @return the dynstruct
+	 */
 	public static DynStruct registerDynClass() {
 		PersistenceManager manager = ToolsLocator.getPersistenceManager();
 		DynStruct definition = manager.getDefinition("WMSServerExplorerParameters_Persistent");
@@ -65,7 +80,7 @@
 					WMSServerExplorerParameters.class,
 					"WMSServerExplorerParameters_Persistent",
 					"WMS Explorer DataParameters Persistency",
-					null, 
+					null,
 					null
 			);
 		}
@@ -74,21 +89,21 @@
 
 		definition.addDynFieldBoolean(FIELD_XYAXISORDER)
 		.setDescription("Longitude first in axis order")
-		.setMandatory(false);
+		.setMandatory(false).setDefaultFieldValue(new Boolean(false));
 
 		definition.addDynFieldString(FIELD_HOST)
 		.setDescription("Uniform Resource Identifier (File name or URL)")
-		.setMandatory(false);		
+		.setMandatory(false);
 		return definition;
 	}
-	
+
 	protected DelegatedDynObject getDelegatedDynObject() {
 		return delegatedDynObject;
 	}
-	
+
 	/**
 	 * Gets the assigned host
-	 * @return
+	 * @return the value of host field
 	 */
 	public String getHost() {
 		return (String) this.getDynValue(FIELD_HOST);
@@ -102,10 +117,16 @@
 		this.setDynValue(FIELD_HOST, host);
 	}
 
+	/**
+	 * @return the provider name
+	 */
 	public String getDataStoreName() {
 		return WMSProvider.NAME;
 	}
-	
+
+    /**
+     * @return the provider description
+     */
 	public String getDescription() {
 		return WMSProvider.DESCRIPTION;
 	}
@@ -116,23 +137,23 @@
 
 	/**
 	 * <p>Gets the behaviour of the WMS client with regards the axis order</p>
-	 * 
+	 *
 	 * <p>Returns <code>true</code> if the WMS parser should assume that the
 	 * order of the coordinates follows the XY axis order
 	 * (the first coordinate corresponds to the horizontal X
 	 * axis, while the second  coordinate corresponds to the
 	 * vertical Y axis), regardless the protocol version and CRS in use.</p>
-	 * 
+	 *
 	 * <p>Returns <code>false</code> if the WMS parser should decide the
 	 * axis order based on the protocol version and the coordinate
 	 * reference system (CRS) in use. In particular, if protocol
 	 * version is >= 1.3.0, then the WMS parser assumes
 	 * the axis order defined in the official EPSG registry for the
 	 * CRS in use. For versions < 1.3.0, the XY axis order is assumed.</p>
-	 * 
+	 *
 	 * <p>The default value is <code>false</code></p>.
 	 * @see #setXyAxisOrder(boolean)
-	 * @return
+	 * @return true if axis order is x-y
 	 */
 	public boolean isXyAxisOrder() {
 		if (hasDynValue(FIELD_XYAXISORDER)) {
@@ -153,11 +174,11 @@
 
 	/**
 	 * <p>Sets the behaviour of the WMS client with regards the axis order.<p>
-	 * 
+	 *
 	 * <p>If set to <code>true</code>, then the XY axis order
 	 * is assumed for all the WMS
 	 * protocol versions and coordinate reference systems.</p>
-	 * 
+	 *
 	 * <p>If set to <code>false</code>
 	 * then the WMS parser will decide the axis order based on
 	 * the protocol version and the coordinate reference system (CRS)
@@ -165,12 +186,34 @@
 	 * version is >= 1.3.0, then the WMS parser assumes
 	 * the axis order defined in the official EPSG registry for the
 	 * CRS in use. For versions < 1.3.0, the XY axis order is assumed.</p>
-	 * 
-	 * 
+	 *
+	 *
 	 * @param assumeXY
 	 * @see #isXyAxisOrder()
 	 */
 	public void setXyAxisOrder(boolean assumeXY) {
 		this.setDynValue(FIELD_XYAXISORDER, new Boolean(assumeXY));
 	}
+
+
+    public void loadFromState(PersistentState state) throws PersistenceException {
+        super.loadFromState(state);
+
+        // Entre la 2.1 y la 2.2 cambió la clave de la propiedad axisorder a xyaxisorder
+        // El siguiente bloque try catch es para mantener compatibilidad con los proyectos de ambas versiones
+        try {
+            setDynValue(FIELD_XYAXISORDER, state.get(OLD_FIELD_AXISORDER));
+        } catch(Throwable t){
+            //do nothing;
+        }
+    }
+
+
+    public void setDynValue(String name, Object value) {
+        if (OLD_FIELD_AXISORDER.equalsIgnoreCase(name)) {
+            super.setDynValue(FIELD_XYAXISORDER, value);
+        } else {
+            super.setDynValue(name, value);
+        }
+    }
 }
