Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1459)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.io.DefaultWMTSIOLibrary
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSConnector.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSConnector.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSConnector.java	(revision 1459)
@@ -0,0 +1,165 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.io;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.remoteclient.exceptions.ServerErrorException;
+import org.gvsig.remoteclient.wmts.WMTSClient;
+import org.gvsig.remoteclient.wmts.WMTSStatus;
+import org.gvsig.remoteclient.wmts.exception.DownloadException;
+import org.gvsig.remoteclient.wmts.exception.WMTSException;
+import org.gvsig.remoteclient.wmts.struct.WMTSLayer;
+import org.gvsig.remoteclient.wmts.struct.WMTSServiceIdentification;
+import org.gvsig.remoteclient.wmts.struct.WMTSServiceProvider;
+import org.gvsig.remoteclient.wmts.struct.WMTSThemes;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixSet;
+
+/**
+ * This class offers an interface of services for a WMTS  
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSConnector  {
+	private WMTSClient                     client        = null;
+
+    public WMTSConnector(URL url) throws ConnectException, IOException {
+    	client = new WMTSClient(url.toString());
+    }
+    
+    /**
+	 * Sets longitude first in the axis order
+	 * @param force
+	 */
+	public void setForceLongitudeFirstAxisOrder(boolean force) {
+		if(client != null) {
+			client.setForceLongitudeFirstAxisOrder(force);
+		}
+	}
+
+    /**
+     * Establishes the connection.
+     * @param override, if true the previous downloaded data will be overridden
+     * @return <b>true</b> if the connection was successful, or <b>false</b> if it was no possible
+     * to establish the connection for any reason such as version negotiation.
+     */
+    public boolean connect(boolean override, ICancellable cancel) {
+    	return client.connect(override, cancel);
+    }
+
+    public boolean connect(ICancellable cancel) {
+    	return client.connect(false, cancel);
+    }
+
+	/**
+	 * Gets the list of themes
+	 * @return
+	 */
+	public WMTSThemes getThemes() {
+		return client.getThemes();
+	}
+    
+    /**
+     * Gets a layer 
+     * @param layerName
+     * @return
+     */
+    public WMTSLayer getLayer(String layerName) {
+    	return client.getLayer(layerName);
+    }
+    
+    /**
+     * Gets the set of tiles definition
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+	public ArrayList<WMTSTileMatrixSet> getTileMatrixSet() {
+    	return client.getTileMatrixSet();
+    }
+    
+    /*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getServiceIdentification()
+	 */
+	public WMTSServiceIdentification getServiceIdentification() {
+		return client.getServiceIdentification();
+	}
+	
+	public WMTSServiceProvider getServiceProvider() {
+		return client.getServiceProvider();
+	}
+
+    /**
+     * Gets the host
+     * @return
+     */
+    public String getHost(){
+    	return client.getHost();
+    }
+   
+    /**
+     * <p>Gets a tile downloading using a specific path and file.</p> 
+     * @throws ServerErrorException 
+     */
+    public synchronized File getTile(WMTSStatus status, ICancellable cancel, File file) throws WMTSException, ServerErrorException {   
+        return client.getTile(status, cancel, file);
+    }
+    
+    /**
+     * <p>One of the three interfaces that OGC WMTS defines. Request a map.</p> 
+     * @throws ServerErrorException 
+     */
+    public synchronized File getTile(WMTSStatus status, ICancellable cancel) throws WMTSException, ServerErrorException {   
+        return client.getTile(status, cancel);
+    }
+    
+    /**
+     * Builds the URL to get a tile using a WMTSStatus object 
+     * @throws ServerErrorException 
+     */
+    public synchronized URL getTileURL(WMTSStatus status) throws MalformedURLException {   
+        return client.getTileURL(status);
+    }
+    
+    /**
+     * Downloads a file
+     * @throws DownloadException 
+     * @throws ServerErrorException 
+     */
+    public synchronized File downloadFile(URL url, ICancellable cancel) throws DownloadException {   
+        return client.downloadFile(url, cancel);
+    }
+    
+    /**
+     * <p>It will send a GetFeatureInfo request to the WMTS
+     * Parsing the response and redirecting the info to the WMTS client</p>
+     */
+    public String getFeatureInfo(WMTSStatus status, int x, int y, ICancellable cancel) throws WMTSException, ServerErrorException {   
+        return client.getFeatureInfo(status, x, y, cancel);
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSConnector.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSProvider.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSProvider.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSProvider.java	(revision 1459)
@@ -0,0 +1,1509 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.io;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.File;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.DatasetBand;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.BandNotFoundInListException;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.InfoByPointException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.metadata.MetadataLocator;
+import org.gvsig.raster.cache.tile.TileCacheLocator;
+import org.gvsig.raster.cache.tile.TileCacheManager;
+import org.gvsig.raster.cache.tile.exception.TileGettingException;
+import org.gvsig.raster.cache.tile.provider.CacheStruct;
+import org.gvsig.raster.cache.tile.provider.TileListener;
+import org.gvsig.raster.cache.tile.provider.TileServer;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.DefaultRasterQuery;
+import org.gvsig.raster.impl.datastruct.BandListImpl;
+import org.gvsig.raster.impl.datastruct.DatasetBandImpl;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.provider.DefaultRasterProvider;
+import org.gvsig.raster.impl.provider.MemoryMatrixBuffer;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.provider.RemoteRasterProvider;
+import org.gvsig.raster.impl.provider.TiledRasterProvider;
+import org.gvsig.raster.impl.store.DefaultStoreFactory;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
+import org.gvsig.raster.impl.store.properties.RemoteStoreHistogram;
+import org.gvsig.raster.util.DefaultProviderServices;
+import org.gvsig.raster.wmts.io.downloader.WMTSTileServer;
+import org.gvsig.remoteclient.exceptions.ServerErrorException;
+import org.gvsig.remoteclient.wmts.WMTSStatus;
+import org.gvsig.remoteclient.wmts.exception.DownloadException;
+import org.gvsig.remoteclient.wmts.exception.WMTSException;
+import org.gvsig.remoteclient.wmts.struct.WMTSBoundingBox;
+import org.gvsig.remoteclient.wmts.struct.WMTSLayer;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrix;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixLimits;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixSet;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixSetLink;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrix.Tile;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.task.TaskStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * Provider for WMTS service
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSProvider extends DefaultRasterProvider implements RemoteRasterProvider, TiledRasterProvider {
+	public static String                NAME                     = "Wmts Store";
+	public static String                DESCRIPTION              = "Wmts Raster file";
+	public static final String          METADATA_DEFINITION_NAME = "WmtsStore";
+	private static Logger               logger                   = LoggerFactory.getLogger(WMTSProvider.class);
+	public static boolean               TILED                    = true;
+	
+	//Los tiles se piden de forma secuencial y sin lanzar threads para ello (+Lento)
+	public static int                   SEQUENTIAL               = 0;
+	//Los tiles se piden en threads y hay un thread manager para gestionar que no se pidan m�s de cierto n�mero
+	public static int                   LIMITED_THREADS          = 1;
+	//Los tiles se piden en threads y se lanzan tantos threads como tiles haya
+	public static int                   UNLIMITED_THREADS        = 2;
+	private int                         requestType              = LIMITED_THREADS;
+	
+	private static final double         MTS_X_GRADO              = 111319.490793274;
+	
+	private Extent                      viewRequest              = null;
+	private WMTSConnector               connector                = null;
+	//private static Hashtable<URL, WMTSConnector>    
+	//                                    drivers                  = new Hashtable<URL, WMTSConnector> ();
+	private boolean                     open                     = false;
+	private File                        lastRequest              = null;
+	private DataStoreTransparency       lastFileTransparency     = null;
+	private int                         lastWidthRequest         = 0;
+	private int                         lastHeightRequest        = 0;
+	private WMTSStatus                  lastStatus               = null;
+	private boolean                     gridSubsets              = true;
+	private Extent[]                    extentByLevel            = null; //Only for layers without gridSubsets
+	private Extent                      bbox                     = null;
+	private MathUtils                   math                     = RasterLocator.getManager().getMathUtils();
+	
+	/**
+	 * This thread manages the number of tiles that have been thrown.
+	 * This number is controlled by the NTHREADS_QUEUE variable.
+	 * 
+	 * @author Nacho Brodin (nachobrodin@gmail.com)
+	 */
+	public class RequestThreadManager extends Thread {
+		private TilePipe           pipe           = null;
+		private ArrayList<Tile>    tiles          = null;
+		private WMTSStatus         status         = null;
+		
+		public RequestThreadManager(TilePipe pipe, ArrayList<Tile> tiles, WMTSStatus status) {
+			this.pipe = pipe;
+			this.tiles = tiles;
+			this.status = status;
+		}
+		
+		public void run() {
+			for (int i = 0; i < tiles.size(); i++) {
+				Tile tile = tiles.get(i);
+				WMTSStatus statusCopy = status.cloneStatus();
+				statusCopy.setTileRow(tile.row);
+				statusCopy.setTileCol(tile.col);
+				if (pipe.getSize() > TilePipe.NTHREADS_QUEUE) {
+					try {
+						synchronized (this) {
+							wait();							
+						}
+					} catch( InterruptedException e ) {
+					}
+				}
+				new RequestTileLauncher(pipe, statusCopy, tile).start();
+			}
+		}
+	}
+	
+	/**
+	 * Thread to download a tile
+	 * @author Nacho Brodin (nachobrodin@gmail.com)
+	 */
+	class RequestTileLauncher extends Thread {
+		private TilePipe      pipe    = null;
+		private WMTSStatus    status  = null;
+		private Tile          tile    = null;
+
+		public RequestTileLauncher(TilePipe pipe, WMTSStatus status, Tile tile) {
+			this.pipe = pipe;
+			this.status = status;
+			this.tile = tile;
+		}
+
+		public void run() {
+			try {
+				//File file = getConnector().getTile(status, null);
+				URL url = getConnector().getTileURL(status);
+				tile.file = getConnector().downloadFile(url, null);
+				pipe.setTile(tile);
+			} catch (DownloadException e) {
+				logger.info("Error downloading files", e);
+			} catch (MalformedURLException e) {
+				logger.info("Malformed URL", e);
+			} catch (WMTSException e) {
+				logger.info("", e);
+			}
+		}
+	}
+	
+	/**
+	 * Point information 
+	 * @author Nacho Brodin (nachobrodin@gmail.com)
+	 */
+	public class PointInfo {
+		public Point2D worldCoord;
+		public Point2D tile;
+		public Point2D pixelInTile;
+		public int     level;
+		
+		public PointInfo(Point2D worldCoord) {
+			this.worldCoord = worldCoord;
+		}
+	}
+
+	public static void register() {
+		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
+		if (dataman != null && !dataman.getStoreProviders().contains(NAME)) {
+			dataman.registerStoreProvider(NAME,
+					WMTSProvider.class, WMTSDataParametersImpl.class);
+		}
+
+		if (!dataman.getExplorerProviders().contains(WMTSServerExplorer.NAME)) {
+			dataman.registerExplorerProvider(WMTSServerExplorer.NAME, WMTSServerExplorer.class, WMTSServerExplorerParameters.class);
+		}
+		dataman.registerStoreFactory(NAME, DefaultStoreFactory.class);
+	}
+	
+	public WMTSProvider() throws NotSupportedExtensionException {
+		super();
+	}
+	
+	/**
+	 * Constructor. Abre el dataset.
+	 * @param proj Proyecci�n
+	 * @param fName Nombre del fichero
+	 * @throws NotSupportedExtensionException
+	 */
+	public WMTSProvider(String params) throws NotSupportedExtensionException {
+		super(params);
+		if(params instanceof String) {
+			WMTSDataParameters p = new WMTSDataParametersImpl();
+			p.setURI((String)params);
+			super.init(p, null, ToolsLocator.getDynObjectManager()
+					.createDynObject(
+							MetadataLocator.getMetadataManager().getDefinition(
+									DataStore.METADATA_DEFINITION_NAME)));
+			init(p, null);
+		}
+	}
+	
+	public WMTSProvider(WMTSDataParameters params,
+			DataStoreProviderServices storeServices) throws NotSupportedExtensionException {
+		super(params, storeServices, ToolsLocator.getDynObjectManager()
+				.createDynObject(
+						MetadataLocator.getMetadataManager().getDefinition(
+								DataStore.METADATA_DEFINITION_NAME)));
+		init(params, storeServices);
+	}
+	
+	/**
+	 * Gets the connector from the URL
+	 * @return
+	 * @throws RemoteServiceException
+	 */
+	public WMTSConnector getConnector() throws WMTSException {
+		if(connector == null) {
+			WMTSDataParameters p = (WMTSDataParameters)parameters;
+			URL url = null;
+			try {
+				url = new URL(p.getURI());
+			} catch (Exception e) {
+				throw new WMTSException("Malformed URL",e);
+			}
+			try {
+				connector = new WMTSConnector(url);
+			} catch (ConnectException e) {
+				throw new WMTSException("Connect exception",e);
+			} catch (IOException e) {
+				throw new WMTSException("Connect exception",e);
+			}
+		}
+		return connector;
+	}
+
+	/**
+	 * Crea las referencias al fichero y carga
+	 * las estructuras con la informaci�n y los metadatos.
+	 * @param proj Proyecci�n
+	 * @param param Parametros de carga
+	 * @throws NotSupportedExtensionException
+	 */
+	public void init (DataStoreParameters params,
+			DataStoreProviderServices storeServices) throws NotSupportedExtensionException {
+		setParam(storeServices, params);
+		if(((WMTSDataParameters)params).getImageFormat().compareTo("image/gif") == 0) {
+			setDataType(new int[]{Buffer.TYPE_BYTE});
+			bandCount = 1;
+		} else {
+			setDataType(new int[]{Buffer.TYPE_BYTE, Buffer.TYPE_BYTE, Buffer.TYPE_BYTE, Buffer.TYPE_BYTE});
+			bandCount = 4;
+		}
+		
+		if(!(param instanceof WMTSDataParameters))
+			return;
+		
+		gridSubsets = hasGridSubsets((WMTSDataParameters)param);
+		open = true;
+	}
+	
+	/**
+	 * Returns true if this layer has grid subsets
+	 * @return
+	 */
+	public boolean hasGridSubsets() {
+		return gridSubsets;
+	}
+	
+	/**
+	 * Checks if this layer has grid subsets or doesn't
+	 * @param p
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	private boolean hasGridSubsets(WMTSDataParameters p) {
+		ArrayList tileMatrixSetLimits = null;
+		ArrayList<?> tileMatrixSetLinkList = p.getLayer().getTileMatrixSetLink();
+		String srs = p.getSRSCode();
+		for (int i = 0; i < tileMatrixSetLinkList.size(); i++) {
+			WMTSTileMatrixSetLink tileMatrixSetLink = (WMTSTileMatrixSetLink)tileMatrixSetLinkList.get(i);
+			WMTSTileMatrixSet tms = tileMatrixSetLink.getTileMatrixSet();
+			ArrayList tmsl = tileMatrixSetLink.getTileMatrixLimits();
+			String srsTileSet = tms.getSupportedCRS();
+			if(srsTileSet.compareTo(srs) == 0) {
+				tileMatrixSetLimits = tmsl;
+			}
+		}
+		
+		return tileMatrixSetLimits.size() <= 0 ? false : true; 
+	}
+	
+	/*public static final WMTSConnector getConnectorFromURL(URL url) throws IOException {
+		WMTSConnector drv = (WMTSConnector) drivers.get(url);
+		if (drv == null) {
+			drv = new WMTSConnector(url);
+			drivers.put(url, drv);
+		}
+		return drv;
+	}*/
+	
+	/**
+	 * Obtiene el objeto que contiene que contiene la interpretaci�n de
+	 * color por banda
+	 * @return
+	 */
+	public ColorInterpretation getColorInterpretation() {
+		if(super.getColorInterpretation() == null) {
+			ColorInterpretation colorInterpretation = new DataStoreColorInterpretation();
+			colorInterpretation.initColorInterpretation(getBandCount());
+			if(getBandCount() >= 3) {
+				colorInterpretation.setColorInterpValue(0, DataStoreColorInterpretation.RED_BAND);
+				colorInterpretation.setColorInterpValue(1, DataStoreColorInterpretation.GREEN_BAND);
+				colorInterpretation.setColorInterpValue(2, DataStoreColorInterpretation.BLUE_BAND);
+			}
+			if(getBandCount() == 4)
+				colorInterpretation.setColorInterpValue(3, DataStoreColorInterpretation.ALPHA_BAND);
+			if(getBandCount() > 4 || getBandCount() < 3) {
+				for (int i = 0; i < getBandCount(); i++) {
+					colorInterpretation.setColorInterpValue(i, DataStoreColorInterpretation.UNDEF_BAND);
+				}
+			}
+			setColorInterpretation(colorInterpretation);
+		}
+		return super.getColorInterpretation();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#isTiled()
+	 */
+	public boolean isTiled() {
+		return true;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.RasterDataSet#getAffineTransform()
+	 */
+	public AffineTransform getAffineTransform() {
+		WMTSDataParameters p = (WMTSDataParameters)parameters;
+		Extent e = getExtent();
+		double psX = e.width() / (lastWidthRequest <= 0 ? p.getWidth() : lastWidthRequest);
+		double psY = -(e.height() / (lastHeightRequest <= 0 ? p.getHeight() : lastHeightRequest));
+		ownTransformation = new AffineTransform(
+				psX, 
+				0, 
+				0, 
+				psY, 
+				e.getULX() - (psX / 2),
+				e.getULY() - (psY / 2));
+		externalTransformation = (AffineTransform) ownTransformation.clone();
+		return ownTransformation;
+	}
+	
+	/**
+	 * Gets the bounding box in world coordinates. If the layer has grid subsets (TileMatrixLimits) then
+	 * this will have a only extent but if the layer doesn't have grid subsets then this will have a different
+	 * extent in each level resolution. In this case we need to know the extent for each level.
+	 * @return Extent
+	 */
+	public Extent getExtent() {
+		WMTSDataParameters p = (WMTSDataParameters)parameters;
+		if(gridSubsets) {
+			WMTSLayer layer = p.getLayer();
+			WMTSBoundingBox bbox = layer.getWGS84BBox();
+			return new ExtentImpl(bbox.toRectangle2D());
+		} else {
+			/*WMTSTileMatrixSet tileMatrixSet = getTileMatrixSetLink().getTileMatrixSet();
+			
+			//Si ya se han calculado los niveles es q el extent es v�lido sino el nivel ser� el 0
+			double scale = 0D;
+			int level = 0;
+			if(extentByLevel != null && p.getExtent() != null) {
+				scale = getScale(p.getExtent(), p.getWidth());
+				try {
+					level = getLevelFromScale(scale, tileMatrixSet);
+				} catch (RasterDriverException e) {
+					e.printStackTrace();
+				}				
+			}
+			
+			Extent[] ext = getExtentByResolutionLevel();
+			
+			if(ext != null && level >= 0 && level < ext.length)
+				return ext[level];*/
+			if(bbox == null)
+				getExtentByResolutionLevel();
+			return bbox;
+		}
+	}
+	
+	/**
+	 * Gets the suffix of the downloaded image
+	 * @return
+	 */
+	public String getFileSuffix() {
+		WMTSDataParameters p = (WMTSDataParameters)parameters;
+		String format = p.getImageFormat();
+		if (format == null){
+			return "xml";
+		}
+		if (format.indexOf("png") >= 0){
+	        return "png";
+		}	
+	    if (format.indexOf("xml") >= 0){
+	        return "xml";
+	    }	
+	    if (format.indexOf("gif") >= 0){
+	        return "gif";
+	    }
+	    if (format.indexOf("tif") >= 0){
+	        return "tif";
+	    }
+	    if (format.indexOf("bmp") >= 0){
+	        return "bmp";
+	    }
+	    if (format.indexOf("jpg") >= 0
+	        || format.indexOf("jpeg") >= 0){
+	        return "jpg";			 
+	    }
+		return "xml";
+	}
+
+	/**
+	 * When a layer doesn't have grid subsets this will have a different bounding
+	 * box by resolution level. This function calculates and returns the array of
+	 * extents, one by resolution level.
+	 * @return
+	 */
+	public Extent[] getExtentByResolutionLevel() {
+		if(extentByLevel == null) {
+			WMTSDataParameters p = (WMTSDataParameters)parameters;
+			WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+			WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+			
+	    	double widthMtsTile = 0;
+	    	double heightMtsTile = 0;
+			ArrayList<?> tileMatrixList = tileMatrixSet.getTileMatrix();
+			extentByLevel = new ExtentImpl[tileMatrixList.size()];
+			double minX = 0;
+			double minY = 0;
+			double maxX = 0;
+			double maxY = 0;
+			for (int i = 0; i < tileMatrixList.size(); i++) {
+				WMTSTileMatrix tileMatrix = (WMTSTileMatrix)tileMatrixList.get(i);
+		    	if(!p.isProjected()) {
+		    		widthMtsTile = (tileMatrix.getScaleDenominator() * tileMatrix.getTileWidth() * 0.28) / (MTS_X_GRADO * 1000);
+		    		heightMtsTile = (tileMatrix.getScaleDenominator() * tileMatrix.getTileWidth() * 0.28) / (MTS_X_GRADO * 1000);
+		    	} else {
+		    		widthMtsTile = (tileMatrix.getScaleDenominator() * tileMatrix.getTileWidth() * 0.28) / 1000;
+		    		heightMtsTile = (tileMatrix.getScaleDenominator() * tileMatrix.getTileWidth() * 0.28) / 1000;
+		    	}
+		    	
+		    	double h = Math.abs(tileMatrix.getTopLeftCorner()[0] - (tileMatrix.getTopLeftCorner()[0] - (tileMatrix.getMatrixHeight() * heightMtsTile)));
+		    	Rectangle2D r = new Rectangle2D.Double(
+		    			tileMatrix.getTopLeftCorner()[1], 
+		    			tileMatrix.getTopLeftCorner()[0] - h,
+		    			Math.abs(tileMatrix.getTopLeftCorner()[1] - (tileMatrix.getTopLeftCorner()[1] + (tileMatrix.getMatrixWidth() * widthMtsTile))),
+		    			h);
+		    	extentByLevel[i] = new ExtentImpl(r);
+		    	if(i == 0) {
+		    		minX = extentByLevel[i].getMin().getX();
+		    		minY = extentByLevel[i].getMin().getY();
+		    		maxX = extentByLevel[i].getMax().getX();
+		    		maxY = extentByLevel[i].getMax().getY();
+		    	} else {
+		    		minX = Math.min(minX, extentByLevel[i].getMin().getX());
+		    		minY = Math.min(minY, extentByLevel[i].getMin().getY());
+		    		maxX = Math.max(maxX, extentByLevel[i].getMax().getX());
+		    		maxY = Math.max(maxY, extentByLevel[i].getMax().getY());
+		    	}
+			}
+			bbox = new ExtentImpl(minX, maxY, maxX, minY);
+		}
+		return extentByLevel;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RemoteRasterProvider#getLayerExtent(java.lang.String, java.lang.String)
+	 */
+	public Rectangle2D getLayerExtent(String layerName, String srs) throws RemoteServiceException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#load()
+	 */
+	public RasterProvider load() {
+		return this;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#isOpen()
+	 */
+	public boolean isOpen() {
+		return open;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#close()
+	 */
+	public void close() {
+		open = false;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getTransparency()
+	 */
+	public Transparency getTransparency() {
+		if(lastFileTransparency == null) {
+			lastFileTransparency = new DataStoreTransparency();
+			lastFileTransparency.setTransparencyBand(3);
+		}
+		return lastFileTransparency;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#translateFileName(java.lang.String)
+	 */
+	public String translateFileName(String fileName) {
+		return fileName;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setView(org.gvsig.fmap.dal.coverage.datastruct.Extent)
+	 */
+	public void setView(Extent e) {
+		viewRequest = e;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getView()
+	 */
+	public Extent getView() {
+		return viewRequest;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWidth()
+	 */
+	public double getWidth() {
+		WMTSDataParameters p = (WMTSDataParameters)parameters;
+		if (lastWidthRequest <= 0) 
+			return p.getWidth();
+		return lastWidthRequest;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getHeight()
+	 */
+	public double getHeight() {
+		WMTSDataParameters p = (WMTSDataParameters)parameters;
+		if (lastHeightRequest <= 0) 
+			return p.getHeight();
+		return lastHeightRequest;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#readCompleteLine(int, int)
+	 */
+	public Object readCompleteLine(int line, int band)
+		throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
+		return null;
+	}
+	
+	/**
+	 * When the remote layer has fixed size this method downloads the file and return its reference. 
+	 * File layer has in the long side FIXED_SIZE pixels and the bounding box is complete. This file could be
+	 * useful to build an histogram or calculate statistics. This represents a sample of data.
+	 * @return
+	 * @throws RasterDriverException
+	 */
+	public File getFileLayer() throws RasterDriverException {
+		return null;
+	}
+
+	/**
+	 * Reads a complete block of data and returns an tridimensional array of the right type. This function is useful
+	 * to read a file very fast without setting a view. In a WMTS service when the size is fixed then it will read the
+	 * entire image but when the source hasn't pixel size it will read a sample of data. This set of data will have
+	 * the size defined in FIXED_SIZE. 
+	 * 
+	 * @param pos Posici�n donde se empieza  a leer
+	 * @param blockHeight Altura m�xima del bloque leido
+	 * @return Object que es un array tridimendional del tipo de datos del raster. (Bandas X Filas X Columnas)
+	 * @throws InvalidSetViewException
+	 * @throws FileNotOpenException
+	 * @throws RasterDriverException
+	 */
+	public Object readBlock(int pos, int blockHeight, double scale) 
+	throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RemoteRasterProvider#getLastRequestHeight()
+	 */
+	public double getLastRequestHeight() throws RasterDriverException {
+		return 0;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RemoteRasterProvider#getLastRequestWidth()
+	 */
+	public double getLastRequestWidth() throws RasterDriverException {
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getData(int, int, int)
+	 */
+	public Object getData(int x, int y, int band)
+		throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
+		return null;
+	}
+	
+	/**
+	 * Assigns the list of bands RGB and read a window of data
+	 * @param rasterBuf
+	 * @param bandList
+	 * @param lastFile
+	 * @param ulx
+	 * @param uly
+	 * @param lrx
+	 * @param lry
+	 * @return
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
+	 */
+	public Buffer getBuffer(Buffer rasterBuf, BandList bandList, File lastFile, 
+			double ulx, double uly, double lrx, double lry) throws RasterDriverException, ProcessInterruptedException {
+		return null;
+	}
+	
+	/**
+	 * Gets the tile matrix from the selected level
+	 * @param level
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	private WMTSTileMatrix getTileMatrixByLevel(int level) {
+		level = adjustLevel(level);
+		
+		WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+		WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		ArrayList tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits();
+		
+		WMTSTileMatrixLimits tileMatrixLimits = null;
+		WMTSTileMatrix tileMatrix = (WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level);
+		if(hasGridSubsets()) {
+			tileMatrixLimits = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level);
+			tileMatrix = tileMatrixLimits.getTileMatrix();
+		}
+		return tileMatrix;
+	}
+	
+	/**
+	 * Returns the number of levels
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	public int getZoomLevels() {
+		WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+		WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		if(hasGridSubsets()) {
+			ArrayList tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits();
+			return Math.min(tileMatrixSet.getTileMatrix().size(), tileMatrixSetLimits.size());
+		}
+		return tileMatrixSet.getTileMatrix().size();
+		
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#getCoordsInTheNearestLevel(org.gvsig.fmap.dal.coverage.datastruct.Extent, int, int)
+	 */
+	public Extent getCoordsInTheNearestLevel(Extent extent, int w, int h) {
+		double[] pixelSizes = getPixelSizeByLevel();
+		double currentPixelSize = extent.width() / (double)w;
+		
+		int level = 0;
+		for (int i = 0; i < (pixelSizes.length - 1); i++) {
+			if(currentPixelSize < pixelSizes[i] && currentPixelSize >= pixelSizes[i + 1]) {
+				level = i + 1;
+				break;
+			}
+		}
+		
+		return getZoomLevelCoordinates(level, extent, w, h);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getCoordsInLevel(java.awt.geom.Point2D, int, int, int)
+	 */
+	public Extent getCoordsInLevel(Point2D viewCenter, int level, int w, int h) {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		level = adjustLevel(level);
+		WMTSTileMatrix tileMatrix = getTileMatrixByLevel(level);
+		
+		boolean proj = p.isProjected();
+		
+		double psX = tileMatrix.getWidthWCTile(proj) / tileMatrix.getTileWidth();
+		double psY = tileMatrix.getHeightWCTile(proj) / tileMatrix.getTileHeight();
+		
+		double ulx = viewCenter.getX() - ((w / 2) * psX);
+		double uly = viewCenter.getY() - ((h / 2) * psY);
+		double lrx = ulx + (w * psX);
+		double lry = uly + (h * psY);
+		return new ExtentImpl(ulx, uly, lrx, lry);
+	}
+	
+	/**
+	 * Calculates the extent of a zoom level using other extent as a reference. The new extent is 
+	 * calculated with the same coordinate at the center. 
+	 * @param level
+	 * @param extent
+	 * @param w
+	 * @param h
+	 * @return
+	 */
+	public Extent getZoomLevelCoordinates(int level, Extent extent, int w, int h) {
+		double centerX = extent.getCenterX();
+		double centerY = extent.getCenterY();
+		return getCoordsInLevel(new Point2D.Double(centerX, centerY), level, w, h);
+	}
+	
+	/**
+	 * Returns a list of pixel sizes by level
+	 * @return
+	 */
+	public double[] getPixelSizeByLevel() {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		double[] list = new double[getZoomLevels()];
+		
+		for (int i = 0; i < getZoomLevels(); i++) {
+			WMTSTileMatrix tileMatrix = getTileMatrixByLevel(i);
+			list[i] = math.adjustDouble(tileMatrix.getWidthWCTile(p.isProjected()) / tileMatrix.getTileWidth());
+		}
+		return list;
+	}
+	
+	/**
+	 * Adjust de level to the range
+	 * @param level
+	 * @return
+	 */
+	private int adjustLevel(int level) {
+		if(level < 0)
+			level = 0;
+		if(level > getZoomLevels())
+			level = getZoomLevels();
+		return level;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.TiledRasterProvider#getTile(int, int, int, org.gvsig.fmap.dal.coverage.datastruct.Extent)
+	 */
+	public org.gvsig.raster.cache.tile.Tile getTile(DefaultRasterQuery q) throws TileGettingException {
+		//q.getResolutionLevel(), q.getTileCol(), q.getTileRow(), q.getBBox(), q.getCacheStruct()!
+		
+		CacheStruct str = getTileServer().getStruct();
+		
+		//1-Selecci�n de WMTSTileMatrixSet por srs
+		WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+		WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		ArrayList<?> tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits();
+		
+		WMTSTileMatrix tileMatrix = (WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(q.getResolutionLevel());
+		if(gridSubsets) {
+			WMTSTileMatrixLimits tileMatrixLimits = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(q.getResolutionLevel());
+			tileMatrix = tileMatrixLimits.getTileMatrix();
+		}
+		int bufWidth = tileMatrix.getTileWidth();
+		int bufHeight = tileMatrix.getTileHeight();
+		
+		try {
+			Rectangle2D r = q.getBBox().toRectangle2D();//new Rectangle2D.Double(Math.min(minX, maxX), Math.min(minY, maxY), Math.abs(maxX - minX), Math.abs(maxY - minY));
+			WMTSStatus status = buildWMTSStatus(r, bufWidth , bufHeight);
+			
+			int[] size = str.getTileSizeByLevel(q.getResolutionLevel());
+			Tile tile = tileMatrix.new Tile(size[0], size[1], 
+					q.getTileRow(), q.getTileCol(), 
+					q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY());
+			
+			File file = getConnector().getTile(status, null);
+			tile.file = file;
+			//Creamos un BandList con todas las bandas del fichero
+			BandList bandList = new BandListImpl();
+			for(int i = 0; i < getBandCount(); i++) {
+				try {
+					DatasetBand band = new DatasetBandImpl(getURIOfFirstProvider(), i, getDataType()[i], getBandCount());
+					bandList.addBand(band, i);
+				} catch(BandNotFoundInListException e) {
+					//No a�adimos la banda
+				}
+			}
+			return drawTile(tile, null, bandList);
+		} catch (WMTSException e) {
+			throw new TileGettingException("Error getting tiles", e);
+		} catch (ServerErrorException e) {
+			throw new TileGettingException("Error getting tiles", e);
+		} catch (RasterDriverException e) {
+			throw new TileGettingException("Error getting tiles", e);
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, org.gvsig.fmap.dal.coverage.grid.render.TileListener, int)
+	 */
+	public void getWindow(Extent ex, int bufWidth, int bufHeight, 
+			BandList bandList, TileListener listener, TaskStatus taskStatus) throws ProcessInterruptedException, RasterDriverException {
+		Rectangle2D r = ex.toRectangle2D();//new Rectangle2D.Double(Math.min(minX, maxX), Math.min(minY, maxY), Math.abs(maxX - minX), Math.abs(maxY - minY));
+		WMTSStatus status = buildWMTSStatus(r, bufWidth, bufHeight);
+		request(status, bandList, listener, requestType);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
+	 */
+	public Buffer getWindow(Extent extent, int bufWidth, int bufHeight, 
+			BandList bandList, Buffer rasterBuf, boolean adjustToExtent, TaskStatus taskStatus) throws ProcessInterruptedException, RasterDriverException {
+		Rectangle2D r = extent.toRectangle2D();//new Rectangle2D.Double(Math.min(ulx, lrx), Math.min(lry, uly), Math.abs(lrx - ulx), Math.abs(uly - lry));
+		WMTSStatus status = buildWMTSStatus(r, bufWidth, bufHeight);
+		org.gvsig.raster.cache.tile.Tile[] tileList = request(status, bandList, null, requestType);
+		MemoryMatrixBuffer matrixBuffer = new MemoryMatrixBuffer(tileList);
+		return matrixBuffer.getWindow(extent, rasterBuf);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(org.gvsig.fmap.dal.coverage.datastruct.Extent, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
+	 */
+	public Buffer getWindow(Extent extent, BandList bandList, Buffer rasterBuf, TaskStatus taskStatus) 
+		throws ProcessInterruptedException, RasterDriverException {
+		lastWidthRequest = rasterBuf.getWidth();
+		lastHeightRequest = rasterBuf.getHeight();
+		Rectangle2D r = extent.toRectangle2D();//new Rectangle2D.Double(Math.min(ulx, lrx), Math.min(lry, uly), Math.abs(lrx - ulx), Math.abs(uly - lry));
+		WMTSStatus status = buildWMTSStatus(r, lastWidthRequest, lastHeightRequest);
+		org.gvsig.raster.cache.tile.Tile[] tileList = request(status, bandList, null, requestType);
+		MemoryMatrixBuffer matrixBuffer = new MemoryMatrixBuffer(tileList);
+		return matrixBuffer.getWindow(extent, rasterBuf);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
+	 */
+	public Buffer getWindow(double ulx, double uly, double w, double h, 
+			BandList bandList, Buffer rasterBuf, boolean adjustToExtent, TaskStatus taskStatus) throws ProcessInterruptedException, RasterDriverException {
+		lastWidthRequest = rasterBuf.getWidth();
+		lastHeightRequest = rasterBuf.getHeight();
+		Rectangle2D r = new Rectangle2D.Double(ulx, uly - h, w, h);
+		WMTSStatus status = buildWMTSStatus(r, lastWidthRequest, lastHeightRequest);
+		org.gvsig.raster.cache.tile.Tile[] tileList = request(status, bandList, null, requestType);
+		MemoryMatrixBuffer matrixBuffer = new MemoryMatrixBuffer(tileList);
+		return matrixBuffer.getWindow(new ExtentImpl(ulx, uly, ulx + w, uly - h), rasterBuf);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(int, int, int, int, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
+	 */
+	public Buffer getWindow(int x, int y, int w, int h, BandList bandList, Buffer rasterBuf, TaskStatus status) throws ProcessInterruptedException, RasterDriverException {
+		lastWidthRequest = rasterBuf.getWidth();
+		lastHeightRequest = rasterBuf.getHeight();
+		return null;
+	}
+	
+	/**
+	 * Gets the information from a point 
+	 * @param wcx
+	 * @param wcy
+	 * @param level
+	 * @return
+	 * @throws RasterDriverException
+	 */
+	public String getFeatureInfo(double wcx, double wcy, int level) throws RasterDriverException {
+		PointInfo pointInfo = new PointInfo(new Point2D.Double(wcx, wcy));
+		pointInfo.level = level;
+		getTileInfo(pointInfo);
+		
+		WMTSConnector connector = null;
+		try {
+			connector = getConnector();
+			lastStatus.setTileRow((int)pointInfo.tile.getX());
+			lastStatus.setTileCol((int)pointInfo.tile.getY());
+			
+			String fi = connector.getFeatureInfo(lastStatus, (int)pointInfo.pixelInTile.getX(), (int)pointInfo.pixelInTile.getY(), null);
+			return fi;
+		} catch (WMTSException e) {
+			throw new RasterDriverException("Error getting the connector object", e);
+		} catch (ServerErrorException e) {
+			throw new RasterDriverException("Error getting the connector object", e);
+		}
+	}
+	
+	/**
+	 * Gets a tile position from a world coordinates point and a resolution level
+	 * @param point
+	 * @param level
+	 * @return An array with two elements. The first is the row and the second the column
+	 * of the tile in the tile matrix
+	 */
+	@SuppressWarnings({ "unchecked"})
+	private void getTileInfo(PointInfo pointInfo) {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		
+		WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+		WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		ArrayList tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits();
+		
+		WMTSTileMatrixLimits tileMatrixLimits = null;
+		WMTSTileMatrix tileMatrix = (WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(pointInfo.level);
+		if(hasGridSubsets()) {
+			tileMatrixLimits = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(pointInfo.level);
+			tileMatrix = tileMatrixLimits.getTileMatrix();
+		}
+		
+		ArrayList<Tile> tiles = null;
+		if(hasGridSubsets())
+			tiles = tileMatrix.contains(p.isProjected(), tileMatrixLimits, pointInfo.worldCoord, getExtent().toRectangle2D());
+		else
+			tiles = tileMatrix.contains(p.isProjected(), pointInfo.worldCoord, getExtent().toRectangle2D());
+		
+		//Tile row and column
+		pointInfo.tile = new Point2D.Double(tiles.get(0).row, tiles.get(0).col);
+		
+		//Desplazamiento en pixels dentro del tile
+		Point2D rasterPoint = tiles.get(0).worldToRaster(pointInfo.worldCoord);
+		pointInfo.pixelInTile = new Point2D.Double(rasterPoint.getX(), rasterPoint.getY());
+	}
+	
+	/**
+	 * Builds the WMTSStatus object using the parameters and the request bounding box. 
+	 * @param r
+	 * @param bufWidth
+	 * @return
+	 * @throws RasterDriverException
+	 */
+	@SuppressWarnings("unchecked")
+	public WMTSStatus buildWMTSStatus(Rectangle2D r, int bufWidth, int bufHeight) throws RasterDriverException {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		
+		//Mantiene actualizados los par�metros del WMTSStoreParameters con la �ltima petici�n hecha
+		p.setExtent(r);
+		p.setWidth(bufWidth);
+		p.setHeight(bufHeight);
+		
+		lastWidthRequest = bufWidth;
+		lastHeightRequest = bufHeight;
+		
+		//1-Selecci�n de WMTSTileMatrixSet por srs
+		WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+		WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		ArrayList tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits();
+		int initialLevel = p.getLayer().getInitialLevel(tileMatrixSet.getIdentifier());
+		
+		//Esto hace lo mismo que getScale y getLevelFromScale
+		/*int level = 0;
+		double[] pixelSizes = getPixelSizeByLevel();
+		double psViewPort = math.adjustDouble(r.getWidth() / (double)bufWidth);
+		for (int i = 0; i < pixelSizes.length - 1; i++) {
+			if(psViewPort <= pixelSizes[i] && psViewPort > pixelSizes[i + 1]) {
+				level = i;
+				break;
+			}
+		}*/
+		
+		//2-Calculo de la escala
+		double scale = getScale(r, bufWidth);
+		
+		//3-Selecci�n del nivel a partir de la escala
+		int level = getLevelFromScale(scale, tileMatrixSet);
+		
+		//Para evitar que se salga del array si la capa tiene menos niveles que el tilematrixset
+		int dif = 0;
+		if(gridSubsets)
+			dif = (level - initialLevel) >= tileMatrixSetLimits.size() ?  (level - initialLevel) - tileMatrixSetLimits.size() + 1 : 0;
+		
+		//4-Obtenemos la matriz de tiles y los l�mites si tiene subsets
+		@SuppressWarnings("unused")
+		WMTSTileMatrixLimits tileMatrixLimits = null;
+		WMTSTileMatrix tileMatrix = (WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level - dif);
+		if(gridSubsets)
+			tileMatrixLimits = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level - initialLevel - dif);
+		
+		//5-Selecci�n de tiles que entran en esta bounding box
+		ArrayList<Tile> tiles = null;
+		/*if(gridSubsets)
+			tiles = tileMatrix.intersects(p.isProjected(), tileMatrixLimits, r, getExtent().toRectangle2D());
+		else*/
+		Extent[] extList = getExtentByResolutionLevel();
+		tiles = tileMatrix.intersects(p.isProjected(), r, extList[level].toRectangle2D());
+		
+		//6-Petici�n
+		WMTSStatus status = new WMTSStatus();
+		status.setTileList(tiles);
+		status.setLayer(p.getLayer().getIdentifier());//.substring(p.getLayer().getIdentifier().indexOf("_") + 1));
+		status.setFormat(p.getImageFormat());
+		status.setInfoFormat(p.getInfoFormat());
+		status.setStyle(p.getStyle() != null ? p.getStyle().getIdentifier() : "");
+		status.setTileMatrixSet(tileMatrixSet.getIdentifier());
+		status.setTileMatrix(tileMatrix.getIdentifier());
+		status.setLevel(level - dif);
+		this.lastStatus = status;
+		
+		return status;
+	}
+	
+	/**
+	 * Gets the resolution level from the real coordinates
+	 * @param r
+	 * @param 
+	 * @return
+	 * @throws RasterDriverException
+	 */
+	public int getLevelFromRealCoords(Rectangle2D r, int width) throws RasterDriverException {
+		double scale = getScale(r, width);
+		WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+		WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		return getLevelFromScale(scale, tileMatrixSet);
+	}
+	
+	/**
+	 * Gets the resolution level from the scale
+	 * @param scale
+	 * @param tileMatrixSet
+	 * @return
+	 * @throws RasterDriverException
+	 */
+	public int getLevelFromScale(double scale, WMTSTileMatrixSet tileMatrixSet) throws RasterDriverException {
+		//Recorremos los tileMatrix para obtener la escala m�s aproximada
+		int levelModifier = 0;
+		scale = math.adjustDouble(scale);
+		try {
+			for (int resolutionLevel = 0; resolutionLevel < tileMatrixSet.getTileMatrix().size(); resolutionLevel++) {
+				WMTSTileMatrix tm = (WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(resolutionLevel);
+				double scaleDenominator = math.adjustDouble(tm.getScaleDenominator());
+				if(scale >= scaleDenominator) {
+					return Math.max(resolutionLevel + levelModifier, 0);
+				}
+			}
+		} catch (IndexOutOfBoundsException e) {
+			throw new RasterDriverException("Error in this resolution level", e);
+		}
+		return 0;
+	}
+	
+	/**
+	 * Get the tile matrix set using the crs
+	 * @param srs
+	 * @return
+	 */
+	public WMTSTileMatrixSetLink getTileMatrixSetLink() {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		ArrayList<?> tileMatrixSetLinkList = p.getLayer().getTileMatrixSetLink();
+		for (int i = 0; i < tileMatrixSetLinkList.size(); i++) {
+			WMTSTileMatrixSetLink tileMatrixSetLink = (WMTSTileMatrixSetLink)tileMatrixSetLinkList.get(i);
+			String srsTileSet = tileMatrixSetLink.getTileMatrixSet().getSupportedCRS();
+			if(srsTileSet.compareTo(p.getSRSCode()) == 0) {
+				return tileMatrixSetLink;
+			}
+		}
+		if(tileMatrixSetLinkList != null && tileMatrixSetLinkList.size() > 0)
+			return (WMTSTileMatrixSetLink)tileMatrixSetLinkList.get(0);
+		return null;
+	}
+	
+	/**
+	 * Gets the scale using the extent and the width in pixels.
+	 * @param r
+	 * @param width
+	 * @return
+	 */
+	private double getScale(Rectangle2D r, int width) {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		if(!p.isProjected()) {
+			return (r.getWidth() * MTS_X_GRADO) / (width * 0.00028);
+		} else
+			return (r.getWidth()) / (width * 0.00028);
+	}
+	
+	/**
+	 * Throw a request
+	 * @param status
+	 * @param bandList
+	 * @param listener
+	 * @param alphaBandNumber 
+	 * @return returns a buffer if the listener is null. In any other case it return null.
+	 * @throws RasterDriverException 
+	 * @throws ProcessInterruptedException 
+	 */
+	@SuppressWarnings("unchecked")
+	private synchronized org.gvsig.raster.cache.tile.Tile[] request(
+			WMTSStatus status, BandList bandList, TileListener listener, int requestType) throws RasterDriverException, ProcessInterruptedException {
+		//WMTSDataParameters p = (WMTSDataParameters)param;
+		WMTSConnector connector = null;
+		try {
+			connector = getConnector();
+		} catch (WMTSException e) {
+			throw new RasterDriverException("Error getting the connector object", e);
+		}
+		
+		if(connector == null)
+			throw new RasterDriverException("Error getting the connector object");
+		
+		ArrayList<Tile> tiles = status.getTileList();
+		
+		TilePipe pipe = new TilePipe();
+		//TilePipe2 pipe = new TilePipe2();
+		//TileThreadPool pool = null;
+		
+		//Caso 1: Lanza un thread que gestiona que no se lancen muchos threads a la vez
+		if(requestType == LIMITED_THREADS) {
+			RequestThreadManager threadManager = new RequestThreadManager(pipe, tiles, status);
+			pipe.setRequestManager(threadManager);
+			threadManager.start();
+		//Caso 2: Lanza todos los threads
+		} else if(requestType == UNLIMITED_THREADS) {
+			for (int i = 0; i < tiles.size(); i++) {
+				Tile tile = tiles.get(i);
+				WMTSStatus statusCopy = status.cloneStatus();
+				statusCopy.setTileRow(tile.row);
+				statusCopy.setTileCol(tile.col);
+				new RequestTileLauncher(pipe, statusCopy, tile).start();
+			}
+		}
+		
+		org.gvsig.raster.cache.tile.Tile[] tileList = new org.gvsig.raster.cache.tile.Tile[tiles.size()]; 
+		
+		if(requestType == LIMITED_THREADS || requestType == UNLIMITED_THREADS) {
+			int nCollected = 0;
+			while (nCollected < tiles.size()) {
+				Tile tile = pipe.getTile();
+				tileList[nCollected] = drawTile(tile, listener, bandList);
+				nCollected ++;
+			}
+		}
+		
+		if(requestType == SEQUENTIAL) {
+			for (int i = 0; i < tiles.size(); i++) {
+				Tile tile = tiles.get(i);
+				status.setTileRow(tile.row);
+				status.setTileCol(tile.col);
+				//TODO:Cancelaci�n
+				try {
+					File file = connector.getTile(status, null);
+					tile.file = file;
+					tileList[i] = drawTile(tile, listener, bandList);
+				} catch (WMTSException e) {
+					throw new RasterDriverException("Error getting tiles", e);
+				} catch (ServerErrorException e) {
+					throw new RasterDriverException("Error getting tiles", e);
+				}
+			}
+		}
+		if(listener != null) 
+			listener.endReading();
+		
+		return tileList;
+	}
+	
+	/**
+	 * Reads a tile with gdal and calls the method nextBuffer
+	 * @param tile
+	 * @param listener
+	 * @param bandList
+	 * @return
+	 * @throws RasterDriverException
+	 */
+	private synchronized org.gvsig.raster.cache.tile.Tile drawTile(Tile tile, TileListener listener, BandList bandList) throws RasterDriverException {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		try {
+			String serverName = bandList.getBand(0).getFileName();
+			for (int j = 0; j < bandList.getBandCount(); j++) {
+				bandList.getBand(j).setFileName(tile.file.getPath());
+			}
+			
+			DefaultRasterProvider driver = DefaultProviderServices.loadProvider(tile.file);
+			colorTable = driver.getColorTable();
+			bandCount = driver.getBandCount();
+			lastFileTransparency = (DataStoreTransparency)driver.getTransparency();
+			Buffer rasterBuf = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], tile.wPx, tile.hPx, 3, true);
+			
+			DefaultRasterQuery q = (DefaultRasterQuery)RasterLocator.getManager().createQuery();
+			q.setAreaOfInterest(0, 0, tile.wPx, tile.hPx);
+			q.setBandList(bandList);
+			q.setBuffer(rasterBuf);
+			Buffer buf = driver.getDataSet(q);
+			
+			buf.setDataExtent(new Rectangle2D.Double(Math.min(tile.ulx, tile.lrx), Math.min(tile.uly, tile.lry), Math.abs(tile.ulx - tile.lrx), Math.abs(tile.uly - tile.lry)));
+			
+			Buffer alphaBand = null;
+			if(p.getAlphaBand() != -1 && listener != null && p.getAlphaBand() < bandCount) {
+				alphaBand = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], tile.wPx, tile.hPx, 1, true);
+				int[] oldDB = bandList.getDrawableBands();
+				bandList.setDrawableBands(new int[]{p.getAlphaBand()});
+				q.setBandList(bandList);
+				q.setBuffer(alphaBand);
+				alphaBand = driver.getDataSet(q);
+				bandList.setDrawableBands(oldDB);
+			}
+
+			for (int j = 0; j < bandList.getBandCount(); j++) {
+				bandList.getBand(j).setFileName(serverName);
+			}
+
+			driver.close();
+
+
+			TileCacheManager m = TileCacheLocator.getManager();
+			org.gvsig.raster.cache.tile.Tile t = m.createTile(-1, tile.row, tile.col);
+			t.setData(new Object[]{buf, alphaBand});
+			t.setUl(new Point2D.Double(tile.ulx, tile.uly));
+			t.setLr(new Point2D.Double(tile.lrx, tile.lry));
+			t.setDownloaderParams("AffineTransform", getAffineTransform());
+			t.setDownloaderParams("Tiling", new Boolean(true));
+			if(listener != null) 
+				listener.tileReady(t);
+			else 
+				return t;
+
+		} catch (ProcessInterruptedException e) {
+		} catch (TileGettingException e) {
+			throw new RasterDriverException("Error throwing a tile", e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new RasterDriverException("Error throwing a tile", e);
+		} catch (InitializeException e) {
+			throw new RasterDriverException("Error throwing a tile", e);
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getBlockSize()
+	 */
+	public int getBlockSize() {
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setAffineTransform(java.awt.geom.AffineTransform)
+	 */
+	public void setAffineTransform(AffineTransform t){
+		
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#getOverviewCount(int)
+	 */
+	public int getOverviewCount(int band) throws BandAccessException, RasterDriverException {
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewWidth(int, int)
+	 */
+	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException {
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewHeight(int, int)
+	 */
+	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException {
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isOverviewsSupported()
+	 */
+	public boolean isOverviewsSupported() {
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isReproyectable()
+	 */
+	public boolean isReproyectable() {
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+	
+	/**
+	 * Convierte un punto desde coordenadas pixel a coordenadas del mundo.
+	 * @param pt Punto a transformar
+	 * @return punto transformado en coordenadas del mundo
+	 */
+	public Point2D rasterToWorld(Point2D pt) {
+		Point2D p = new Point2D.Double();
+		getAffineTransform().transform(pt, p);
+		return p;
+	}
+
+	/**
+	 * Convierte un punto desde del mundo a coordenadas pixel.
+	 * @param pt Punto a transformar
+	 * @return punto transformado en coordenadas pixel
+	 */
+	public Point2D worldToRaster(Point2D pt) {
+		Point2D p = new Point2D.Double();
+		try {
+			getAffineTransform().inverseTransform(pt, p);
+		} catch (NoninvertibleTransformException e) {
+			return pt;
+		}
+		return p;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#setStatus(org.gvsig.raster.impl.provider.RasterProvider)
+	 */
+	public void setStatus(RasterProvider provider) {
+		if(provider instanceof WMTSProvider) {
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RemoteRasterProvider#getLastRequest()
+	 */
+	public File getLastRequest() {
+		return lastRequest;
+	}
+	
+	/**
+	 * ASigna el par�metro de inicializaci�n del driver.
+	 */
+	@Override
+	public void setParam(DataStoreProviderServices storeServices, DataStoreParameters param) {
+		if(param instanceof WMTSDataParameters)
+			this.uri = ((WMTSDataParameters)param).getURI();
+		this.param = param;
+		this.storeServices = storeServices;
+	}
+	
+	public String getInfoByPoint(int x, int y, Extent bbox, int w, int h, ICancellable cancellable) throws InfoByPointException {
+		int level;
+		try {
+			level = getLevelFromRealCoords(bbox.toRectangle2D(), w);
+			return getFeatureInfo(x, y, level);
+		} catch (RasterDriverException e) {
+			throw new InfoByPointException("Error in getFeatureInfo", e);
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#getNearestLevel(double)
+	 */
+	public int getNearestLevel(double pixelSize) {
+		double[] pixelSizes = getPixelSizeByLevel();
+		for (int i = 0; i < pixelSizes.length - 1; i++) {
+			if(pixelSize <= pixelSizes[i] && pixelSize > pixelSizes[i + 1]) {
+				return i;
+			}
+		}
+		if(pixelSize < pixelSizes[getZoomLevels() - 1])
+			return getZoomLevels() - 1;
+		return 0;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#getTileServer()
+	 */
+	public TileServer getTileServer() {
+		if(tileServer == null) {
+			tileServer = new WMTSTileServer(this, getTileMatrixSetLink());
+		}
+		return tileServer;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getTileSize(int)
+	 */
+	public int[] getTileSize(int level) {
+		return getTileServer().getStruct().getTileSizeByLevel(level);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#isRasterEnclosed()
+	 */
+	public boolean isRasterEnclosed() {
+		return true;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RemoteRasterProvider#getBufferLastRequest()
+	 */
+	public Buffer getBufferLastRequest() throws ProcessInterruptedException, RasterDriverException {
+		return null;
+	}
+	
+	/**
+	 * Gets the srs code
+	 * @return
+	 */
+	public String getSRSCode() {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		return p.getSRSCode();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.TiledRasterProvider#getInternalProvider()
+	 */
+	public RasterProvider getInternalProvider() {
+		return this;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Histogramable#getHistogramComputer()
+	 */
+	public HistogramComputer getHistogramComputer() {
+		if (histogram == null)
+			histogram = new RemoteStoreHistogram(this);
+		return histogram;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorerParameters.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorerParameters.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorerParameters.java	(revision 1459)
@@ -0,0 +1,159 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+
+/*
+* AUTHORS (In addition to CIT):
+* 2009 IVER T.I   {{Task}}
+*/
+
+package org.gvsig.raster.wmts.io;
+
+import org.gvsig.fmap.dal.DataServerExplorerParameters;
+import org.gvsig.fmap.dal.spi.AbstractDataParameters;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DelegatedDynObject;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynField;
+import org.gvsig.tools.dynobject.DynObjectManager;
+
+/**
+ * Parameters for the WMTS provider
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSServerExplorerParameters extends AbstractDataParameters implements DataServerExplorerParameters {
+	public static final String     DYNCLASS_NAME       = "WMTSServerExplorerParameters";
+	protected static final String  FIELD_HOST          = "host";
+	protected static DynClass      DYNCLASS            = null;
+	private DelegatedDynObject     delegatedDynObject  = null;
+	private static final String    AXIS_ORDER          = "axisorder";
+	
+	
+	public WMTSServerExplorerParameters() {
+		super();
+		initialize();
+	}
+
+	protected void initialize() {
+		this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
+				.getDynObjectManager().createDynObject(
+						DYNCLASS);
+	}
+	
+	public static void registerDynClass() {
+		DynObjectManager dynman = ToolsLocator.getDynObjectManager();
+		DynClass dynClass;
+		DynField field;
+		
+		if(dynman == null)
+			return;
+		
+		if (DYNCLASS == null) {
+			dynClass = dynman.add(DYNCLASS_NAME);
+			
+			field = dynClass.addDynFieldString(FIELD_HOST);
+            field.setDescription("Uniform Resource Identifier (File name or URL)");
+            field.setMandatory(true);
+            field.setClassOfValue(String.class); 
+            
+
+			field = dynClass.addDynField(AXIS_ORDER);
+			field.setDescription("Longitude first in axis order");
+			field.setMandatory(false);
+			field.setClassOfValue(Boolean.class);
+			field.setDefaultFieldValue(new Boolean(false));
+
+			DYNCLASS = dynClass;
+		}
+
+	}
+	
+	protected DelegatedDynObject getDelegatedDynObject() {
+		return delegatedDynObject;
+	}
+	
+	/**
+	 * Returns true if the longitude is first in axis order
+	 * @return
+	 */
+	public boolean isLongitudeFirst() {
+		Object obj = getDynValue(AXIS_ORDER);
+		if(obj instanceof Boolean) {
+			Boolean b = (Boolean)getDynValue(AXIS_ORDER);
+			if(b != null)
+				return ((Boolean)b).booleanValue();
+		}
+		if(obj instanceof String) {
+			String b = (String)getDynValue(AXIS_ORDER);
+			if(b != null)
+				return new Boolean(((String)b));
+		}
+		return false;
+	}
+	
+	/**
+	 * Sets the longitude first in axis order
+	 * @param longFirst
+	 */
+	public void setLongitudeFirst(boolean longFirst) {
+		this.setDynValue(AXIS_ORDER, new Boolean(longFirst));
+	}
+	
+	/**
+	 * Gets the assigned host
+	 * @return
+	 */
+	public String getHost() {
+		return (String) this.getDynValue(FIELD_HOST);
+	}
+
+	/**
+	 * Assign the host to this explorer
+	 * @param host
+	 */
+	public void setHost(String host) {
+		this.setDynValue(FIELD_HOST, host);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.DataStoreParameters#getDataStoreName()
+	 */
+	public String getDataStoreName() {
+		return WMTSProvider.NAME;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.DataStoreParameters#getDescription()
+	 */
+	public String getDescription() {
+		return WMTSProvider.DESCRIPTION;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.DataServerExplorerParameters#getExplorerName()
+	 */
+	public String getExplorerName() {
+		return WMTSServerExplorer.NAME;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorerParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParameters.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParameters.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParameters.java	(revision 1459)
@@ -0,0 +1,194 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+
+package org.gvsig.raster.wmts.io;
+
+import java.awt.geom.Rectangle2D;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters;
+import org.gvsig.remoteclient.wmts.struct.WMTSLayer;
+import org.gvsig.remoteclient.wmts.struct.WMTSStyle;
+
+/**
+ * Parameters for the WMTS provider
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface WMTSDataParameters extends RemoteStoreParameters {
+	public static final String       DYNCLASS_NAME         = "WMTSDataParameters";
+	public static final String      FIELD_SRS             = "srs";
+	public static final String      FIELD_IMAGE_FORMAT    = "imageformat";
+	public static final String      FIELD_INFO_FORMAT     = "infoformat";
+	public static final String      FIELD_LAYER           = "layer";
+	public static final String      FIELD_STYLE           = "style";
+	public static final String      FIELD_NAME            = "name";
+	public static final String      FIELD_SRSSTR          = "srsstr";
+	public static final String      FIELD_OVERRIDE        = "override";
+	public static final String      FIELD_CANCEL          = "cancellable";
+	public static final String      FIELD_EXTENT          = "extent";
+	public static final String      FIELD_WIDTH           = "width";
+	public static final String      FIELD_HEIGHT          = "height";
+	public static final String      FIELD_DELETECACHE     = "deletecache";
+	
+	/**
+	 * Assign the fields of the selected WMTSDataParameters in the current
+	 * @param p
+	 */
+	public void assignFields(WMTSDataParameters p);
+	
+	/**
+	 * Sets the style selected
+	 * @param layer
+	 */
+	public void setStyle(WMTSStyle layer);
+	
+	/**
+	 * Gets the style
+	 * @return
+	 */
+	public WMTSStyle getStyle();
+	
+	/**
+	 * Gets the image format
+	 * @return Format
+	 */
+	public String getImageFormat();
+
+	/**
+	 * Sets the image format
+	 * @param format
+	 */
+	public void setImageFormat(String format);
+	
+	/**
+	 * Gets the format of the info by point
+	 * @return
+	 */
+	public String getInfoFormat();
+
+	/**
+	 * Sets the format of the info by point
+	 */
+	public void setInfoFormat(String format);
+	
+	/**
+	 * Sets the layer selected
+	 * @param layer
+	 */
+	public void setLayer(WMTSLayer layer);
+	
+	/**
+	 * Gets the layer
+	 * @return
+	 */
+	public WMTSLayer getLayer();
+	
+	/**
+	 * Devuelve el SRS.
+	 * @return SRS.
+	 */
+	public String getSRSCode();
+	
+	public void setSRS(String m_srs);
+	
+	public void setSRS(IProjection srs);
+
+	/**
+	 * Returns the projection
+	 * @return
+	 */
+	public IProjection getSRS();
+	
+	/**
+	 * Returns true if the layer is projected
+	 * @return
+	 */
+	public boolean isProjected();
+	
+	public String getSRSID();
+
+	public void setSRSID(String srsid);
+	
+	/**
+	 * Returns the current selected SRS.
+	 * @return
+	 */
+	public String getEPSG(String value);
+	
+	public String getName();
+
+	public void setName(String name);
+	
+	public void setCancellable(ICancellable cancel);
+	
+	public ICancellable getCancellable();
+	
+	public boolean isOverridingHost();
+	
+	public void setOverrideHost(boolean over);
+	/**
+	 * Assigns the extent. 
+	 * When a provider is initialized this will need to know what is the extent before the request.
+	 * 
+	 * @param bBox
+	 */
+	public void setExtent(Rectangle2D bBox);
+	
+	/**
+	 * Sets the width
+	 * When a provider is initialized this will need to know what is the width before the request.
+	 * @param w
+	 */
+	public void setWidth(int w);
+	
+	/**
+	 * Sets the height
+	 * When a provider is initialized this will need to know what is the height before the request.
+	 * @param h
+	 */
+	public void setHeight(int h);
+	
+	/**
+	 * Gets the bounding box
+	 * @return
+	 */
+	public Rectangle2D getExtent();
+	
+	/**
+	 * Gets the width
+	 * @return
+	 */
+	public int getWidth();
+	
+	/**
+	 * Gets the height
+	 * @return
+	 */
+	public int getHeight();
+	
+	public boolean isSizeFixed();
+
+	public void setURI(String params);
+
+	public String getURI();
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParametersImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParametersImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParametersImpl.java	(revision 1459)
@@ -0,0 +1,517 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+
+package org.gvsig.raster.wmts.io;
+
+
+import java.awt.geom.Rectangle2D;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
+import org.gvsig.remoteclient.wmts.struct.WMTSLayer;
+import org.gvsig.remoteclient.wmts.struct.WMTSStyle;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dataTypes.DataTypes;
+import org.gvsig.tools.dynobject.DelegatedDynObject;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynField;
+import org.gvsig.tools.dynobject.DynObjectManager;
+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 WMTS provider
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSDataParametersImpl extends AbstractRasterDataParameters implements WMTSDataParameters {
+	private DelegatedDynObject       delegatedDynObject    = null;
+	protected static DynClass        DYNCLASS              = null;
+	//private Logger                   log                   = LoggerFactory.getLogger(WMTSDataParametersImpl.class);
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition("WMTSDataParametersImpl_Persistent");
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					WMTSDataParametersImpl.class,
+					"WMTSDataParametersImpl_Persistent",
+					"WMTS DataParameters Persistency",
+					null, 
+					null
+			);
+			AbstractRasterDataParameters.registerPersistence(definition);
+			
+			definition.addDynFieldObject(FIELD_EXTENT).setClassOfValue(Rectangle2D.class).setMandatory(false);
+			definition.addDynFieldString(FIELD_IMAGE_FORMAT).setMandatory(false);
+			definition.addDynFieldString(FIELD_INFO_FORMAT).setMandatory(false);
+			definition.addDynFieldString(FIELD_NAME).setMandatory(false);			
+			definition.addDynFieldString(FIELD_SRSSTR).setMandatory(false);
+			definition.addDynFieldBoolean(FIELD_OVERRIDE).setMandatory(false);
+		}
+	}
+	
+	@Override
+	public void saveToState(PersistentState state) throws PersistenceException {
+		super.saveToState(state);
+		
+		state.set(FIELD_NAME, getName());	
+		state.set(FIELD_SRSSTR, getSRSCode());
+		state.set(FIELD_OVERRIDE, isOverridingHost());
+		state.set(FIELD_EXTENT, getExtent());
+		state.set(FIELD_IMAGE_FORMAT, getImageFormat());
+		state.set(FIELD_INFO_FORMAT, getInfoFormat());
+	}
+	
+	@Override
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		super.loadFromState(state);
+		
+		setImageFormat(state.getString(FIELD_IMAGE_FORMAT));
+		setInfoFormat(state.getString(FIELD_INFO_FORMAT));
+		setName(state.getString(FIELD_NAME));
+		setSRS(state.getString(FIELD_SRSSTR));
+		setOverrideHost(state.getBoolean(FIELD_OVERRIDE));
+		setExtent((Rectangle2D)state.get(FIELD_EXTENT));
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.wmts.io.WMTSDataParameters#assignFields(org.gvsig.raster.wmts.io.WMTSDataParameters)
+	 */
+	public void assignFields(WMTSDataParameters p) {
+		setImageFormat(p.getImageFormat());
+		setInfoFormat(p.getInfoFormat());
+		setName(p.getName());
+		setSRS(p.getSRSCode());
+		setOverrideHost(p.isOverridingHost());
+		setExtent(p.getExtent());
+	}
+	 
+	public WMTSDataParametersImpl() {
+		super();
+		initialize();
+	}
+	
+	protected void initialize() {
+		this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
+				.getDynObjectManager().createDynObject(
+						DYNCLASS);
+	}
+	
+	@SuppressWarnings("deprecation")
+	public static void registerDynClass() {
+		DynObjectManager dynman = ToolsLocator.getDynObjectManager();
+		DynClass dynClass;
+		DynField field;
+		
+		if(dynman == null)
+			return;
+		
+		if (DYNCLASS == null) {
+			dynClass = AbstractRasterDataParameters.registerDynClass(WMTSDataParametersImpl.DYNCLASS_NAME);
+
+			field = dynClass.addDynField(FIELD_LAYER);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Layer");
+			field.setType(DataTypes.OBJECT);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_STYLE);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Style");
+			field.setType(DataTypes.OBJECT);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_SRS);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("SRS");
+			field.setType(org.cresques.DataTypes.CRS);
+			field.setMandatory(false);
+
+			field = dynClass.addDynField(FIELD_IMAGE_FORMAT);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Image Format");
+			field.setType(DataTypes.STRING);
+			field.setMandatory(false);
+
+			field = dynClass.addDynField(FIELD_INFO_FORMAT);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Info Format");
+			field.setType(DataTypes.STRING);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_NAME);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Name");
+			field.setType(DataTypes.STRING);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_SRSSTR);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("String that represents the SRS");
+			field.setType(DataTypes.STRING);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_OVERRIDE);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Override a host capabilities");
+			field.setType(DataTypes.BOOLEAN);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_CANCEL);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Cancellable");
+			field.setType(DataTypes.OBJECT);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_EXTENT);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Extent");
+			field.setType(DataTypes.OBJECT);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_WIDTH);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Width");
+			field.setType(DataTypes.INT);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_HEIGHT);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Height");
+			field.setType(DataTypes.INT);
+			field.setMandatory(false);
+			
+			field = dynClass.addDynField(FIELD_DELETECACHE);
+			field.setTheTypeOfAvailableValues(DynField.ANY);
+			field.setDescription("Flag to delete cache the next request");
+			field.setType(DataTypes.BOOLEAN);
+			field.setMandatory(false);
+			
+			DYNCLASS = dynClass;
+		}
+
+	}
+	
+	/**
+	 * Sets the style selected
+	 * @param layer
+	 */
+	public void setStyle(WMTSStyle layer) {
+		this.setDynValue(FIELD_STYLE, layer);
+	}
+	
+	/**
+	 * Gets the style
+	 * @return
+	 */
+	public WMTSStyle getStyle() {
+		return (WMTSStyle) this.getDynValue(FIELD_STYLE);
+	}
+	
+	/**
+	 * Gets the image format
+	 * @return Format
+	 */
+	public String getImageFormat() {
+		return (String) this.getDynValue(FIELD_IMAGE_FORMAT);
+	}
+
+	/**
+	 * Sets the image format
+	 * @param format
+	 */
+	public void setImageFormat(String format) {
+		this.setDynValue(FIELD_IMAGE_FORMAT, format);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.parameter.WMTSStoreParameters#getImageFormat()
+	 */
+	public String getInfoFormat() {
+		return (String) this.getDynValue(FIELD_INFO_FORMAT);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.parameter.WMTSStoreParameters#setImageFormat(java.lang.String)
+	 */
+	public void setInfoFormat(String format) {
+		this.setDynValue(FIELD_INFO_FORMAT, format);
+	}
+	
+	/**
+	 * Sets the layer selected
+	 * @param layer
+	 */
+	public void setLayer(WMTSLayer layer) {
+		this.setDynValue(FIELD_LAYER, layer);
+	}
+	
+	/**
+	 * Gets the layer
+	 * @return
+	 */
+	public WMTSLayer getLayer() {
+		return (WMTSLayer) this.getDynValue(FIELD_LAYER);
+	}
+	
+	/**
+	 * Devuelve el SRS.
+	 * @return SRS.
+	 */
+	public String getSRSCode() {
+		return (String) this.getDynValue(FIELD_SRSSTR);
+	}
+	
+	public void setSRS(String m_srs) {
+		if(m_srs.compareTo("CRS:84") == 0)
+			m_srs = "EPSG:4326";
+		this.setDynValue(FIELD_SRSSTR, m_srs);
+		if(getEPSG(m_srs) != null)
+			setSRS(CRSFactory.getCRS(getEPSG(m_srs)));
+	}
+	
+	public void setSRS(IProjection srs) {
+		setDynValue(FIELD_SRS, srs);
+	}
+
+	/**
+	 * Returns the projection
+	 * @return
+	 */
+	public IProjection getSRS() {
+		if (this.getSRSID() == null) {
+			return null;
+		}
+		return (IProjection) getDynValue(FIELD_SRS);
+	}
+	
+	/**
+	 * Returns true if the layer is projected
+	 * @return
+	 */
+	public boolean isProjected() {
+		IProjection proj = getSRS();
+		if(proj == null)
+			return false;
+		else
+			return proj.isProjected();
+	}
+	
+	public String getSRSID() {
+		IProjection srs = (IProjection) getDynValue(FIELD_SRS);
+		if (srs == null) {
+			return null;
+		}
+		return srs.getAbrev();
+	}
+
+	public void setSRSID(String srsid) {
+		if (srsid == null) {
+			setDynValue(FIELD_SRS, null);
+		} else {
+			setDynValue(FIELD_SRS, CRSFactory.getCRS(getEPSG(srsid)));
+		}
+	}
+	
+	/**
+	 * Returns the current selected SRS.
+	 * @return
+	 */
+	public String getEPSG(String value) {
+		if(value != null) {
+			if(value.compareTo("CRS:84") == 0)
+				return "EPSG:4326";
+
+			String s = value.substring(value.lastIndexOf(":") + 1);
+			return "EPSG:" + s;
+		}
+		return null;
+	}
+	
+	public String getName() {
+		return (String) this.getDynValue(FIELD_NAME);
+	}
+
+	public void setName(String name) {
+		this.setDynValue(FIELD_NAME, name);
+	}
+	
+	public void setCancellable(ICancellable cancel) {
+		this.setDynValue(FIELD_CANCEL, cancel);
+	}
+	
+	public ICancellable getCancellable() {
+		return (ICancellable) this.getDynValue(FIELD_CANCEL);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.RasterStoreParameters#isOverridingHost()
+	 */
+	public boolean isOverridingHost() {
+		Boolean b = (Boolean)getDynValue(FIELD_OVERRIDE);
+		if(b != null)
+			return ((Boolean)b).booleanValue();
+		return false;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.RasterStoreParameters#setOverrideHost(boolean)
+	 */
+	public void setOverrideHost(boolean over) {
+		this.setDynValue(FIELD_OVERRIDE, new Boolean(over));;
+	}
+
+	/**
+	 * Assigns the extent. 
+	 * When a provider is initialized this will need to know what is the extent before the request.
+	 * 
+	 * @param bBox
+	 */
+	public void setExtent(Rectangle2D bBox) {
+		this.setDynValue(FIELD_EXTENT, bBox);
+	}
+	
+	/**
+	 * Sets the width
+	 * When a provider is initialized this will need to know what is the width before the request.
+	 * @param w
+	 */
+	public void setWidth(int w) {
+		this.setDynValue(FIELD_WIDTH, new Integer(w));
+	}
+	
+	/**
+	 * Sets the height
+	 * When a provider is initialized this will need to know what is the height before the request.
+	 * @param h
+	 */
+	public void setHeight(int h) {
+		this.setDynValue(FIELD_HEIGHT, new Integer(h));
+	}
+	
+	/**
+	 * Gets the bounding box
+	 * @return
+	 */
+	public Rectangle2D getExtent() {
+		return (Rectangle2D)getDynValue(FIELD_EXTENT);
+	}
+	
+	/**
+	 * Gets the width
+	 * @return
+	 */
+	public int getWidth() {
+		Integer b = (Integer)getDynValue(FIELD_WIDTH);
+		if(b != null)
+			return ((Integer)b).intValue();
+		return 0;
+	}
+	
+	/**
+	 * Gets the height
+	 * @return
+	 */
+	public int getHeight() {
+		Integer b = (Integer)getDynValue(FIELD_HEIGHT);
+		if(b != null)
+			return ((Integer)b).intValue();
+		return 0;
+	}
+
+	//**********************************************
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.DataStoreParameters#getDataStoreName()
+	 */
+	public String getDataStoreName() {
+		return WMTSProvider.NAME;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.DataStoreParameters#getDescription()
+	 */
+	public String getDescription() {
+		return WMTSProvider.DESCRIPTION;
+	}
+
+	public String getExplorerName() {
+		return WMTSServerExplorer.NAME;
+	}
+	
+	public boolean isValid() {
+		return (this.getURI() != null);
+	}
+	
+	protected DelegatedDynObject getDelegatedDynObject() {
+		return delegatedDynObject;
+	}
+	
+	/**
+	 * Clones this structure
+	 * @return
+	 */
+	public WMTSDataParameters clone() {
+		WMTSDataParametersImpl p = new WMTSDataParametersImpl();
+		p.setImageFormat(getImageFormat());
+		p.setInfoFormat(getInfoFormat());
+		p.setHeight(getHeight());
+		p.setWidth(getWidth());
+		p.setExtent(getExtent());
+		p.setURI(getURI());
+		p.setName(getName());
+		p.setOverrideHost(isOverridingHost());
+		p.setSRS(getSRS());
+		p.setSRS(getSRSCode());
+		p.setCancellable(getCancellable());
+		return p;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters#isSizeFixed()
+	 */
+	public boolean isSizeFixed() {
+		return true;
+	}
+
+	public void deleteCache(boolean deleteCache) {
+		this.setDynValue(FIELD_DELETECACHE, new Boolean(deleteCache));
+	}
+	
+	public boolean isDeletingCache() {
+		return ((Boolean)getDynValue(FIELD_DELETECACHE)).booleanValue();
+	}
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParametersImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/TilePipe.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/TilePipe.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/TilePipe.java	(revision 1459)
@@ -0,0 +1,106 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.io;
+
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrix.Tile;
+
+/**
+ * This class manages transactions between the producer and the consumer. The
+ * producer download tiles from a server and the consumer is a tile provider
+ * which will return downloaded tiles.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TilePipe {
+	//N�mero de threads m�ximos a lanzar para descarga. Cuando se lanzan m�s de estos el 
+	//invocador debe dormir hasta que se haya liberado alguno.
+	public static int            NTHREADS_QUEUE = 5;
+	//N�mero m�ximo de elementos en la tuberia. Cuando se llene esta el setTile de esta clase debe
+	//dormir hasta que getTile lo despierte.
+	private final static int     BUFFER_SIZE    = 10;
+	
+	private Tile                 buffer[]       = new Tile[BUFFER_SIZE];
+	private int                  next           = 0;
+	private boolean              isFull         = false;
+	private boolean              isEmpty        = true;
+	private Thread               threadManager  = null;
+
+	/**
+	 * El thread manager no se usa con la pool solo para la implementaci�n de RequestThreadManager
+	 * @param threadManager
+	 */
+	public void setRequestManager(Thread threadManager) {
+		this.threadManager = threadManager;
+	}
+	
+	/**
+	 * Sets a tile in the pipe
+	 * @param tile
+	 */
+	public synchronized void setTile(Tile tile) {
+		while( isFull == true ) {
+			try {
+				wait();
+			} catch( InterruptedException e ) {
+			}
+		}
+		buffer[next] = tile;
+		next++;
+		if( next == BUFFER_SIZE )
+			isFull = true;
+		isEmpty = false;
+		notify();
+	}
+
+	/**
+	 * Gets a tile from the pipe
+	 * @return
+	 */
+	public synchronized Tile getTile() {
+		while( isEmpty == true ) {
+			try {
+				wait();
+			} catch( InterruptedException e ) {
+			}
+		}
+        next--;
+        if( next == 0 )
+        	isEmpty = true;
+        isFull = false;
+        notify();
+        if(threadManager != null && getSize() <= NTHREADS_QUEUE) {
+        	synchronized(threadManager) {
+        		threadManager.notify();
+        	}
+        }
+        	
+        return buffer[next] ;
+	}
+	
+	/**
+	 * Returns the number of elements in the queue
+	 * @return
+	 */
+	public synchronized int getSize() {
+		return next;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/TilePipe.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/DefaultWMTSIOLibrary.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/DefaultWMTSIOLibrary.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/DefaultWMTSIOLibrary.java	(revision 1459)
@@ -0,0 +1,51 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.io;
+
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+/**
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultWMTSIOLibrary extends AbstractLibrary {	
+
+	public DefaultWMTSIOLibrary() {
+		/*super(DefaultWMTSIOLibrary.class,Library.TYPE.IMPL);
+		require(ToolsLibrary.class);
+		require(DALLibrary.class);
+		require(DALFileLibrary.class);*/
+	}
+	
+	@Override
+	protected void doInitialize() throws LibraryException {
+		//RasterLibrary.wakeUp();
+	}
+
+	@Override
+	protected void doPostInitialize() throws LibraryException {
+		WMTSServerExplorerParameters.registerDynClass();
+		WMTSDataParametersImpl.registerDynClass();
+		WMTSProvider.register();
+		WMTSDataParametersImpl.registerPersistence();
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/DefaultWMTSIOLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/TileDownloaderForWMTS.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/TileDownloaderForWMTS.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/TileDownloaderForWMTS.java	(revision 1459)
@@ -0,0 +1,103 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.io.downloader;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.URL;
+
+import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.cache.tile.exception.TileGettingException;
+import org.gvsig.raster.impl.provider.tile.BaseTileDownloader;
+import org.gvsig.raster.wmts.io.WMTSConnector;
+import org.gvsig.raster.wmts.io.WMTSDataParameters;
+import org.gvsig.raster.wmts.io.WMTSProvider;
+import org.gvsig.remoteclient.exceptions.ServerErrorException;
+import org.gvsig.remoteclient.wmts.WMTSStatus;
+import org.gvsig.remoteclient.wmts.exception.WMTSException;
+
+/** 
+ * Tile getter 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TileDownloaderForWMTS extends BaseTileDownloader {
+	private WMTSConnector             connector  = null;
+	
+	public TileDownloaderForWMTS(WMTSProvider prov, 
+			int tilePxWidth,
+			int tilePxHeight) {
+		super(prov, tilePxWidth, tilePxHeight);
+	}
+	
+	/**
+	 * Gets the connector from the URL
+	 * @return
+	 * @throws RemoteServiceException
+	 */
+	public WMTSConnector getConnector() throws WMTSException {
+		if(connector == null) {
+			WMTSDataParameters p = (WMTSDataParameters)prov.getDataParameters();
+			URL url = null;
+			try {
+				url = new URL(p.getURI());
+			} catch (Exception e) {
+				throw new WMTSException("Malformed URL",e);
+			}
+			try {
+				connector = new WMTSConnector(url);
+			} catch (ConnectException e) {
+				throw new WMTSException("Connect exception",e);
+			} catch (IOException e) {
+				throw new WMTSException("Connect exception",e);
+			}
+		}
+		return connector;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.Downloader#getTile(org.gvsig.raster.cache.tile.Tile)
+	 */
+	public synchronized Tile downloadTile(Tile tile) throws TileGettingException {
+		try {
+			WMTSStatus status = (WMTSStatus)tile.getDownloaderParams("WMTSStatus");
+			status.setTileRow(tile.getRow());
+			status.setTileCol(tile.getCol());
+			File f = getConnector().getTile(status, tile.getCancelled(), tile.getFile());
+			tile.setFile(f);
+			//Si borramos el rmf no se puede leer la etiqueta Alpha. En caso de que se modifique jgdal para
+			//poder guardar esta etiqueta deberiamos borrar el rmf para ahorrar ficheros
+			//File rmf = new File(tile.getFile().getAbsolutePath() + ".rmf");
+			//if(rmf.exists())
+				//rmf.delete();
+		} catch (WMTSException e) {
+			throw new TileGettingException(e);
+		} catch (ServerErrorException e) {
+			throw new TileGettingException(e);
+		}
+		readTileFromDisk(tile);
+		return tile;
+	}
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/TileDownloaderForWMTS.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSTileServer.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSTileServer.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSTileServer.java	(revision 1459)
@@ -0,0 +1,91 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.io.downloader;
+
+import org.gvsig.raster.cache.tile.provider.CacheStruct;
+import org.gvsig.raster.cache.tile.provider.Downloader;
+import org.gvsig.raster.cache.tile.provider.TileServer;
+import org.gvsig.raster.wmts.io.WMTSProvider;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrix;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixSetLink;
+
+/** 
+* Data server for the tile cache in a WMTSProvider 
+* @author Nacho Brodin (nachobrodin@gmail.com)
+*/
+public class WMTSTileServer implements TileServer {
+	private CacheStruct                struct               = null;
+	private Downloader                 downloader           = null;
+	private WMTSProvider               provider             = null;
+	private String                     suffix               = ".tif";
+	private WMTSTileMatrixSetLink      tileMatrixSetLink    = null;
+	
+	public WMTSTileServer(WMTSProvider prov, 
+			WMTSTileMatrixSetLink tileMatrixSetLink) {
+		this.provider = prov;
+		this.tileMatrixSetLink = tileMatrixSetLink;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.TileServer#getDownloader()
+	 */
+	public Downloader getDownloader() {
+		//if(downloader == null) {
+			int tileWidth = ((WMTSTileMatrix)tileMatrixSetLink.getTileMatrixSet().getTileMatrix().get(0)).getTileWidth();
+			int tileHeight = ((WMTSTileMatrix)tileMatrixSetLink.getTileMatrixSet().getTileMatrix().get(0)).getTileHeight();
+			downloader = new TileDownloaderForWMTS(provider, tileWidth, tileHeight);
+		//}
+		return downloader;
+	}
+
+	public CacheStruct getStruct() {
+		if(struct == null) {
+			struct = new WMTSCacheStruct(provider, tileMatrixSetLink);
+		}
+		return struct;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.TileServer#setStruct(org.gvsig.raster.cache.tile.provider.CacheStruct)
+	 */
+	public void setStruct(CacheStruct struct) {
+		//La structura de cache es proporcionada por el servidor
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.TileServer#getFileSuffix()
+	 */
+	public String getFileSuffix() {
+		return suffix;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.TileServer#setFileExtension(java.lang.String)
+	 */
+	public void setFileSuffix(String extension) {
+		this.suffix = extension;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSTileServer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSCacheStruct.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSCacheStruct.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSCacheStruct.java	(revision 1459)
@@ -0,0 +1,340 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.io.downloader;
+
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.cache.tile.TileCacheLocator;
+import org.gvsig.raster.cache.tile.exception.TileBuildException;
+import org.gvsig.raster.cache.tile.provider.CacheStruct;
+import org.gvsig.raster.wmts.io.WMTSDataParameters;
+import org.gvsig.raster.wmts.io.WMTSProvider;
+import org.gvsig.remoteclient.wmts.WMTSStatus;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrix;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixLimits;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixSet;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixSetLink;
+
+/**
+ * Implementation for a structure of a cache
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSCacheStruct implements CacheStruct {
+    private String                        layerName           = null;
+	private String                        serverURL           = null;
+	private WMTSTileMatrixSet             tileMatrixSet       = null;
+	private ArrayList<?>                  tileMatrixSetLimits = null;
+	private double[]                      pixelSize           = null;
+    private WMTSProvider                  provider            = null;
+    
+    public WMTSCacheStruct(WMTSProvider provider, WMTSTileMatrixSetLink tileMatrixSetLink) {
+    	this.provider = provider;
+    	this.tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		this.tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits();
+		pixelSize = provider.getPixelSizeByLevel();
+		serverURL = provider.getURIOfFirstProvider();
+		layerName = ((WMTSDataParameters)provider.getDataParameters()).getLayer().getTitle();
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getNumberOfLevels()
+     */
+	public int getNumberOfLevels() {
+		return tileMatrixSet.getTileMatrix().size();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getLayerName()
+	 */
+	public String getLayerName() {
+		return layerName;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getServerURL()
+	 */
+	public String getServerURL() {
+		return serverURL;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getTileSizeByLevel(int)
+	 */
+	public int[] getTileSizeByLevel(int level) {
+		return new int[] {
+			((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getTileWidth(),
+			((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getTileHeight()
+		};
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getLayerWidthOfTileMatrixByLevel(int)
+	 */
+	public int getLayerWidthOfTileMatrixByLevel(int level) {
+		if(tileMatrixSetLimits != null && tileMatrixSetLimits.size() > level) {
+			WMTSTileMatrixLimits l = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level);
+			return l.getMaxTileRow() - l.getMinTileRow();
+		} else {
+			WMTSTileMatrix tm = (WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level);
+			return (int)tm.getMatrixWidth();
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getLayerHeightOfTileMatrixByLevel(int)
+	 */
+	public int getLayerHeightOfTileMatrixByLevel(int level) {
+		if(tileMatrixSetLimits != null && tileMatrixSetLimits.size() > level) {
+			WMTSTileMatrixLimits l = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level);
+			return l.getMaxTileCol() - l.getMinTileCol();
+		} else {
+			WMTSTileMatrix tm = (WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level);
+			return (int)tm.getMatrixHeight();
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getLayerInitXTilePositionByLevel(int)
+	 */
+	public int getLayerInitXTilePositionByLevel(int level) {
+		if(tileMatrixSetLimits != null && tileMatrixSetLimits.size() > level) {
+			WMTSTileMatrixLimits l = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level);
+			return l.getMinTileCol();
+		} else
+			return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getLayerInitYTilePositionByLevel(int)
+	 */
+	public int getLayerInitYTilePositionByLevel(int level) {
+		if(tileMatrixSetLimits != null && tileMatrixSetLimits.size() > level) {
+			WMTSTileMatrixLimits l = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level);
+			return l.getMinTileRow();
+		} else 
+			return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getWorldHeightOfTileMatrixByLevel(int)
+	 */
+	public long getWorldHeightOfTileMatrixByLevel(int level) {
+		return ((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getMatrixWidth();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getWorldWidthOfTileMatrixByLevel(int)
+	 */
+	public long getWorldWidthOfTileMatrixByLevel(int level) {
+		return ((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getMatrixHeight();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getPixelSizeByLevel(int)
+	 */
+	public double getPixelSizeByLevel(int level) {
+		if(level < pixelSize.length)
+			return pixelSize[level];
+		else
+			return pixelSize[pixelSize.length - 1];
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getTileExtent(org.gvsig.raster.cache.tile.Tile)
+	 */
+	public Point2D[] getTileExtent(Tile tile) {
+		return getTileExtent(tile.getLevel(), tile.getCol(), tile.getRow());
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getTileExtent(int, int, int)
+	 */
+	public Point2D[] getTileExtent(int level, int col, int row) {
+		double[] ul = tileMatrixSet.getBoundingBox().getUpperCorner();
+		long tileWidth = ((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getTileWidth();
+		long tileHeight = ((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getTileHeight();
+		double mtsWidthTile = tileWidth * pixelSize[level];
+		double mtsHeightTile = tileHeight * pixelSize[level];
+		double ulx = ul[0] + (col * mtsWidthTile);
+		double uly = ulx + mtsWidthTile;
+		double lrx = ul[1] - (row * mtsHeightTile);
+		double lry = lrx - mtsHeightTile;
+		return new Point2D[]{new Point2D.Double(ulx, uly), new Point2D.Double(lrx, lry)};
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getTileStructure(int, int, int, java.awt.geom.Point2D, java.awt.geom.Point2D)
+	 */
+	public Tile getTileStructure(int level, int tileCol, int tileRow, Point2D ul, Point2D lr) throws TileBuildException  {
+		int[] size = getTileSizeByLevel(level);
+		Tile tile = TileCacheLocator.getManager().createTile(level, tileRow, tileCol);
+		tile.setUl(ul);
+		tile.setLr(lr);
+		tile.setWidthPx(size[0]);
+		tile.setHeightPx(size[1]);
+		
+		Rectangle2D r = new Rectangle2D.Double(Math.min(ul.getX(), lr.getX()), 
+				Math.min(ul.getY(), lr.getY()), 
+				Math.abs(ul.getX() - lr.getX()), 
+				Math.abs(ul.getY() - lr.getY()));
+		int bufWidth = (int)(r.getWidth() / getPixelSizeByLevel(level));
+		int bufHeight = (int)(r.getHeight() / getPixelSizeByLevel(level));
+		try {
+			WMTSStatus status = provider.buildWMTSStatus(r, bufWidth, bufHeight);
+			tile.setDownloaderParams("WMTSStatus", status);
+		} catch (RasterDriverException e) {
+			throw new TileBuildException(e); 
+		}
+			
+		return tile;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getTileList(java.awt.geom.Point2D, java.awt.geom.Point2D)
+	 */
+	@SuppressWarnings("unchecked")
+	public ArrayList<Tile> getTileList(Point2D ul, Point2D lr, double mtsPixelRequest) throws TileBuildException {
+		Rectangle2D r = new Rectangle2D.Double(Math.min(ul.getX(), lr.getX()), 
+				Math.min(ul.getY(), lr.getY()), 
+				Math.abs(ul.getX() - lr.getX()), 
+				Math.abs(ul.getY() - lr.getY()));
+		int bufWidth = (int)(r.getWidth() / mtsPixelRequest);
+		int bufHeight = (int)(r.getHeight() / mtsPixelRequest);
+		try {
+			WMTSStatus status = provider.buildWMTSStatus(r, bufWidth, bufHeight);
+			
+			//Conversi�n a tiles de la librer�a
+			ArrayList<org.gvsig.remoteclient.wmts.struct.WMTSTileMatrix.Tile> tiles = status.getTileList();
+			ArrayList<Tile> tileList = new ArrayList<Tile>();
+			for (int i = 0; i < tiles.size(); i++) {
+				org.gvsig.remoteclient.wmts.struct.WMTSTileMatrix.Tile tOrigin = (org.gvsig.remoteclient.wmts.struct.WMTSTileMatrix.Tile) tiles.get(i);
+				Tile t = TileCacheLocator.getManager().createTile(status.getLevel(), tOrigin.col, tOrigin.row);
+				t.setUl(new Point2D.Double(tOrigin.ulx, tOrigin.uly));
+				t.setLr(new Point2D.Double(tOrigin.lrx, tOrigin.lry));
+				t.setWidthPx(tOrigin.wPx);
+				t.setHeightPx(tOrigin.hPx);
+				t.setDownloaderParams("WMTSStatus", provider.buildWMTSStatus(r, bufWidth, bufHeight));
+				tileList.add(t);
+			}
+			return tileList;
+		} catch (RasterDriverException e) {
+			throw new TileBuildException(e); 
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getTileSizeInRealCoordsByLevel(int)
+	 */
+	public double[] getTileSizeInRealCoordsByLevel(int level) {
+		return new double[] {
+				getPixelSizeByLevel(level) * getTileSizeByLevel(level)[0],
+				getPixelSizeByLevel(level) *  getTileSizeByLevel(level)[1]
+			};
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getFileSuffix()
+	 */
+	public String getFileSuffix() {
+		return provider.getFileSuffix();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#compare(org.gvsig.raster.cache.tile.provider.CacheStruct)
+	 */
+	public boolean compare(CacheStruct struct) {
+		MathUtils mu = RasterLocator.getManager().getMathUtils();
+		//Compara: n�mero de niveles, tama�o de tile, 
+		//anchoXalto de la matriz, tama�o de pixel por nivel, 
+		//coordenadas de al menos un tile de la matriz
+		if(struct.getNumberOfLevels() == getNumberOfLevels()) {
+			for (int i = 0; i < getNumberOfLevels(); i++) {
+				if(	struct.getTileSizeByLevel(i)[0] == getTileSizeByLevel(i)[0] && 
+					struct.getTileSizeByLevel(i)[1] == getTileSizeByLevel(i)[1] &&
+					struct.getWorldHeightOfTileMatrixByLevel(i) == getWorldHeightOfTileMatrixByLevel(i) &&
+					struct.getWorldWidthOfTileMatrixByLevel(i) == getWorldWidthOfTileMatrixByLevel(i) &&
+					mu.clipDecimals(struct.getPixelSizeByLevel(i), 2) == mu.clipDecimals(getPixelSizeByLevel(i), 2) &&
+					compareExtents(struct.getTileExtent(i, 0, 0), getTileExtent(i, 0, 0))) {
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+	
+	private boolean compareExtents(Point2D[] p, Point2D[] p1) {
+		return (p[0].getX() == p1[0].getX() && p[0].getY() == p1[0].getY() &&
+				p[1].getX() == p1[1].getX() && p[1].getY() == p1[1].getY());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getEPSG()
+	 */
+	public String getEPSG() {
+		/*IProjection proj = provider.getProjection();
+		if(proj != null)
+			return proj.getAbrev();
+		return null;*/
+		return provider.getSRSCode();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getFileSize()
+	 */
+	public String getFileSize() {
+		return "0";
+	}
+
+	public ArrayList<Tile> getTileList(int x, int y, int w, int h) {
+		return null;
+	}
+
+	public ArrayList<Tile> getTileList(Rectangle2D r) {
+		return null;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSCacheStruct.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/package.html
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/package.html	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/package.html	(revision 1459)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>org.gvsig.raster.wmts.io package documentation</title>
+</head>
+<body>
+
+	<p>WMTS provider</p>
+
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorer.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorer.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorer.java	(revision 1459)
@@ -0,0 +1,256 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+
+/*
+* AUTHORS (In addition to CIT):
+* 2009 IVER T.I   {{Task}}
+*/
+
+package org.gvsig.raster.wmts.io;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataServerExplorerParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.NewDataStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.spi.DataServerExplorerProvider;
+import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices;
+import org.gvsig.remoteclient.wmts.exception.WMTSException;
+import org.gvsig.remoteclient.wmts.struct.WMTSLayer;
+import org.gvsig.remoteclient.wmts.struct.WMTSServiceIdentification;
+import org.gvsig.remoteclient.wmts.struct.WMTSServiceProvider;
+import org.gvsig.remoteclient.wmts.struct.WMTSThemes;
+import org.gvsig.remoteclient.wmts.struct.WMTSTileMatrixSet;
+
+/**
+ * Explorer for a WMTS server
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSServerExplorer implements DataServerExplorer, DataServerExplorerProvider {
+	public static final String           NAME                     = "WMTSRemoteServerExplorer";
+	private WMTSConnector                connector                = null;
+	private WMTSServerExplorerParameters parameters               = null;
+	
+	public WMTSServerExplorer(
+			WMTSServerExplorerParameters parameters,
+			DataServerExplorerProviderServices services)
+			throws InitializeException {
+		this.parameters = parameters;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.remote.RemoteServerExplorerProvider#getDataStoreProviderName()
+	 */
+	public String getDataStoreProviderName() {
+		return WMTSProvider.NAME;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.remote.RemoteServerExplorerProvider#getDescription()
+	 */
+	public String getDescription() {
+		return WMTSProvider.DESCRIPTION;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getStoreParameters()
+	 */
+	public DataStoreParameters getStoreParameters() {
+		DataManager manager = DALLocator.getDataManager();
+		WMTSDataParameters wmtsParams = null;
+		try {
+			wmtsParams = (WMTSDataParameters) manager.createStoreParameters(this.getDataStoreProviderName());
+			wmtsParams.setURI(parameters.getHost());
+
+			if(WMTSProvider.TILED) {
+				TileDataParameters tileParams = (TileDataParameters) manager.createStoreParameters("Tile Store");
+				tileParams.setDataParameters(wmtsParams);
+				return tileParams;
+			} 
+		} catch (InitializeException e) {
+			e.printStackTrace();
+		} catch (ProviderNotRegisteredException e) {
+			e.printStackTrace();
+		}
+		return wmtsParams;
+	}
+
+	public boolean add(String provider, NewDataStoreParameters parameters,
+			boolean overwrite) throws DataException {
+		return false;
+	}
+
+	public boolean canAdd() {
+		return false;
+	}
+
+	public boolean canAdd(String storeName) throws DataException {
+		return false;
+	}
+
+	public NewDataStoreParameters getAddParameters(String storeName)
+			throws DataException {
+		return null;
+	}
+
+	@SuppressWarnings("unchecked")
+	public List getDataStoreProviderNames() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.DataServerExplorer#getParameters()
+	 */
+	public DataServerExplorerParameters getParameters() {
+		return parameters;
+	}
+
+	@SuppressWarnings("unchecked")
+	public List list() throws DataException {
+		return null;
+	}
+
+	@SuppressWarnings("unchecked")
+	public List list(int mode) throws DataException {
+		return null;
+	}
+
+	public void remove(DataStoreParameters parameters) throws DataException {
+		
+	}
+
+	public void dispose() {
+		
+	}
+
+	public String getProviderName() {
+		return null;
+	}
+
+	//**********************************************
+	//Connector
+	//**********************************************
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#connect(org.gvsig.compat.net.ICancellable)
+	 */
+	public void connect(ICancellable cancellable) throws WMTSException {
+		URL url = null;
+		boolean override = false;
+		
+		try {
+			url = new URL(parameters.getHost());
+		} catch (Exception e) {
+			throw new WMTSException("Malformed URL",e);
+		}
+        try {
+        	connector = new WMTSConnector(url);
+        	connector.setForceLongitudeFirstAxisOrder(parameters.isLongitudeFirst());
+        	if (!connector.connect(override, cancellable))
+        		throw new WMTSException("Error connecting");
+        } catch (IOException e) {
+			throw new WMTSException(e.getMessage(), e);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#isConnected()
+	 */
+	public boolean isConnected() {
+		if(connector != null)
+			return true;
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getThemes()
+	 */
+	public WMTSThemes getThemes() {
+		return connector.getThemes();
+	}
+    
+    /*
+     * (non-Javadoc)
+     * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getLayer(java.lang.String)
+     */
+    public WMTSLayer getLayer(String layerName) {
+    	return connector.getLayer(layerName);
+    }
+    
+    /*
+     * (non-Javadoc)
+     * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getTileMatrixSet()
+     */
+	public ArrayList<WMTSTileMatrixSet> getTileMatrixSet() {
+    	return connector.getTileMatrixSet();
+    }
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getServiceIdentification()
+	 */
+	public WMTSServiceIdentification getServiceIdentification() {
+		return connector.getServiceIdentification();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getServiceProvider()
+	 */
+	public WMTSServiceProvider getServiceProvider() {
+		return connector.getServiceProvider();
+	}
+
+    /*
+     * (non-Javadoc)
+     * @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getHost()
+     */
+	public String getHost() {
+		return parameters.getHost();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.spi.DataServerExplorerProvider#getServerExplorerProviderServices()
+	 */
+	public DataServerExplorerProviderServices getServerExplorerProviderServices() {
+		return null;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/TemplateRasterProvider.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/TemplateRasterProvider.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/TemplateRasterProvider.java	(revision 1459)
@@ -0,0 +1,499 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.dataset.io.netcdf;
+
+import java.awt.geom.AffineTransform;
+
+import org.gvsig.fmap.dal.DALFileLocator;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.dataset.io.tile.downloader.FileTileServer;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterFileStoreParameters;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.metadata.MetadataLocator;
+import org.gvsig.raster.cache.tile.provider.TileListener;
+import org.gvsig.raster.cache.tile.provider.TileServer;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.provider.DefaultRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
+import org.gvsig.raster.impl.store.AbstractRasterDataStore;
+import org.gvsig.raster.impl.store.DefaultStoreFactory;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.properties.DataStoreMetadata;
+import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+/**
+ * Data provider for ...
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class NetCDFProvider extends DefaultRasterProvider {
+	public static String        NAME                     = "Template Store";
+	public static String        DESCRIPTION              = "Template Raster file";
+	public final String         METADATA_DEFINITION_NAME = "TemplateStore";
+	
+	private static String[]     formatList               = new String[]{"*"};
+
+	private Extent              viewRequest              = null;
+	private TileServer          tileServer               = null;
+	private boolean             open                     = false;
+
+	public static void register() {
+		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
+		if (dataman != null && !dataman.getStoreProviders().contains(NAME)) {
+			dataman.registerStoreProvider(NAME,
+					NetCDFProvider.class, NetCDFDataParameters.class);
+		}
+		
+		if(DALFileLocator.getFilesystemServerExplorerManager() != null)
+			DALFileLocator.getFilesystemServerExplorerManager().registerProvider(
+					NAME, DESCRIPTION,
+					NetCDFFilesystemServerExplorer.class);
+		
+		dataman.registerStoreFactory(NAME, DefaultStoreFactory.class);
+	}
+
+	/**
+	 * Returns true if the extension is supported and false if doesn't
+	 * @param ext
+	 * @return
+	 */
+	public static boolean isExtensionSupported(String ext) {
+		for (int i = 0; i < formatList.length; i++) {
+			if(formatList[i].compareTo(ext) == 0)
+				return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * Constructor. Abre el dataset.
+	 * @param proj Proyecci�n
+	 * @param fName Nombre del fichero
+	 * @throws NotSupportedExtensionException
+	 */
+	public NetCDFProvider(String params) throws NotSupportedExtensionException {
+		super(params);
+		if(params instanceof String) {
+			NetCDFDataParameters p = new NetCDFDataParameters();
+			p.setURI((String)params);
+			super.init(p, null, ToolsLocator.getDynObjectManager()
+					.createDynObject(
+							MetadataLocator.getMetadataManager().getDefinition(
+									DataStore.METADATA_DEFINITION_NAME)));
+			init(p, null);
+		}
+	}
+	
+	public NetCDFProvider (NetCDFDataParameters params,
+			AbstractRasterDataStore storeServices) throws NotSupportedExtensionException {
+		super(params, storeServices, ToolsLocator.getDynObjectManager()
+				.createDynObject(
+						MetadataLocator.getMetadataManager().getDefinition(
+								DataStore.METADATA_DEFINITION_NAME)));
+		init(params, storeServices);
+	}
+
+	/**
+	 * Crea las referencias al fichero y carga
+	 * las estructuras con la informaci�n y los metadatos.
+	 * @param proj Proyecci�n
+	 * @param param Parametros de carga
+	 * @throws NotSupportedExtensionException
+	 */
+	public void init (AbstractRasterDataParameters params,
+			DataStoreProviderServices storeServices) throws NotSupportedExtensionException {
+		//TODO:
+		
+		if(((RasterFileStoreParameters)params).getFile().exists()) {
+			setParam(params);
+			colorTable = null;
+			noData = 0;
+			wktProjection = null;
+			//CrsWkt crs = new CrsWkt(wktProjection);
+			//IProjection proj = CRSFactory.getCRS("EPSG:23030");
+			noDataEnabled = true;
+			ownTransformation = null;
+			externalTransformation = (AffineTransform)ownTransformation.clone();
+			load();
+		} else
+			setParam(params);
+		bandCount = 0;
+		setDataType(null);
+		super.init();
+
+		try {
+			loadFromRmf(getRmfBlocksManager());
+		} catch (ParsingException e) {
+			//No lee desde rmf
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#load()
+	 */
+	public RasterProvider load() {
+		return this;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#isOpen()
+	 */
+	public boolean isOpen() {
+		return open;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#close()
+	 */
+	public void close() {
+		//TODO:
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#translateFileName(java.lang.String)
+	 */
+	public String translateFileName(String fileName) {
+		return fileName;
+	}
+
+	/**
+	 * Asigna el extent de la vista actual. existe un fichero .rmf debemos hacer una transformaci�n
+	 * de la vista asignada ya que la petici�n viene en coordenadas del fichero .rmf y la vista (v)
+	 * ha de estar en coordenadas del fichero.
+	 */
+	public void setView(Extent e) {
+		viewRequest = new ExtentImpl(e);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getView()
+	 */
+	public Extent getView() {
+		return viewRequest;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWidth()
+	 */
+	public double getWidth() {
+		//TODO:
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getHeight()
+	 */
+	public double getHeight() {
+		//TODO:
+		return 0;
+	}
+
+	/**
+	 * Read a line from the file
+	 * @param line
+	 * @param band
+	 * @return
+	 * @throws InvalidSetViewException
+	 * @throws FileNotOpenException
+	 * @throws RasterDriverException
+	 * @Deprecated This operation is deprecated because is not useful and in the future
+	 * it will not be maintained. The abstract operation has dissapear
+	 */
+	public Object readCompleteLine(int line, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
+		if(line > this.getHeight() || band > this.getBandCount())
+			throw new InvalidSetViewException("Request out of grid");
+
+		//TODO:
+		return null;
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.RasterDataset#readBlock(int, int)
+	 */
+	public Object readBlock(int pos, int blockHeight)
+		throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
+		if(pos < 0)
+			throw new InvalidSetViewException("Request out of grid");
+
+		if((pos + blockHeight) > getHeight())
+			blockHeight = Math.abs(((int)getHeight()) - pos);
+		
+		//TODO:
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getData(int, int, int)
+	 */
+	public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
+		if(x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
+			throw new InvalidSetViewException("Request out of grid");
+		
+		//TODO
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener)
+	 */
+	public void getWindow(Extent ex, int bufWidth, int bufHeight, 
+			BandList bandList, TileListener listener) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(org.gvsig.fmap.dal.coverage.datastruct.Extent, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
+	 */
+	public Buffer getWindow(Extent ex, BandList bandList, Buffer rasterBuf) 
+		throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
+	 */
+	public Buffer getWindow(double ulx, double uly, double w, double h, 
+			BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
+	 */
+	public Buffer getWindow(Extent extent, 
+			int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+		
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(int, int, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
+	 */
+	public Buffer getWindow(int x, int y, int w, int h, 
+			BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+		
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(int, int, int, int, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
+	 */
+	public Buffer getWindow(int x, int y, int w, int h, 
+			int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+		
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getBlockSize()
+	 */
+	public int getBlockSize(){
+		//TODO
+		
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getMetadata()
+	 */
+	public DataStoreMetadata getMetadata() {
+		//TODO
+		
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getColorInterpretation()
+	 */
+	public DataStoreColorInterpretation getColorInterpretation(){
+		//TODO
+		
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setColorInterpretation(org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation)
+	 */
+	public void setColorInterpretation(DataStoreColorInterpretation colorInterpretation){
+		//TODO
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getTransparency()
+	 */
+	public DataStoreTransparency getTransparency() {
+		//TODO
+		
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isGeoreferenced()
+	 */
+	public boolean isGeoreferenced() {
+		//TODO
+		
+		return false;
+	}
+
+	/**
+	 * Informa de si el driver ha supersampleado en el �ltimo dibujado. Es el driver el que colocar�
+	 * el valor de esta variable cada vez que dibuja.
+	 * @return true si se ha supersampleado y false si no se ha hecho.
+	 */
+	public boolean isSupersampling() {
+		//TODO
+		
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setAffineTransform(java.awt.geom.AffineTransform)
+	 */
+	public void setAffineTransform(AffineTransform t){
+		super.setAffineTransform(t);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#getOverviewCount(int)
+	 */
+	public int getOverviewCount(int band) throws BandAccessException, RasterDriverException {
+		if(band >= getBandCount())
+			throw new BandAccessException("Wrong band");
+		//TODO
+		
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewWidth(int, int)
+	 */
+	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException {
+		if (band >= getBandCount())
+			throw new BandAccessException("Wrong band");
+		//TODO
+		
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewHeight(int, int)
+	 */
+	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException {
+		if (band >= getBandCount())
+			throw new BandAccessException("Wrong band");
+		//TODO
+		
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#overviewsSupport()
+	 */
+	public boolean overviewsSupport() {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isReproyectable()
+	 */
+	public boolean isReproyectable() {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.spi.DataStoreProvider#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#setStatus(org.gvsig.raster.impl.provider.RasterProvider)
+	 */
+	public void setStatus(RasterProvider provider) {
+		if(provider instanceof NetCDFProvider) {
+			//Not implemented yet
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#getTileServer()
+	 */
+	public TileServer getTileServer() {
+		if(tileServer == null)
+			tileServer = new FileTileServer(this);
+		return tileServer;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/TemplateRasterProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/README.txt
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/README.txt	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/README.txt	(revision 1459)
@@ -0,0 +1,8 @@
+Put into this folder the resources needed by your test classes.
+
+This folder is added to the Tests classpath, so you can load any resources 
+through the ClassLoader.
+
+By default, in this folder you can find an example of log4j configuration,
+prepared to log messages through the console, so logging works when you
+run your tests classes.
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/README.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/log4j.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/log4j.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/log4j.xml	(revision 1459)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- 
+Log4J configuration file for unit tests execution.
+ -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<!-- Appender configuration to show logging messages through the console -->
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
+		</layout>
+	</appender>
+
+	<!-- 
+	Activate logging messages of DEBUG level of higher only for the
+	org.gvsig.tools packages.
+	You can put full classes names or packages instead, to configure
+	logging for all the classes and subpackages of the package.
+	-->
+	<category name="org.gvsig.tools">
+		<priority value="DEBUG" />
+	</category>
+	<category name="org.gvsig.raster">
+		<priority value="DEBUG" />
+	</category>
+
+	<!-- 
+	By default, show only logging messages of INFO level or higher, 
+	through the previously configured CONSOLE appender. 
+	-->
+	<root>
+		<priority value="INFO" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+</log4j:configuration>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/test/resources/log4j.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/pom.xml	(revision 1459)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.wmts.io</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.wmts.io</name>
+	<version>2.0.0-SNAPSHOT</version>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>gvsig-base-library-pom</artifactId>
+		<version>2.0-SNAPSHOT</version>
+	</parent>
+    <properties>
+        <build-dir>${basedir}/../../../build</build-dir>
+    </properties>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.cache.lib.api</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.lib.api</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.lib.impl</artifactId>
+            <version>2.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <classifier>spi</classifier>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.file</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.remoteclient</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.projection</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.compat</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry</artifactId>
+            <scope>compile</scope>
+        </dependency>
+		<!--<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.jecw</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.jecw</artifactId>
+            <version>2.0.0-SNAPSHOT</version>
+            <classifier>${native-classifier}</classifier>
+            <type>tar.gz</type>
+            <scope>runtime</scope>
+        </dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.jgdal</artifactId>
+			<version>2.0.3-SNAPSHOT</version>
+            <scope>compile</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.jgdal</artifactId>
+            <version>2.0.3-SNAPSHOT</version>
+            <classifier>${native-classifier}</classifier>
+            <type>tar.gz</type>
+            <scope>runtime</scope>
+        </dependency>
+		<dependency>
+	    	<groupId>org.gdal</groupId>
+		   	<artifactId>gdal</artifactId>
+	    	<version>1.6.3</version>
+	    	<classifier>${native-classifier}</classifier>
+    		<type>tar.gz</type>
+            <scope>runtime</scope>
+   		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.jmrsid</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+ 			<groupId>org.gvsig</groupId>
+ 			<artifactId>org.gvsig.jmrsid</artifactId>
+  			<version>2.0.0-SNAPSHOT</version>
+  			<classifier>${native-classifier}</classifier>
+  			<type>tar.gz</type>
+            <scope>runtime</scope>
+		</dependency>-->
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.jproj</artifactId>
+			<version>2.0.1-SNAPSHOT</version>
+			<classifier>${native-classifier}</classifier>
+			<type>tar.gz</type>
+            <scope>runtime</scope>
+		</dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	</dependencies>
+</project>

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/log4j.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/log4j.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/log4j.xml	(revision 1459)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- 
+Log4J configuration file for unit tests execution.
+ -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<!-- Appender configuration to show logging messages through the console -->
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
+		</layout>
+	</appender>
+
+	<!-- 
+	Activate logging messages of DEBUG level of higher only for the
+	org.gvsig.tools packages.
+	You can put full classes names or packages instead, to configure
+	logging for all the classes and subpackages of the package.
+	-->
+	<category name="org.gvsig.tools">
+		<priority value="DEBUG" />
+	</category>
+	<category name="org.gvsig.raster">
+		<priority value="DEBUG" />
+	</category>
+
+	<!-- 
+	By default, show only logging messages of INFO level or higher, 
+	through the previously configured CONSOLE appender. 
+	-->
+	<root>
+		<priority value="INFO" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+</log4j:configuration>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/log4j.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1459)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.io.DefaultWMTSIOLibrary
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/TemplateRasterProvider.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/TemplateRasterProvider.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/TemplateRasterProvider.java	(revision 1459)
@@ -0,0 +1,499 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.dataset.io.netcdf;
+
+import java.awt.geom.AffineTransform;
+
+import org.gvsig.fmap.dal.DALFileLocator;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.dataset.io.tile.downloader.FileTileServer;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterFileStoreParameters;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.metadata.MetadataLocator;
+import org.gvsig.raster.cache.tile.provider.TileListener;
+import org.gvsig.raster.cache.tile.provider.TileServer;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.provider.DefaultRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
+import org.gvsig.raster.impl.store.AbstractRasterDataStore;
+import org.gvsig.raster.impl.store.DefaultStoreFactory;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.properties.DataStoreMetadata;
+import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+/**
+ * Data provider for ...
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class NetCDFProvider extends DefaultRasterProvider {
+	public static String        NAME                     = "Template Store";
+	public static String        DESCRIPTION              = "Template Raster file";
+	public final String         METADATA_DEFINITION_NAME = "TemplateStore";
+	
+	private static String[]     formatList               = new String[]{"*"};
+
+	private Extent              viewRequest              = null;
+	private TileServer          tileServer               = null;
+	private boolean             open                     = false;
+
+	public static void register() {
+		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
+		if (dataman != null && !dataman.getStoreProviders().contains(NAME)) {
+			dataman.registerStoreProvider(NAME,
+					NetCDFProvider.class, NetCDFDataParameters.class);
+		}
+		
+		if(DALFileLocator.getFilesystemServerExplorerManager() != null)
+			DALFileLocator.getFilesystemServerExplorerManager().registerProvider(
+					NAME, DESCRIPTION,
+					NetCDFFilesystemServerExplorer.class);
+		
+		dataman.registerStoreFactory(NAME, DefaultStoreFactory.class);
+	}
+
+	/**
+	 * Returns true if the extension is supported and false if doesn't
+	 * @param ext
+	 * @return
+	 */
+	public static boolean isExtensionSupported(String ext) {
+		for (int i = 0; i < formatList.length; i++) {
+			if(formatList[i].compareTo(ext) == 0)
+				return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * Constructor. Abre el dataset.
+	 * @param proj Proyecci�n
+	 * @param fName Nombre del fichero
+	 * @throws NotSupportedExtensionException
+	 */
+	public NetCDFProvider(String params) throws NotSupportedExtensionException {
+		super(params);
+		if(params instanceof String) {
+			NetCDFDataParameters p = new NetCDFDataParameters();
+			p.setURI((String)params);
+			super.init(p, null, ToolsLocator.getDynObjectManager()
+					.createDynObject(
+							MetadataLocator.getMetadataManager().getDefinition(
+									DataStore.METADATA_DEFINITION_NAME)));
+			init(p, null);
+		}
+	}
+	
+	public NetCDFProvider (NetCDFDataParameters params,
+			AbstractRasterDataStore storeServices) throws NotSupportedExtensionException {
+		super(params, storeServices, ToolsLocator.getDynObjectManager()
+				.createDynObject(
+						MetadataLocator.getMetadataManager().getDefinition(
+								DataStore.METADATA_DEFINITION_NAME)));
+		init(params, storeServices);
+	}
+
+	/**
+	 * Crea las referencias al fichero y carga
+	 * las estructuras con la informaci�n y los metadatos.
+	 * @param proj Proyecci�n
+	 * @param param Parametros de carga
+	 * @throws NotSupportedExtensionException
+	 */
+	public void init (AbstractRasterDataParameters params,
+			DataStoreProviderServices storeServices) throws NotSupportedExtensionException {
+		//TODO:
+		
+		if(((RasterFileStoreParameters)params).getFile().exists()) {
+			setParam(params);
+			colorTable = null;
+			noData = 0;
+			wktProjection = null;
+			//CrsWkt crs = new CrsWkt(wktProjection);
+			//IProjection proj = CRSFactory.getCRS("EPSG:23030");
+			noDataEnabled = true;
+			ownTransformation = null;
+			externalTransformation = (AffineTransform)ownTransformation.clone();
+			load();
+		} else
+			setParam(params);
+		bandCount = 0;
+		setDataType(null);
+		super.init();
+
+		try {
+			loadFromRmf(getRmfBlocksManager());
+		} catch (ParsingException e) {
+			//No lee desde rmf
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#load()
+	 */
+	public RasterProvider load() {
+		return this;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#isOpen()
+	 */
+	public boolean isOpen() {
+		return open;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#close()
+	 */
+	public void close() {
+		//TODO:
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#translateFileName(java.lang.String)
+	 */
+	public String translateFileName(String fileName) {
+		return fileName;
+	}
+
+	/**
+	 * Asigna el extent de la vista actual. existe un fichero .rmf debemos hacer una transformaci�n
+	 * de la vista asignada ya que la petici�n viene en coordenadas del fichero .rmf y la vista (v)
+	 * ha de estar en coordenadas del fichero.
+	 */
+	public void setView(Extent e) {
+		viewRequest = new ExtentImpl(e);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getView()
+	 */
+	public Extent getView() {
+		return viewRequest;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWidth()
+	 */
+	public double getWidth() {
+		//TODO:
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getHeight()
+	 */
+	public double getHeight() {
+		//TODO:
+		return 0;
+	}
+
+	/**
+	 * Read a line from the file
+	 * @param line
+	 * @param band
+	 * @return
+	 * @throws InvalidSetViewException
+	 * @throws FileNotOpenException
+	 * @throws RasterDriverException
+	 * @Deprecated This operation is deprecated because is not useful and in the future
+	 * it will not be maintained. The abstract operation has dissapear
+	 */
+	public Object readCompleteLine(int line, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
+		if(line > this.getHeight() || band > this.getBandCount())
+			throw new InvalidSetViewException("Request out of grid");
+
+		//TODO:
+		return null;
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.RasterDataset#readBlock(int, int)
+	 */
+	public Object readBlock(int pos, int blockHeight)
+		throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
+		if(pos < 0)
+			throw new InvalidSetViewException("Request out of grid");
+
+		if((pos + blockHeight) > getHeight())
+			blockHeight = Math.abs(((int)getHeight()) - pos);
+		
+		//TODO:
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getData(int, int, int)
+	 */
+	public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
+		if(x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
+			throw new InvalidSetViewException("Request out of grid");
+		
+		//TODO
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener)
+	 */
+	public void getWindow(Extent ex, int bufWidth, int bufHeight, 
+			BandList bandList, TileListener listener) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(org.gvsig.fmap.dal.coverage.datastruct.Extent, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
+	 */
+	public Buffer getWindow(Extent ex, BandList bandList, Buffer rasterBuf) 
+		throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
+	 */
+	public Buffer getWindow(double ulx, double uly, double w, double h, 
+			BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
+	 */
+	public Buffer getWindow(Extent extent, 
+			int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+		
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(int, int, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
+	 */
+	public Buffer getWindow(int x, int y, int w, int h, 
+			BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+		
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(int, int, int, int, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
+	 */
+	public Buffer getWindow(int x, int y, int w, int h, 
+			int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
+		//TODO
+		
+		return rasterBuf;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getBlockSize()
+	 */
+	public int getBlockSize(){
+		//TODO
+		
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getMetadata()
+	 */
+	public DataStoreMetadata getMetadata() {
+		//TODO
+		
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getColorInterpretation()
+	 */
+	public DataStoreColorInterpretation getColorInterpretation(){
+		//TODO
+		
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setColorInterpretation(org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation)
+	 */
+	public void setColorInterpretation(DataStoreColorInterpretation colorInterpretation){
+		//TODO
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getTransparency()
+	 */
+	public DataStoreTransparency getTransparency() {
+		//TODO
+		
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isGeoreferenced()
+	 */
+	public boolean isGeoreferenced() {
+		//TODO
+		
+		return false;
+	}
+
+	/**
+	 * Informa de si el driver ha supersampleado en el �ltimo dibujado. Es el driver el que colocar�
+	 * el valor de esta variable cada vez que dibuja.
+	 * @return true si se ha supersampleado y false si no se ha hecho.
+	 */
+	public boolean isSupersampling() {
+		//TODO
+		
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setAffineTransform(java.awt.geom.AffineTransform)
+	 */
+	public void setAffineTransform(AffineTransform t){
+		super.setAffineTransform(t);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#getOverviewCount(int)
+	 */
+	public int getOverviewCount(int band) throws BandAccessException, RasterDriverException {
+		if(band >= getBandCount())
+			throw new BandAccessException("Wrong band");
+		//TODO
+		
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewWidth(int, int)
+	 */
+	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException {
+		if (band >= getBandCount())
+			throw new BandAccessException("Wrong band");
+		//TODO
+		
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewHeight(int, int)
+	 */
+	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException {
+		if (band >= getBandCount())
+			throw new BandAccessException("Wrong band");
+		//TODO
+		
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#overviewsSupport()
+	 */
+	public boolean overviewsSupport() {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isReproyectable()
+	 */
+	public boolean isReproyectable() {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.spi.DataStoreProvider#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#setStatus(org.gvsig.raster.impl.provider.RasterProvider)
+	 */
+	public void setStatus(RasterProvider provider) {
+		if(provider instanceof NetCDFProvider) {
+			//Not implemented yet
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.provider.RasterProvider#getTileServer()
+	 */
+	public TileServer getTileServer() {
+		if(tileServer == null)
+			tileServer = new FileTileServer(this);
+		return tileServer;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/TemplateRasterProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/README.txt
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/README.txt	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/README.txt	(revision 1459)
@@ -0,0 +1,8 @@
+Put into this folder the resources needed by your test classes.
+
+This folder is added to the Tests classpath, so you can load any resources 
+through the ClassLoader.
+
+By default, in this folder you can find an example of log4j configuration,
+prepared to log messages through the console, so logging works when you
+run your tests classes.
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/resources/README.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io
___________________________________________________________________
Added: svn:ignore
   + .settings

target

.classpath

.project


Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1459)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.swing.impl.WMTSSwingImplLibrary
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/DefaultWMTSSwingManager.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/DefaultWMTSSwingManager.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/DefaultWMTSSwingManager.java	(revision 1459)
@@ -0,0 +1,65 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.swing.impl;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.raster.wmts.swing.WmtsGUI;
+import org.gvsig.raster.wmts.swing.WMTSSwingManager;
+import org.gvsig.raster.wmts.swing.WMTSWindowManager;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+
+/**
+ * Default implementation of the {@link WMTSSwingManager}.
+ * 
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class DefaultWMTSSwingManager implements WMTSSwingManager {
+
+    private WMTSWindowManager wmtsWindowManager;
+    private I18nManager i18nmanager = null;
+    private DataManager dataManager = null;
+
+    public DefaultWMTSSwingManager() {
+        this.i18nmanager = ToolsLocator.getI18nManager();       
+        this.dataManager = DALLocator.getDataManager();
+    }
+
+    public String getTranslation(String key) {
+        return this.i18nmanager.getTranslation(key);
+    }
+
+    public WMTSWindowManager getWindowManager() {
+        return wmtsWindowManager;
+    }
+
+    public void registerWindowManager(WMTSWindowManager windowManager) {
+        this.wmtsWindowManager = windowManager;        
+    }
+
+	public WmtsGUI createWmtsUI() {
+		return null;//new AddWMTSDialog();
+	}
+
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/DefaultWMTSSwingManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/WMTSSwingImplLibrary.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/WMTSSwingImplLibrary.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/WMTSSwingImplLibrary.java	(revision 1459)
@@ -0,0 +1,78 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.swing.impl;
+
+import java.util.Locale;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.wmts.swing.WMTSSwingLibrary;
+import org.gvsig.raster.wmts.swing.WMTSSwingLocator;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Library for default swing implementation initialization and configuration.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class WMTSSwingImplLibrary extends AbstractLibrary {
+
+	public WMTSSwingImplLibrary() {
+		super();
+	}
+	
+	@Override
+	public void doRegistration() {
+	    this.registerAs(WMTSSwingLibrary.class, Library.TYPE.IMPL);
+	}
+	
+    @Override
+    protected void doInitialize() throws LibraryException {
+    	WMTSSwingLocator
+            .registerSwingManager(DefaultWMTSSwingManager.class);
+        
+        
+        if (!Messages.hasLocales()) {
+            Messages.addLocale(Locale.getDefault());
+        }
+        
+        Messages.addResourceFamily("org.gvsig.raster.wmts.swing.impl.i18n.text",
+            WMTSSwingImplLibrary.class.getClassLoader(),
+            WMTSSwingImplLibrary.class.getClass().getName()); 
+        
+        registerIcons();
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+    }
+    
+    private void registerIcons(){
+		/*PluginServices.getIconTheme().registerDefault(
+				"icon-jdbc",
+				this.getClass().getClassLoader().getResource("images/jdbc.png")
+			);*/
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/WMTSSwingImplLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/pom.xml	(revision 1459)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.wmts.swing.impl</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.wmts.swing.impl</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.wmts.swing</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+	<dependencies>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>           
+            <scope>compile</scope>
+        </dependency> 
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.wmts.swing.api</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+        </dependency>
+         <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <classifier>spi</classifier>
+            <scope>compile</scope>
+        </dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.swing.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.i18n</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	</dependencies>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/pom.xml	(revision 1459)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+		 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.wmts.swing</artifactId>
+	<packaging>pom</packaging>
+	<name>org.gvsig.raster.wmts.swing</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.wmts</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.andami</artifactId>
+            <scope>compile</scope>
+		</dependency>
+	</dependencies>
+	<modules>
+		<module>org.gvsig.raster.wmts.swing.api</module>
+		<module>org.gvsig.raster.wmts.swing.impl</module>
+	</modules>
+</project>
+

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLocator.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLocator.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLocator.java	(revision 1459)
@@ -0,0 +1,96 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.swing;
+
+import org.gvsig.tools.locator.BaseLocator;
+
+/**
+ * This locator is the entry point for the Validation swing library,
+ * providing access to all Validation swing services through the
+ * {@link WMTSSwingManager} .
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class WMTSSwingLocator extends BaseLocator {
+
+    /**
+     * Validation swing manager name.
+     */
+    public static final String SWING_MANAGER_NAME =
+        "Validation.swing.manager";
+
+    /**
+     * Validation swing manager description.
+     */
+    public static final String SWING_MANAGER_DESCRIPTION =
+        "Validation UIManager";
+
+    private static final String LOCATOR_NAME = "Validation.swing.locator";
+
+    /**
+     * Unique instance.
+     */
+    private static final WMTSSwingLocator INSTANCE =
+        new WMTSSwingLocator();
+
+    /**
+     * Return the singleton instance.
+     * 
+     * @return the singleton instance
+     */
+    public static WMTSSwingLocator getInstance() {
+        return INSTANCE;
+    }
+
+    /**
+     * Return the Locator's name
+     * 
+     * @return a String with the Locator's name
+     */
+    public final String getLocatorName() {
+        return LOCATOR_NAME;
+    }
+
+    /**
+     * Registers the Class implementing the PersistenceManager interface.
+     * 
+     * @param clazz
+     *            implementing the PersistenceManager interface
+     */
+    public static void registerSwingManager(
+        Class<? extends WMTSSwingManager> clazz) {
+        getInstance().register(SWING_MANAGER_NAME, SWING_MANAGER_DESCRIPTION,
+            clazz);
+    }
+
+    /**
+     * Gets the instance of the {@link ScriptingUIManager} registered.
+     * 
+     * @return {@link ScriptingUIManager}
+     */
+    public static WMTSSwingManager getSwingManager() {
+        return (WMTSSwingManager) getInstance()
+            .get(SWING_MANAGER_NAME);
+    }
+
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLocator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLibrary.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLibrary.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLibrary.java	(revision 1459)
@@ -0,0 +1,53 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.swing;
+
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+
+/**
+ * Library for Swing API initialization and configuration.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class WMTSSwingLibrary extends AbstractLibrary {
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Do nothing
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        // Validate there is any implementation registered.
+        WMTSSwingManager manager =
+            WMTSSwingLocator.getSwingManager();
+        if (manager == null) {
+            throw new ReferenceNotRegisteredException(
+                WMTSSwingLocator.SWING_MANAGER_NAME,
+                WMTSSwingLocator.getInstance());
+        }
+    }
+
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingManager.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingManager.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingManager.java	(revision 1459)
@@ -0,0 +1,71 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.swing;
+
+
+/**
+ * This class is responsible of the management of the library's swing user
+ * interface. It is the swing library's main entry point, and provides all the
+ * services to manage library swing components.
+ * 
+ * @see WMTSWindowManager
+ * @see JValidationServicePanel
+ * @author gvSIG team
+ * @version $Id$
+ */
+public interface WMTSSwingManager {
+
+    /**
+     * Returns the translation of a string.
+     * 
+     * @param key
+     *            String to translate
+     * @return a String with the translation of the string passed by parameter
+     */
+    public String getTranslation(String key);
+
+    /**
+     * Registers a new instance of a WindowManager which provides services to
+     * the management of the application windows.
+     * 
+     * @param manager
+     *            {@link WMTSWindowManager} to register in the
+     *            ScriptingUIManager.
+     * @see WMTSWindowManager
+     */
+    public void registerWindowManager(WMTSWindowManager manager);
+
+    /**
+     * Returns the {@link WMTSWindowManager}.
+     * 
+     * @return {@link WMTSWindowManager}
+     * @see {@link WMTSWindowManager}
+     */
+    public WMTSWindowManager getWindowManager();
+    
+    /**
+     * Creates a {@link WmtsUI}.
+     * 
+     * @return {@link WmtsUI}.
+     */
+    public WmtsGUI createWmtsUI();
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSWindowManager.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSWindowManager.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSWindowManager.java	(revision 1459)
@@ -0,0 +1,52 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.swing;
+
+import javax.swing.JPanel;
+
+/**
+ * Responsible of the window management to show the panels of the
+ * Validation swing library.
+ * 
+ * @see WMTSSwingManager
+ * @see JValidationServicePanel
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public interface WMTSWindowManager {
+
+    public static final int MODE_DIALOG = 1;
+    public static final int MODE_WINDOW = 2;
+    public static final int MODE_TOOL = 3;
+
+    /**
+     * Inserts a Panel in a window with a characteristic properties.
+     * 
+     * @param panel
+     *            JPanel with the content of the window
+     * @param title
+     *            String with the title of the window
+     * @param mode
+     *            int that defines the type of window
+     */
+    public void showWindow(JPanel panel, String title, int mode);
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSWindowManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WmtsGUI.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WmtsGUI.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WmtsGUI.java	(revision 1459)
@@ -0,0 +1,13 @@
+package org.gvsig.raster.wmts.swing;
+
+import java.awt.event.ActionListener;
+import java.util.List;
+
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+
+public interface WmtsGUI {
+	
+	public JComponent getComponent();
+
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WmtsGUI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1459)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.swing.WMTSSwingLibrary
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/pom.xml	(revision 1459)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.wmts.swing.api</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.wmts.swing.api</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.wmts.swing</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+	<dependencies>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>      
+            <scope>compile</scope>
+        </dependency> 
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+				</configuration>
+				<executions>
+				<!--
+				Generates a jar file only with the test classes
+				-->
+					<execution>
+						<goals>
+							<goal>test-jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.raster.wmts.swing.api-2.0.0-SNAPSHOT.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.raster.wmts.swing.api-2.0.0-SNAPSHOT.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.raster.wmts.swing.api-2.0.0-SNAPSHOT-sources.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.raster.wmts.swing.api-2.0.0-SNAPSHOT-sources.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/dependency-maven-plugin-markers/org.gvsig-org.gvsig.maven.base.tools-jar-1.0.8-SNAPSHOT.marker
===================================================================
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/bash/unpack-dependencies.sh
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/bash/unpack-dependencies.sh	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/bash/unpack-dependencies.sh	(revision 1459)
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+#set -x
+
+dep_dir=$1;
+dest_dir=$2;
+
+if [ ! -d $dest_dir ]; then mkdir $dest_dir; fi;
+if [ ! -d $dep_dir ]; then exit 0; fi 
+
+if [ ! -d $dest_dir/unpacked ]; then
+	mkdir $dest_dir/unpacked;
+fi
+
+# Get all natives sdk bundle files
+files=$(find $dep_dir -type f -name *.tar.gz)
+
+for i in $files; do
+	filename=`basename $i`
+	filedest="$dest_dir/unpacked/$filename"
+	
+	#echo FileName: "$filename"
+	#echo FileDest: "$filedest"
+	
+    # Overwrite only if the file is newer than the one stored as unpacked
+	if [ ! -f "$filedest" ] || [ "$i" -nt "$filedest" ]; then
+		echo "Expanding $i in $dest_dir"
+		cp "$i" "$dest_dir/unpacked"
+		tar xzf "$i" -C "$dest_dir"
+	else
+		echo "$i not newer than the one available in $dest_dir/unpacked, not expanding it"
+	fi
+done
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/checkstyle/checkstyle_gvsig.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/checkstyle/checkstyle_gvsig.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/checkstyle/checkstyle_gvsig.xml	(revision 1459)
@@ -0,0 +1,249 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<!--
+
+  Checkstyle configuration that checks the sun coding conventions from:
+
+    - the Java Language Specification at
+      http://java.sun.com/docs/books/jls/second_edition/html/index.html
+
+    - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
+
+    - the Javadoc guidelines at
+      http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
+
+    - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
+
+    - some best practices
+
+  Checkstyle is very configurable. Be sure to read the documentation at
+  http://checkstyle.sf.net (or in your downloaded distribution).
+
+  Most Checks are configurable, be sure to consult the documentation.
+
+  To completely disable a check, just comment it out or delete it from the file.
+
+  Finally, it is worth reading the documentation.
+
+-->
+
+<module name="Checker">
+    <!--
+        If you set the basedir property below, then all reported file
+        names will be relative to the specified directory. See
+        http://checkstyle.sourceforge.net/5.x/config.html#Checker
+
+        <property name="basedir" value="${basedir}"/>
+    -->
+    <!-- gvSIG: All project files have the ISO-8859-1 charset -->
+	<property name="charset" value="ISO-8859-1" />
+
+    <!-- Checks that a package-info.java file exists for each package.     -->
+    <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
+	<module name="JavadocPackage">
+		<property name="allowLegacy" value="true" />
+	</module>
+
+    <!-- Checks whether files end with a new line.                        -->
+    <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+    <module name="NewlineAtEndOfFile"/>
+
+    <!-- Checks that property files contain the same keys.         -->
+    <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+    <module name="Translation"/>
+    
+    <!-- Checks for Size Violations.                    -->
+    <!-- See http://checkstyle.sf.net/config_sizes.html -->
+    <module name="FileLength"/>
+    
+    <!-- Checks for whitespace                               -->
+    <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+    <module name="FileTabCharacter"/>
+
+
+    <module name="TreeWalker">
+
+	    <!-- Miscellaneous other checks.                   -->
+	    <!-- See http://checkstyle.sf.net/config_misc.html -->
+	    <!-- gvSIG: apply only to java files -->
+	    <module name="RegexpSinglelineJava">
+	       <property name="format" value="\s+$"/>
+	       <property name="minimum" value="0"/>
+	       <property name="maximum" value="0"/>
+	       <property name="message" value="Line has trailing spaces."/>
+	       <property name="ignoreComments" value="true"/>
+	    </module>
+	    
+        <!-- Checks for Javadoc comments.                     -->
+        <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+		<!--
+			gvSIG rule 3: All protected or public classes must have a Javadoc comments,
+			except getters and setters
+		-->
+		<module name="JavadocMethod">
+			<property name="scope" value="protected" />
+			<property name="allowMissingPropertyJavadoc" value="true" />
+		</module>
+		<!--
+			gvSIG rule 9: All classes must have a Javadoc comment
+			with the "@author tag" and the "@version $Id$" tag included 
+		-->
+		<module name="JavadocType">
+			<property name="scope" value="private" />
+			<property name="authorFormat" value="\S" />
+			<property name="versionFormat" value="\$Id.*\$"/>
+		</module>
+        <module name="JavadocVariable">
+			<property name="scope" value="protected" />
+		</module>
+		<!-- gvSIG rule 3: Check correctly formatted Javadoc -->
+		<module name="JavadocStyle">
+			<property name="scope" value="protected" />
+		</module>
+
+
+        <!-- Checks for Naming Conventions.                  -->
+        <!-- See http://checkstyle.sf.net/config_naming.html -->
+        <module name="ConstantName"/>
+        <module name="LocalFinalVariableName"/>
+        <module name="LocalVariableName"/>
+        <module name="MemberName"/>
+        <module name="MethodName"/>
+		<!-- gvSIG rule 15: All packages must begin with org.gvsig.  -->
+		<module name="PackageName">
+			<property name="format" value="^org\.gvsig(\.[a-z][a-z0-9]*)+$" />
+		</module>
+		<!-- gvSIG advised rule 1: Abstract class names must begin with Abstract. -->
+		<!-- module name="AbstractClassName" /-->
+        <module name="ParameterName"/>
+        <module name="StaticVariableName"/>
+        <module name="TypeName"/>
+
+        <!-- Checks for imports                              -->
+        <!-- See http://checkstyle.sf.net/config_import.html -->
+        <module name="AvoidStarImport"/>
+        <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+        <module name="RedundantImport"/>
+        <module name="UnusedImports"/>
+
+
+        <!-- Checks for Size Violations.                    -->
+        <!-- See http://checkstyle.sf.net/config_sizes.html -->
+        <module name="LineLength"/>
+        <module name="MethodLength"/>
+        <module name="ParameterNumber"/>
+
+
+        <!-- Checks for whitespace                               -->
+        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+        <module name="EmptyForIteratorPad"/>
+        <module name="GenericWhitespace"/>
+        <module name="MethodParamPad"/>
+        <module name="NoWhitespaceAfter"/>
+        <module name="NoWhitespaceBefore"/>
+        <module name="OperatorWrap"/>
+        <module name="ParenPad"/>
+        <module name="TypecastParenPad"/>
+        <module name="WhitespaceAfter"/>
+        <module name="WhitespaceAround"/>
+
+
+        <!-- Modifier Checks                                    -->
+        <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+        <module name="ModifierOrder"/>
+        <module name="RedundantModifier"/>
+
+
+        <!-- Checks for blocks. You know, those {}'s         -->
+        <!-- See http://checkstyle.sf.net/config_blocks.html -->
+        <module name="AvoidNestedBlocks"/>
+        <module name="EmptyBlock"/>
+        <module name="LeftCurly"/>
+        <module name="NeedBraces"/>
+        <module name="RightCurly"/>
+
+
+        <!-- Checks for common coding problems               -->
+        <!-- See http://checkstyle.sf.net/config_coding.html -->
+        <module name="AvoidInlineConditionals"/>
+        <module name="DoubleCheckedLocking"/>    <!-- MY FAVOURITE -->
+        <module name="EmptyStatement"/>
+        <module name="EqualsHashCode"/>
+        <module name="HiddenField"/>
+        <module name="IllegalInstantiation"/>
+        <module name="InnerAssignment"/>
+        <module name="MagicNumber"/>
+        <module name="MissingSwitchDefault"/>
+        <module name="RedundantThrows"/>
+        <module name="SimplifyBooleanExpression"/>
+        <module name="SimplifyBooleanReturn"/>
+
+		<!-- gvSIG: Check for some common programming errors -->
+		<module name="CovariantEquals" />
+		<module name="StringLiteralEquality" />
+
+        <!-- Checks for class design                         -->
+        <!-- See http://checkstyle.sf.net/config_design.html -->
+        <module name="DesignForExtension"/>
+        <module name="FinalClass"/>
+        <module name="HideUtilityClassConstructor"/>
+        <module name="InterfaceIsType"/>
+        <module name="VisibilityModifier"/>
+
+
+        <!-- Miscellaneous other checks.                   -->
+        <!-- See http://checkstyle.sf.net/config_misc.html -->
+        <module name="ArrayTypeStyle"/>
+        <!-- gvSIG: removed -->
+        <!-- module name="FinalParameters"/-->
+        <module name="TodoComment"/>
+        <module name="UpperEll"/>
+				
+	    <!-- gvSIG rule 2: Sun style with 4 spaces -->
+	    <module name="Indentation">
+	    	<property name="basicOffset" value="4"/>
+		    <property name="caseIndent" value="0"/>
+		</module>
+        
+        <!-- gvSIG rule 10: Do not use System.out/err to log -->
+		<module name="Regexp">
+		    <!-- . matches any character, so we need to escape it and use \. 
+		    to match dots.-->
+		    <property name="format" value="System\.[out|err]\.println"/>
+		    <property name="illegalPattern" value="true"/>
+		</module>
+		
+		<!-- gvSIG rule 11: Try to avoid catching Throwable or 
+		Exception and catch specific exceptions instead. -->
+		<module name="IllegalCatch"/>
+		
+		<!-- gvSIG rule 13: Use interfaces in the declaration of 
+		methods and variables.
+        By default only avoids usage of Classes:
+			"java.util.GregorianCalendar, java.util.Hashtable, 
+		  	java.util.HashSet, java.util.HashMap, java.util.ArrayList, 
+		  	java.util.LinkedList, java.util.LinkedHashMap, 
+		  	java.util.LinkedHashSet, java.util.TreeSet, 
+		  	java.util.TreeMap, java.util.Vector" -->
+		<module name="IllegalType">
+		    <property name="ignoredMethodNames" value="getInstance"/>
+		</module>
+		
+    </module>
+
+	<!--  gvSIG rule 1: check for the gvSIG header -->
+	<module name="RegexpHeader">
+		<!-- The follow property value demonstrates the ability     -->
+		<!-- to have access to ANT properties. In this case it uses -->
+		<!-- the ${basedir} property to allow Checkstyle to be run  -->
+		<!-- from any directory within a project. See property      -->
+		<!-- expansion,                                             -->
+		<!-- http://checkstyle.sf.net/config.html#properties        -->
+		<property name="headerFile" value="${checkstyle.header.file}" />
+
+	</module>
+
+</module>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/checkstyle/checkstyle_gvsig.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/checkstyle/gvsig.header
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/checkstyle/gvsig.header	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/checkstyle/gvsig.header	(revision 1459)
@@ -0,0 +1,21 @@
+ ?/\* gvSIG\. Geographic Information System of the Valencian Government *$
+ ?\* *$
+ ?\* Copyright \(C\) 20\d\d-20\d\d Infrastructures and Transports Department *$
+ ?\* of the Valencian Government \(CIT\) *$
+ ?\* *$
+ ?\* This program is free software; you can redistribute it and/or *$
+ ?\* modify it under the terms of the GNU General Public License *$
+ ?\* as published by the Free Software Foundation; either version 2 *$
+ ?\* of the License, or \(at your option\) any later version\. *$
+ ?\* *$
+ ?\* This program is distributed in the hope that it will be useful, *$
+ ?\* but WITHOUT ANY WARRANTY; without even the implied warranty of *$
+ ?\* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\.  See the *$
+ ?\* GNU General Public License for more details\. *$
+ ?\* *$
+ ?\* You should have received a copy of the GNU General Public License *$
+ ?\* along with this program; if not, write to the Free Software *$
+ ?\* Foundation, Inc\., 51 Franklin Street, Fifth Floor, Boston, *$
+ ?\* MA  02110-1301, USA\. *$
+ ?\* *$
+ ?\*/ *$
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/assembly/native.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/assembly/native.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/assembly/native.xml	(revision 1459)
@@ -0,0 +1,16 @@
+<assembly>
+	<id>${native-classifier}</id>
+	<formats>
+		<format>tar.gz</format>
+	</formats>
+	<baseDirectory></baseDirectory>
+	<fileSets>
+		<fileSet>
+			<directory>${project.build.directory}/target_cmake_product</directory>
+			<includes>
+				<include>**/**</include>
+			</includes>
+			<outputDirectory>/</outputDirectory>
+		</fileSet>
+	</fileSets>
+</assembly>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/assembly/native.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/MANIFEST.MF
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/MANIFEST.MF	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/MANIFEST.MF	(revision 1459)
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Built-By: cordin
+Build-Jdk: 1.6.0_26
+

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/maven/org.gvsig/org.gvsig.maven.base.tools/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/maven/org.gvsig/org.gvsig.maven.base.tools/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/maven/org.gvsig/org.gvsig.maven.base.tools/pom.xml	(revision 1459)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+                      
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.maven.base.tools</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.maven.base.tools</name>
+	<description>Maven build utilities for gvSIG</description>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.maven.base</artifactId>
+		<version>1.0.8-SNAPSHOT</version>
+	</parent>	
+</project>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/maven/org.gvsig/org.gvsig.maven.base.tools/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/maven/org.gvsig/org.gvsig.maven.base.tools/pom.properties
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/maven/org.gvsig/org.gvsig.maven.base.tools/pom.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/maven/org.gvsig/org.gvsig.maven.base.tools/pom.properties	(revision 1459)
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Thu Dec 15 17:47:45 CET 2011
+version=1.0.8-SNAPSHOT
+groupId=org.gvsig
+artifactId=org.gvsig.maven.base.tools

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/META-INF/maven/org.gvsig/org.gvsig.maven.base.tools/pom.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/depman-ant.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/depman-ant.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/depman-ant.xml	(revision 1459)
@@ -0,0 +1,18 @@
+<project name="Native Build System" default="native" basedir=".">
+
+	<import file="utilities.xml" />
+
+	<target name="generate">
+		<cmake args="-DCMAKE_INSTALL_PREFIX='${project.build.directory}/target_cmake_product'" />
+	</target>
+
+	<target name="build">
+		<make-install numProc="${numProc}" />
+	</target>
+
+	<target name="native" depends="build" />
+
+	<target name="native-eclipse" depends="generate" />
+
+</project>
+

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/depman-ant.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/utilities.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/utilities.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/utilities.xml	(revision 1459)
@@ -0,0 +1,132 @@
+<project name="ant_libs">
+	<dirname file="${ant.file.ant_libs}" property="ant.file.ant_libs.dir"/>
+
+	<!--
+		====================================
+		Compilation base properties
+		====================================
+	-->
+	<property name="JUNIT_HOME" location="${ant.file.ant_libs.dir}" />
+	<property name="JavaSourceVersion" value="1.5"/>
+	<property name="JavaTargetVersion" value="1.5"/>
+	<property name="debug" value="on"/>
+	<property name="debuglevel" value="lines, vars, source"/>
+	<property name="encoding" value="ISO_8859_1"/>
+	<property name="workspaceDir" location="${ant.file.ant_libs.dir}/../.."/>
+	<property name="workspace_loc" location="${workspaceDir}"/>
+	<property name="binaries_loc" location="${workspace_loc}/binaries"/>
+	<property name="dependencies_loc" location="${binaries_loc}/dependencies"/>
+	<property name="lib_loc" location="${binaries_loc}/lib"/>
+	<property name="unixOS" value="Linux,SunOS,Solaris,Mac OS X" />
+
+
+	<!-- Macros to call the usual maven 2 goals from ant -->
+	<macrodef name="mvn">
+	   <attribute name="arg" />
+	   <sequential>
+			<exec executable="${workspaceDir}/build/maven/bin/mvn" failonerror="true" os="${unixOS}">
+				<arg line="@{arg}"/>
+			</exec>
+			<exec executable="cmd" os="windows">
+		    	<arg value="/c"/>
+		    	<arg value="${workspaceDir}/build/maven/bin/mvn.bat"/>
+		    	<arg value="@{arg}"/>
+		    </exec>
+	   </sequential>
+	</macrodef>	
+	
+	<macrodef name="mvn-clean">
+	   <sequential>
+	   		<mvn arg="clean"/>
+	   </sequential>
+	</macrodef>
+	
+	<macrodef name="mvn-compile">
+	   <sequential>
+	   		<mvn arg="compile"/>
+	   </sequential>
+	</macrodef>
+
+	<macrodef name="mvn-install">
+	   <attribute name="tofile" />
+	   <attribute name="mvnJarName"/>
+	   <attribute name="disable-tests" default="false" />
+	   <sequential>
+	   		<mvn arg="install"/>
+			<copy tofile="@{tofile}" file="target/@{mvnJarName}"/>
+	   </sequential>
+	</macrodef>
+
+	<macrodef name="mvn-install-no-tests">
+	   <attribute name="tofile" />
+	   <attribute name="mvnJarName"/>
+	   <attribute name="disable-tests" default="false" />
+	   <sequential>
+	   		<mvn arg="-Dmaven.test.skip=true install"/>
+			<copy tofile="@{tofile}" file="target/@{mvnJarName}"/>
+	   </sequential>
+	</macrodef>
+	
+	<macrodef name="mvn-javadoc">
+	   <sequential>
+	   		<mvn arg="javadoc:javadoc"/>
+	   </sequential>
+	</macrodef>
+
+
+	<!-- Macros to call the usual cmake goals from ant -->
+	<property name="target" value="target/target_cmake"/>
+	<property name="cmakeExe" value="cmake"/>
+	<property name="buildman.executable" location="${workspaceDir}/build/buildman/bin/bmn.py" />
+
+	<macrodef name="cmake">
+		<attribute name="install-dependencies" default="OFF"/>
+		<attribute name="cmake-build-type" default="Release"/>
+		<attribute name="args" default=""/>
+	   <sequential>
+			<mkdir dir="${target}" />
+			<delete file="${target}/CMakeCache.txt"/>
+	        <exec dir="${target}" executable="${cmakeExe}" failonerror="true" os="${unixOS}">
+    	        <arg value="-GUnix Makefiles" />
+        	    <arg value="-DCMAKE_BUILD_TYPE=@{cmake-build-type}" />
+            	<arg value="-DINSTALL_DEPENDENCIES=@{install-dependencies}"/>
+            	<arg line="@{args}"/>
+	            <arg value="../../" />
+    	    </exec>
+	        <exec dir="${target}" executable="${cmakeExe}" failonerror="true" osfamily="windows">
+    	        <arg value="-GNMake Makefiles" />
+        	    <arg value="-DCMAKE_BUILD_TYPE=@{cmake-build-type}" />
+            	<arg value="-DINSTALL_DEPENDENCIES=@{install-dependencies}"/>
+            	<arg line="@{args}"/>
+	            <arg value="..\\..\\" />
+    	    </exec>
+		</sequential>
+	</macrodef>	
+
+	<macrodef name="make-install">
+		<attribute name="numProc" default="2"/>
+	   <sequential>
+			<exec dir="${target}" executable="make" failonerror="true" os="${unixOS}">
+				<arg value="-j@{numProc}"/>
+				<arg value="install"/>
+			</exec>
+			<exec dir="${target}" executable="nmake" failonerror="true" osfamily="windows">
+				<arg value="install"/>
+			</exec>
+		</sequential>
+	</macrodef>
+	<macrodef name="buildman">
+		<attribute name="goal"/>
+		<attribute name="args" default=""/>
+	   	<sequential>
+			<exec executable="python" failonerror="true" >
+				<arg value="${buildman.executable}" />
+				<arg value="@{goal}" />
+				<arg line="@{args}" />
+			</exec>
+		</sequential>
+	</macrodef>
+</project>
+
+
+

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/utilities.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/gvsig-extension-tasks.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/gvsig-extension-tasks.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/gvsig-extension-tasks.xml	(revision 1459)
@@ -0,0 +1,23 @@
+<project name="gvSIG-extension-tasks" default="make-extension-new">
+	<description>
+		Ant tasks for extension installation
+	</description>
+
+	<!-- gvSIG extension targets -->
+	<condition property="isJar">
+		<equals arg1="${project.packaging}" arg2="jar" />
+	</condition>
+
+	<target name="check-file" if="isJar">
+			<available file="target/${distribution-final-name}-distribution/${distribution-final-name}" type="dir"
+	           property="distribution.present"/>
+
+	</target>
+
+	<target name="make-extension-new" if="distribution.present" depends="check-file">
+		<echo message="======================== Copying extension files to extensions dir..." />
+		<copy todir="${gvsig.install.dir}">
+			<fileset dir="target/${distribution-final-name}-distribution/${distribution-final-name}" includes="**/**" />
+		</copy>
+	</target>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/ant/gvsig-extension-tasks.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/gvsig.header
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/gvsig.header	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.maven.base.tools/gvsig.header	(revision 1459)
@@ -0,0 +1,19 @@
+gvSIG. Geographic Information System of the Valencian Government
+ 
+Copyright (C) 2007-2008 Infrastructures and Transports Department
+of the Valencian Government (CIT)
+  
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+  
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+ 
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+MA  02110-1301, USA.
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/maven-archiver/pom.properties
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/maven-archiver/pom.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/maven-archiver/pom.properties	(revision 1459)
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Mon Jan 23 13:01:08 CET 2012
+version=2.0.0-SNAPSHOT
+groupId=org.gvsig
+artifactId=org.gvsig.raster.wmts.swing.api

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/maven-archiver/pom.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.raster.wmts.swing.api-2.0.0-SNAPSHOT-test-sources.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/org.gvsig.raster.wmts.swing.api-2.0.0-SNAPSHOT-test-sources.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/META-INF/services/org.gvsig.tools.library.Library	(revision 1459)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.swing.WMTSSwingLibrary
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WMTSSwingManager.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WMTSSwingManager.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WMTSWindowManager.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WMTSWindowManager.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WmtsGUI.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WmtsGUI.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WMTSSwingLocator.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WMTSSwingLocator.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WMTSSwingLibrary.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/target/classes/org/gvsig/raster/wmts/swing/WMTSSwingLibrary.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1459)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.ogc.impl.WMTSOGCImplLibrary
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/pom.xml	(revision 1459)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.wmts.ogc.impl</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.wmts.ogc.impl</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.wmts.ogc</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+	<dependencies>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>           
+            <scope>compile</scope>
+        </dependency> 
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.wmts.ogc.api</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+        </dependency>
+         <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <classifier>spi</classifier>
+            <scope>compile</scope>
+        </dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.swing.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.i18n</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	</dependencies>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/pom.xml	(revision 1459)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+		 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.wmts.ogc</artifactId>
+	<packaging>pom</packaging>
+	<name>org.gvsig.raster.wmts.ogc</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.wmts</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.andami</artifactId>
+            <scope>compile</scope>
+		</dependency>
+	</dependencies>
+	<modules>
+		<module>org.gvsig.raster.wmts.ogc.api</module>
+		<module>org.gvsig.raster.wmts.ogc.impl</module>
+	</modules>
+</project>
+

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1459)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.ogc.WMTSOGCLibrary
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/pom.xml	(revision 1459)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.wmts.ogc.api</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.wmts.ogc.api</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.wmts.ogc</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+	<dependencies>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>      
+            <scope>compile</scope>
+        </dependency> 
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+				</configuration>
+				<executions>
+				<!--
+				Generates a jar file only with the test classes
+				-->
+					<execution>
+						<goals>
+							<goal>test-jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/prepare-workspace.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/prepare-workspace.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/prepare-workspace.xml	(revision 1459)
@@ -0,0 +1,151 @@
+<project name="org.gvsig.initial.build" default="prepare-workspace">
+
+	<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}" />
+
+	<property name="workspace.basedir" value="${org.gvsig.initial.build.basedir}/.." />
+	<property name="build.basedir" value="${workspace.basedir}/org.gvsig.maven.base.build" description="Eclipse workspace location" />
+	<property name="build.jar.version" value="1.0.8-SNAPSHOT" />
+	<property name="build.jar.file" value="org.gvsig.maven.base.build-${build.jar.version}.jar" />
+
+	<property name="ant.libs.dir" location="${build.basedir}" description="Additional ant tasks libs folder" />
+
+	<target name="check-maven-base-build-available">
+		<available file="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" property="maven-base-build-available" />
+	</target>
+
+	<target name="get-maven-base-build-local" depends="check-maven-base-build-available" if="maven-base-build-available">
+		<!-- Unzip de build jar file from the maven repository into the workspace root folder -->
+		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
+			<zipfileset src="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}">
+				<patternset>
+					<exclude name="META-INF/**" />
+				</patternset>
+			</zipfileset>
+		</copy>
+	</target>
+
+	<target name="get-maven-base-build-remote" depends="check-maven-base-build-available" unless="maven-base-build-available">
+		<mkdir dir="target" />
+
+		<!-- Download the build jar file -->
+		<get src="http://devel.gvsig.org/m2repo/j2se/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" dest="target/${build.jar.file}" verbose="true" />
+
+		<!-- Unzip de build jar file into the workspace root folder -->
+		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
+			<zipfileset src="target/${build.jar.file}">
+				<patternset>
+					<exclude name="META-INF/**" />
+				</patternset>
+			</zipfileset>
+		</copy>
+
+	</target>
+	
+	<target name="find.depends.natives.file">
+	    <condition property="depends.natives.file.exists">
+            <available file="${org.gvsig.initial.build.basedir}/DEPENDS_ON_NATIVE_LIBRARIES"/>
+	    </condition>	
+	</target>
+	
+	<target name="find.gvsig.platform.properties.file" 
+			depends="find.depends.natives.file"
+			if="depends.natives.file.exists">
+	    <condition property="gvsig.platform.exists">
+            <available file="${user.home}/.gvsig.platform.properties"/>
+	    </condition>	
+	</target>
+	
+	<target name="check.gvsig.platform.properties" 
+			depends="find.gvsig.platform.properties.file">
+		<fail if="depends.natives.file.exists" unless="gvsig.platform.exists">
+ERROR!!
+	
+You have to define your gvSIG platform properties, 
+by creating the file: ${user.home}/.gvsig.platform.properties
+with the following content:
+
+native_platform=linux
+native_distribution=all
+native_compiler=gcc4
+native_arch=i386
+native_libraryType=dynamic
+export native_classifier=${native_platform}-${native_distribution}-${native_compiler}-${native_arch}-${native_libraryType}
+
+Replace the fifth initial variables values with the ones appropiate 
+to your platform.
+	
+If you use maven in the command line, you can use the previous file also
+to define the MAVEN_OPTS environment variable, by adding to your 
+.bash_rc file something like this:
+
+if [ -f "${HOME}/.gvsig.platform.properties" ]
+then
+    . ${HOME}/.gvsig.platform.properties
+    export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m -Dnative-classifier=${native_classifier}"
+else
+    export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m"
+fi
+
+It will work if you use the bash shell. In any other case or platform, you'll
+have to define your MAVEN_OPTS environment variable and set the 
+"native-classifier" parameter directly.
+		</fail>			
+	
+	</target>
+
+	<target name="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote,check.gvsig.platform.properties">
+
+		<mkdir dir="target" />
+
+		<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" />
+
+		<!-- Copy the maven launchers to the workspace metadata folder -->
+		<copy todir="${workspace.basedir}/.metadata">
+			<fileset dir="${build.basedir}/eclipse-launchers">
+				<exclude name="**/org.eclipse.jdt.core.prefs" />
+				<exclude name="**/org.eclipse.core.variables.prefs" />
+			</fileset>
+		</copy>
+
+		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" append="true">
+			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.jdt.core.prefs" />
+		</concat>
+		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" append="true">
+			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.core.variables.prefs" />
+		</concat>
+
+		<!-- Configure the eclipse workspace -->
+		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" />
+
+		<!-- Configure the gvSIG profile -->
+		<ant antfile="${build.basedir}/check-gvsig-profile.xml" />
+
+		<property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" />
+
+		<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
+			<classpath>
+				<pathelement location="${ant.libs.dir}/com.oopsconsultancy.xmltask-1.16.1.jar" />
+			</classpath>
+		</taskdef>
+
+		<xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}">
+			<copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" />
+		</xmltask>
+
+		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
+		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
+
+		<!-- Compile, install and generate eclipse projects -->
+		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" />
+
+		<echo>INFORMATION!!!</echo>
+		<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo>
+
+		<!-- TODO: copiar al proyecto de configuración general -->
+	</target>
+
+	<target name="clean">
+		<delete dir="target" />
+	</target>
+	
+</project>

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/prepare-workspace.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/pom.xml	(revision 1459)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0                       http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.wmts</artifactId>
+	<packaging>pom</packaging>
+	<version>2.0.0-SNAPSHOT</version>
+	<name>org.gvsig.raster.wmts</name>
+	<description>WMTS client</description>
+	<inceptionYear>2011</inceptionYear>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>gvsig-base-pom</artifactId>
+        <version>2.0-SNAPSHOT</version>
+    </parent>
+     <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.core.maven.dependencies</artifactId>
+                <version>2.0.1-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <developers>
+		<developer>
+			<id>nbrodin</id>
+			<name>Nacho Brodin</name>
+			<email>nachobrodin@gmail.com</email>
+			<roles>
+				<role>Architect</role>
+				<role>Developer</role>
+			</roles>
+		</developer>
+	</developers>
+	<properties>
+		<build-dir>${basedir}/../..</build-dir>
+	</properties>
+	<modules>
+		<!--<module>org.gvsig.raster.wmts.swing</module>-->
+		<module>org.gvsig.raster.wmts.io</module>
+		<module>org.gvsig.raster.wmts.app</module>
+	</modules>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/pom.xml	(revision 1459)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.gvsig.raster.wmts.app</artifactId>
+    <packaging>pom</packaging>
+    <version>2.0.0-SNAPSHOT</version>
+    <name>org.gvsig.raster.wmts.app</name>
+    <description>WMTS application</description>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.maven.base.extension.pom</artifactId>
+        <version>1.0.8-SNAPSHOT</version>
+    </parent>
+
+    <scm>
+        <connection>scm:svn:https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app</connection>
+        <developerConnection>scm:svn:https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app</developerConnection>
+        <url>https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts</url>
+    </scm>
+
+    <developers>
+        <developer>
+            <id>nbrodin</id>
+            <name>Nacho Brodin</name>
+            <email>nachobrodin@gmail.com</email>
+            <roles>
+                <role>Architect</role>
+                <role>Developer</role>
+            </roles>
+        </developer>
+    </developers>
+    <repositories>
+        <repository>
+            <id>gvsig-public-http-repository</id>
+            <name>gvSIG maven public HTTP repository</name>
+            <url>http://devel.gvsig.org/m2repo/j2se</url>
+            <releases>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>warn</checksumPolicy>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>warn</checksumPolicy>
+            </snapshots>
+        </repository>
+    </repositories>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.core.maven.dependencies</artifactId>
+                <type>pom</type>
+                <version>2.0.1-SNAPSHOT</version>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.andami</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.i18n</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+    <modules>
+        <module>org.gvsig.raster.wmts.app.wmtsclient</module>
+    </modules>
+    <properties>
+    	<package.info.state>testing</package.info.state>
+    </properties>
+</project>

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/distribution/distribution.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/distribution/distribution.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/distribution/distribution.xml	(revision 1459)
@@ -0,0 +1,2 @@
+<assembly>
+</assembly>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/distribution/distribution.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/buildNumber.properties
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/buildNumber.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/buildNumber.properties	(revision 1459)
@@ -0,0 +1,3 @@
+#maven.buildNumber.plugin properties file
+#Mon Jun 25 09:20:51 CEST 2012
+buildNumber=2
Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/wmts/io/TestWMTSDriver.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/wmts/io/TestWMTSDriver.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/wmts/io/TestWMTSDriver.java	(revision 1459)
@@ -0,0 +1,94 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.io;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.remoteclient.wmts.exception.WMTSException;
+import org.gvsig.remoteclient.wmts.struct.WMTSServiceIdentification;
+import org.gvsig.remoteclient.wmts.struct.WMTSServiceProvider;
+import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestWMTSDriver extends AbstractLibraryAutoInitTestCase {
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestWMTSDriver running...");
+	}
+	
+	public void testStack() {
+		
+		URL url = null;
+		try {
+			url = new URL("http://scolab.es:9090/geoserver/gwc/service/wmts");
+			
+			//Crea el manejador para la versi�n del servidor y devuelve la versi�n 
+			//WMTSConnector conn = WMTSDriver.getConnectorFromURL(url);
+			//String version = conn.getVersion();
+			
+			//Creamos un explorer para obtener los datos del servidor
+			WMTSServerExplorerParameters.registerDynClass();
+			WMTSServerExplorerParameters param = new WMTSServerExplorerParameters();
+			param.setHost(url.toString());
+			WMTSServerExplorer explorer = new WMTSServerExplorer(param, null);
+			explorer.connect(null);
+			
+			WMTSServiceIdentification id = explorer.getServiceIdentification();
+			String title = id.getTitle();
+			String version = id.getServiceTypeVersion();
+			String type = id.getServiceType();
+			
+			WMTSServiceProvider prov = explorer.getServiceProvider();
+			String pN = prov.getProviderName();
+			String pS = prov.getProviderSite();
+			String pC = prov.getServiceContact();
+			
+			//WMTSThemes themes = explorer.getThemes();
+			System.out.println("Title: " + title);
+			System.out.println("Version: " + version);
+			System.out.println("Type: " + type);
+			System.out.println("Provider Name: " + pN);
+			System.out.println("Provider Site: " + pS);
+			System.out.println("Service Contact: " + pC);
+			
+			//En este caso solo hay una lista de temas con una capa por cada uno
+			//pero en un caso corriente seria un �rbol de themas con una capa asociada a cada uno
+			/*for (int i = 0; i < themes.size(); i++) {
+				WMTSLayer layer = ((WMTSTheme)themes.get(i)).getLayer();
+				if(layer != null)
+					layer.print();
+			}*/
+			
+		} catch (MalformedURLException e) {
+			e.printStackTrace();
+		} catch (InitializeException e) {
+			e.printStackTrace();
+		} catch (WMTSException e) {
+			e.printStackTrace();
+		}
+		
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/wmts/io/TestWMTSDriver.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/dialog/TestPropsDialog.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/dialog/TestPropsDialog.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/dialog/TestPropsDialog.java	(revision 1459)
@@ -0,0 +1,42 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.dialog;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.dialog.WMTSPropsDialog;
+
+public class TestPropsDialog {
+	private int               w        = 510;
+	private int               h        = 610;
+	private JFrame            frame    = new JFrame();
+	private WMTSPropsDialog   desc     = null;
+
+	public TestPropsDialog() {
+		desc = new WMTSPropsDialog();
+		frame.getContentPane().add(desc);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestPropsDialog();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/dialog/TestPropsDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestILayerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestILayerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestILayerPanel.java	(revision 1459)
@@ -0,0 +1,42 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.panel.layer;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer.ILayerPanel;
+
+public class TestILayerPanel {
+	private int               w        = 510;
+	private int               h        = 610;
+	private JFrame            frame    = new JFrame();
+	private ILayerPanel       desc     = null;
+
+	public TestILayerPanel() {
+		desc = new ILayerPanel();
+		frame.getContentPane().add(desc);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestILayerPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestILayerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestLayerListPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestLayerListPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestLayerListPanel.java	(revision 1459)
@@ -0,0 +1,42 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.panel.layer;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer.LayersSelectedPanel;
+
+public class TestLayerListPanel {
+	private int               w        = 510;
+	private int               h        = 610;
+	private JFrame            frame    = new JFrame();
+	private LayersSelectedPanel    desc     = null;
+
+	public TestLayerListPanel() {
+		desc = new LayersSelectedPanel();
+		frame.getContentPane().add(desc);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestLayerListPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestLayerListPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestAddDelPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestAddDelPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestAddDelPanel.java	(revision 1459)
@@ -0,0 +1,42 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.panel.layer;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer.AddDelLayerPanel;
+
+public class TestAddDelPanel {
+	private int               w        = 510;
+	private int               h        = 110;
+	private JFrame            frame    = new JFrame();
+	private AddDelLayerPanel  desc     = null;
+
+	public TestAddDelPanel() {
+		desc = new AddDelLayerPanel();
+		frame.getContentPane().add(desc);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestAddDelPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/layer/TestAddDelPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/TestStylesPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/TestStylesPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/TestStylesPanel.java	(revision 1459)
@@ -0,0 +1,41 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.panel;
+
+import javax.swing.JFrame;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.StylesPanel;
+
+public class TestStylesPanel {
+	private int               w        = 510;
+	private int               h        = 610;
+	private JFrame            frame    = new JFrame();
+	private StylesPanel       desc     = null;
+
+	public TestStylesPanel() {
+		desc = new StylesPanel();
+		frame.getContentPane().add(desc);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+ 
+	public static void main(String[] args) {
+		new TestStylesPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/TestStylesPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestServerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestServerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestServerPanel.java	(revision 1459)
@@ -0,0 +1,42 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.panel.main;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main.IServerPanel;
+
+public class TestServerPanel {
+	private int               w        = 510;
+	private int               h        = 610;
+	private JFrame            frame    = new JFrame();
+	private IServerPanel       desc     = null;
+
+	public TestServerPanel() {
+		desc = new IServerPanel();
+		frame.getContentPane().add(desc);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestServerPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestServerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestConnectPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestConnectPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestConnectPanel.java	(revision 1459)
@@ -0,0 +1,42 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.panel.main;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main.ConnectPanel;
+
+public class TestConnectPanel {
+	private int               w        = 510;
+	private int               h        = 90;
+	private JFrame            frame    = new JFrame();
+	private ConnectPanel      connect  = null;
+
+	public TestConnectPanel() {
+		connect = new ConnectPanel();
+		frame.getContentPane().add(connect);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestConnectPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestConnectPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestNextPrevPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestNextPrevPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestNextPrevPanel.java	(revision 1459)
@@ -0,0 +1,42 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.panel.main;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main.NextPrevPanel;
+
+public class TestNextPrevPanel {
+	private int               w        = 510;
+	private int               h        = 100;
+	private JFrame            frame    = new JFrame();
+	private NextPrevPanel     desc     = null;
+
+	public TestNextPrevPanel() {
+		desc = new NextPrevPanel();
+		frame.getContentPane().add(desc);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestNextPrevPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestNextPrevPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestDescriptionPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestDescriptionPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestDescriptionPanel.java	(revision 1459)
@@ -0,0 +1,42 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.panel.main;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main.DescriptionPanel;
+
+public class TestDescriptionPanel {
+	private int               w        = 510;
+	private int               h        = 510;
+	private JFrame            frame    = new JFrame();
+	private DescriptionPanel  desc     = null;
+
+	public TestDescriptionPanel() {
+		desc = new DescriptionPanel();
+		frame.getContentPane().add(desc);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestDescriptionPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/main/TestDescriptionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/format/TestFormatsPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/format/TestFormatsPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/format/TestFormatsPanel.java	(revision 1459)
@@ -0,0 +1,42 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.app.extension.wmtsclient.gui.panel.format;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.format.IFormatsPanel;
+
+public class TestFormatsPanel {
+	private int               w        = 510;
+	private int               h        = 610;
+	private JFrame            frame    = new JFrame();
+	private IFormatsPanel      desc     = null;
+
+	public TestFormatsPanel() {
+		desc = new IFormatsPanel();
+		frame.getContentPane().add(desc);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestFormatsPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/panel/format/TestFormatsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/text.properties
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/text.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/text.properties	(revision 1459)
@@ -0,0 +1,11 @@
+WMTSLayer=Capa WMTS
+select_info_formats=Seleccionar formatos de texto (Info)
+wmts_properties=Propiedades WMTS
+wmts_cant_connect=No ha sido posible realizar la conexi\u00f3n con el servidor WMTS
+wmts_not_queryable=Este servidor no acepta peticiones de este tipo
+wmts_server_error=Error del servidor WMTS
+wmts_transparency=Transparencia
+WMTSLayer=Capa WMTS
+fit_WMTS_layer=Ajustar capa WMTS
+invert_axis_order=Invertir orden de los ejes
+cache_refresh=Este check debe estar activado antes de pulsar el bot�n de conectar.\n Si la capa fue cargada previamente con este check box\n en distinta posici�n es posible que el contenido de la cach� sea erroneo \n. Limpiela antes de continuar.
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/text.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/text_en.properties
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/text_en.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/text_en.properties	(revision 1459)
@@ -0,0 +1,11 @@
+WMTSLayer=WMTS Layer
+select_info_formats=Select text formats for Info by point
+wmts_properties=WMTS Properties
+wmts_cant_connect=The connection cannot be established
+wmts_not_queryable=This server does not accept this kind of requests
+wmts_server_error=Error in WMTS Server
+wmts_transparency=Transparency
+WMTSLayer=WMTS Layer
+fit_WMTS_layer=Fits to WTMS layer
+invert_axis_order=Invert the order of the axes
+cache_refresh=This check has to be enabled before press the connect button.\n  If the layer was loaded with this check in other status it is possible that the cache not to be correct. \n. Clean the cache before continue.
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/text_en.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/config.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/config.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/config.xml	(revision 1459)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<plugin-config>
+	<depends plugin-name="org.gvsig.raster.tilecache.app" />
+	<libraries library-dir="lib"/>
+	<resourceBundle name="text"/>
+	<extensions>
+		<extension class-name="org.gvsig.raster.wmts.app.wmtsclient.WMTSClientExtension"
+			description="Support to access WMTS"
+			active="true"
+			priority="1">
+			<!-- Estas tools se pusieron para pruebas. 
+				Habilitan dos botones para llevar al siguiente/anterior nivel de resoluci�n
+			<tool-bar name="ZoomMas" position="5">
+				<action-tool icon="level-plus" action-command="NEXT_LEVEL" tooltip="Zoom_next_level" position="1"/>
+			</tool-bar>
+			<tool-bar name="ZoomMenos" position="5">
+				<action-tool icon="level-less" action-command="PREV_LEVEL" tooltip="Zoom_prev_level" position="2"/>
+			</tool-bar>
+			-->
+		</extension>
+	</extensions>
+</plugin-config>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/config.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/images/level-plus.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/images/level-plus.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/images/icon-layer-wmts.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/images/icon-layer-wmts.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/images/level-less.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/images/level-less.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/about/logo.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/about/logo.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/about/wmts-about.html
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/about/wmts-about.html	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/about/wmts-about.html	(revision 1459)
@@ -0,0 +1,28 @@
+<html>
+	<head>
+	<style type="text/css">
+	BODY { background-image: url(logo.png); background-repeat: no-repeat; background-position: 100% 0% }
+	</style>
+	</head>
+	<body>	
+		<h2>Soporte WMTS para gvSIG</h2>	
+		<p><b>Prodevelop S.L.</b> ha incorporado el soporte al formato WMTS para el proyecto de Espa�a Virtual</p>
+		
+		<p><b>Desarrollo:</b></p>
+		
+		<p>Director del proyecto:</p>
+		<ul>
+			<li>Miguel Montesinos Lajara</li>
+		</ul>
+		<p>Equipo de desarrollo:</p>
+		<ul>
+			<li>Nacho Brodin</li>
+		</ul>
+
+		<p>Build Number de la extensi&oacute;n: 1</p>
+		<center>
+			<p><b><a href="http://www.prodevelop.es" title="Prodevelop">http://www.prodevelop.es</a></b></p>
+		</center>
+		
+	</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/about/wmts-about.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/about/Thumbs.db
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources/about/Thumbs.db
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectSetWMTSInfo.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectSetWMTSInfo.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectSetWMTSInfo.java	(revision 1459)
@@ -0,0 +1,120 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.app.wmtsclient.layer;
+
+import org.gvsig.fmap.dal.feature.FeatureSet;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.DynObjectManager;
+import org.gvsig.tools.dynobject.DynObjectSet;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.observer.Observable;
+import org.gvsig.tools.observer.Observer;
+import org.gvsig.tools.observer.impl.BaseWeakReferencingObservable;
+import org.gvsig.tools.visitor.Visitor;
+
+/**
+ * {@link DynObject} implementation to facade of a {@link FeatureSet} and allow
+ * to be used as a {@link DynObjectSet}.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @version $Id$
+ */
+public class DynObjectSetWMTSInfo extends BaseWeakReferencingObservable
+    implements DynObjectSet, Observer {
+	public static final int             TYPE_TEXT = 0;
+	public static final int             TYPE_HTML = 1;
+	public static final int             TYPE_XML  = 2;
+	private DynObjectIteratorWMTSInfo   ite = null;
+	
+	public static void registerDynClass() {
+		DynObjectManager manager = ToolsLocator.getDynObjectManager();
+    	DynClass dynClass = manager.add("WMTSInfoByPoint", "WMTS InfoByPoint");
+    	dynClass.setNamespace("InfoByPoint");
+    	dynClass.addDynFieldString("info");
+	}
+	
+    /**
+     * Creates a new facade over a given info, with fast dynobject
+     * iteration.
+     */
+    public DynObjectSetWMTSInfo(String txt, int type) {
+    	DynObjectManager manager = ToolsLocator.getDynObjectManager();
+    	DynObject dynObject = manager.createDynObject("WMTSInfoByPoint");
+    	dynObject.setDynValue("info", txt);
+    	ite = new DynObjectIteratorWMTSInfo(dynObject);
+    }
+
+    public void dispose() {
+
+    }
+
+    public void accept(final Visitor visitor, long firstValueIndex) throws BaseException {
+    	while(ite.hasNext()) {
+    		visitor.visit(ite.next());
+    	}
+    }
+
+    public void accept(final Visitor visitor) throws BaseException {
+    	while(ite.hasNext()) {
+    		visitor.visit(ite.next());
+    	}
+    }
+
+    public long getSize() throws BaseException {
+       return ite.getSize();
+    }
+
+    public DisposableIterator iterator(long index) throws BaseException {
+        return iterator();
+    }
+
+    public DisposableIterator iterator() throws BaseException {
+    	return ite;
+    }
+
+    public boolean isEmpty() throws BaseException {
+    	return (getSize() == 0);
+    }
+
+    public boolean isDeleteEnabled() {
+    	return true;
+    }
+
+    public void delete(DynObject dynObject) throws BaseException {
+
+    }
+
+    public boolean isUpdateEnabled() {
+    	return true;
+    }
+
+    public void update(DynObject dynObject) throws BaseException {
+    	System.out.println();
+    }
+
+    public void update(Observable observable, Object notification) {
+    	System.out.println();
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectSetWMTSInfo.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java	(revision 1459)
@@ -0,0 +1,788 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.layer;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.print.attribute.PrintRequestAttributeSet;
+
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.ViewPortData;
+import org.gvsig.fmap.dal.coverage.exception.FilePaletteException;
+import org.gvsig.fmap.dal.coverage.exception.InfoByPointException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.render.Render;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLyrDefault;
+import org.gvsig.fmap.mapcontext.layers.operations.IHasImageLegend;
+import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.fmap.layers.NotAvailableStateException;
+import org.gvsig.raster.util.CancelTaskImpl;
+import org.gvsig.raster.util.persistence.PersistencyFilterParam;
+import org.gvsig.raster.wmts.io.WMTSDataParameters;
+import org.gvsig.raster.wmts.io.WMTSServerExplorer;
+import org.gvsig.raster.wmts.io.WMTSServerExplorerParameters;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObjectSet;
+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;
+import org.gvsig.tools.task.Cancellable;
+import org.gvsig.tools.task.SimpleTaskStatus;
+import org.gvsig.tools.task.TaskStatusManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+/**
+ * WMTS Layer class.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FLyrWMTS extends DefaultFLyrRaster implements IHasImageLegend {
+	public static final String           PERSISTENT_NAME           = "FLyrWMTS_Persistent";
+	public static final String           PERSISTENT_DESCRIPTION    = "FLyrWMTS Persistent Definition";
+	
+	private static final GeometryManager geomManager               = GeometryLocator.getGeometryManager();
+	private static final Logger          logger                    = LoggerFactory.getLogger(FLyrWMTS.class);
+	private List<WeakReference<Thread>>	 disableUpdateDrawVersion;
+	private Envelope					 fullEnvelope              = null;
+	private boolean						 firstLoad                 = false;
+	private RasterManager                rManager                  = RasterLocator.getManager();
+	private DataStoreParameters          params                    = null;
+	private WMTSServerExplorer           explorer                  = null;
+	private boolean                      deleteCache               = false;
+	//Is useful to save the last ViewPort to know the last zoom level in the screen
+	//private ViewPort                     lastViewPort              = null;
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.fmap.layers.DefaultFLyrRaster#loadFromState(org.gvsig.tools.persistence.PersistentState)
+	 */
+	@Override
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		String host = state.getString("host");
+		Object obj = state.get("parameters");
+		WMTSDataParameters storedParams = null;
+		if(obj instanceof WMTSDataParameters) {
+			storedParams = (WMTSDataParameters) obj;
+		}
+		if(obj instanceof TileDataParameters) {
+			DataParameters p = ((TileDataParameters) obj).getDataParameters();
+			if(p instanceof WMTSDataParameters)
+				storedParams = (WMTSDataParameters) p;
+		}
+		
+		try {
+			DataManager datamanager = DALLocator.getDataManager();
+			WMTSServerExplorerParameters explorerParams = null;
+			explorerParams = (WMTSServerExplorerParameters) datamanager.createServerExplorerParameters(WMTSServerExplorer.NAME);
+			explorerParams.setHost("");
+			explorerParams.setLongitudeFirst(new Boolean(false));
+			explorer = (WMTSServerExplorer) datamanager.createServerExplorer(explorerParams);
+			WMTSServerExplorerParameters params = (WMTSServerExplorerParameters)explorer.getParameters();
+			params.setHost(host);
+			explorer.connect(new CancelTaskImpl());
+		} catch (Exception e) {
+			throw new PersistenceException("Server comunication error", e);
+		}
+
+		DataStoreParameters paramsFromExplorer = explorer.getStoreParameters();
+		WMTSDataParameters wmtsParamsFromExplorer = null;
+		if(paramsFromExplorer instanceof WMTSDataParameters) {
+			wmtsParamsFromExplorer = (WMTSDataParameters) paramsFromExplorer;
+		}
+		if(paramsFromExplorer instanceof TileDataParameters) {
+			DataParameters p = ((TileDataParameters) paramsFromExplorer).getDataParameters();
+			if(p instanceof WMTSDataParameters)
+				wmtsParamsFromExplorer = (WMTSDataParameters) p;
+		}
+		
+		String layerName = state.getString("layername");
+		setName(layerName);
+		wmtsParamsFromExplorer.setLayer(explorer.getLayer(layerName));
+		wmtsParamsFromExplorer.assignFields(storedParams);
+		/*wmtsParamsFromExplorer.setImageFormat(state.getString(WMTSDataParameters.FIELD_IMAGE_FORMAT));
+		wmtsParamsFromExplorer.setInfoFormat(state.getString(WMTSDataParameters.FIELD_INFO_FORMAT));
+		wmtsParamsFromExplorer.setName(state.getString(WMTSDataParameters.FIELD_NAME));
+		wmtsParamsFromExplorer.setSRS(state.getString(WMTSDataParameters.FIELD_SRSSTR));
+		wmtsParamsFromExplorer.setOverrideHost(state.getBoolean(WMTSDataParameters.FIELD_OVERRIDE));
+		wmtsParamsFromExplorer.setExtent((Rectangle2D)state.get(WMTSDataParameters.FIELD_EXTENT));*/
+		params = wmtsParamsFromExplorer;
+		
+		dataStore = RasterLocator.getManager().getDataStructFactory().createDataStore();
+		getDataStore().setParameters(wmtsParamsFromExplorer);
+		getDataStore().loadFromState(state);
+		
+		super.loadFromState(state);
+		this.fullEnvelope = (Envelope) state.get("fullEnvelope");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.fmap.layers.DefaultFLyrRaster#saveToState(org.gvsig.tools.persistence.PersistentState)
+	 */
+	@Override
+	public void saveToState(PersistentState state) throws PersistenceException {
+		super.saveToState(state);
+		WMTSDataParameters p = getWMTSParameters(params);
+		
+		state.set("fullEnvelope", this.fullEnvelope);
+		state.set("host", p.getURI());
+		state.set("layername", p.getLayer().getTitle());
+		state.set("parameters", getParameters());
+		/*state.set(WMTSDataParameters.FIELD_EXTENT, p.getExtent());
+		state.set(WMTSDataParameters.FIELD_IMAGE_FORMAT, p.getImageFormat());
+		state.set(WMTSDataParameters.FIELD_INFO_FORMAT, p.getInfoFormat());
+		state.set(WMTSDataParameters.FIELD_NAME, p.getName());
+		state.set(WMTSDataParameters.FIELD_SRSSTR, p.getSRSCode());
+		state.set(WMTSDataParameters.FIELD_OVERRIDE, p.isOverridingHost());*/
+		
+		getDataStore().saveToState(state);
+	}
+
+	public static void registerPersistent() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			if (manager.getDefinition(FLyrDefault.class) == null) {
+				FLyrDefault.registerPersistent();
+			}
+
+			definition = manager.addDefinition(
+					FLyrWMTS.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null, 
+					null
+			);
+			
+			definition.extend(PersistenceManager.PERSISTENCE_NAMESPACE, "FLyrDefault");
+		}
+
+		DefaultFLyrRaster.registerPersistence(definition);
+		definition.addDynFieldObject("fullEnvelope").setClassOfValue(Envelope.class).setMandatory(false);
+		definition.addDynFieldString("host").setMandatory(false);
+		definition.addDynFieldString("layername").setMandatory(false);
+		
+		/*definition.addDynFieldObject(WMTSDataParameters.FIELD_EXTENT).setClassOfValue(Rectangle2D.class).setMandatory(false);
+		definition.addDynFieldString(WMTSDataParameters.FIELD_IMAGE_FORMAT).setMandatory(false);
+		definition.addDynFieldString(WMTSDataParameters.FIELD_INFO_FORMAT).setMandatory(false);
+		definition.addDynFieldString(WMTSDataParameters.FIELD_NAME).setMandatory(false);			
+		definition.addDynFieldString(WMTSDataParameters.FIELD_SRSSTR).setMandatory(false);
+		definition.addDynFieldBoolean(WMTSDataParameters.FIELD_OVERRIDE).setMandatory(false);*/
+		
+		definition.addDynFieldObject("parameters").setClassOfValue(RasterDataParameters.class).setMandatory(true);
+		definition.addDynFieldObject("bandList").setClassOfValue(BandList.class).setMandatory(false);
+		definition.addDynFieldObject("metadata").setClassOfValue(Metadata.class).setMandatory(false);
+		definition.addDynFieldObject("render").setClassOfValue(Render.class).setMandatory(true);
+		definition.addDynFieldObject("filterList").setClassOfValue(RasterFilterList.class).setMandatory(false);
+		definition.addDynFieldList("paramlist").setClassOfItems(PersistencyFilterParam.class).setMandatory(false);
+	}
+
+	public FLyrWMTS() {
+		super();
+		this.updateDrawVersion();
+		try {
+			enableAwake();
+		} catch (NotAvailableStateException e) {
+			logger.error("Fallo el estado de open. Closed=" + isClosed() + " Awake=" + isAwake(), this, e);
+		}
+	}
+	
+	public static DataStore createDataStore(String host, IProjection srs) throws InitializeException {
+		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
+		RasterDataParameters params = null;
+		try {
+			params = (RasterDataParameters)dataman.createServerExplorerParameters(WMTSServerExplorer.NAME);
+		} catch (InitializeException e) {
+			return null;
+		} catch (ProviderNotRegisteredException e) {
+			return null;
+		}
+		params.setURI(host);
+		params.setSRS(srs);
+		
+		try {
+			return dataman.openStore(params.getDataStoreName(), params);
+		} catch (ValidateDataParametersException e) {
+			throw new InitializeException(e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new InitializeException(e);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.mapcontext.layers.operations.SingleLayer#setDataStore(org.gvsig.fmap.dal.DataStore)
+	 */
+	public void setDataStore(DataStore dataStore) throws LoadLayerException {
+		this.dataStore = (RasterDataStore) dataStore;
+		try {
+			enableOpen();
+		} 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());
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.fmap.layers.DefaultFLyrRaster#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.gvsig.fmap.mapcontext.ViewPort, org.gvsig.tools.task.Cancellable, double)
+	 */
+	@SuppressWarnings("deprecation")
+	public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort,
+			Cancellable cancel, double scale) throws ReadException {
+		//CancelTaskImpl cancellable = new CancelTaskImpl(cancel);
+
+		//Solo el zoom normal recalcula el nivel dependiendo de la escala. El zoom por niveles asigna
+		//�l el nivel de zoom por lo que no habr� que recalcularlo.
+		if(recalcLevel) {
+			double pixelSize = viewPort.getExtent().getWidth() / (double)viewPort.getImageWidth();
+			zoomLevel = dataStore.getNearestLevel(pixelSize);
+		}
+		recalcLevel = true;
+		
+		if(!firstLoad) {
+			try {
+				initFilters();
+			} catch (FilePaletteException e) {
+				throw new ReadException(e.getMessage(), e);
+			}
+			firstLoad = true;
+		}
+		
+		enableStopped();
+
+		if (isWithinScale(scale)) {
+			if (!viewPort.getAdjustedExtent().intersects(getFullEnvelope()))
+				return;
+			Envelope adjustedExtent = viewPort.getAdjustedEnvelope();
+			Extent ext = rManager.getDataStructFactory().createExtent(
+					adjustedExtent.getLowerCorner().getX(),
+					adjustedExtent.getUpperCorner().getY(), 
+					adjustedExtent.getUpperCorner().getX(),
+					adjustedExtent.getLowerCorner().getY());
+			Dimension imgSz = viewPort.getImageSize();
+			ViewPortData vp2 = rManager.createViewPortData(viewPort.getProjection(), ext, imgSz );
+			vp2.setMat(viewPort.getAffineTransform());
+			
+			TaskStatusManager manager = ToolsLocator.getTaskStatusManager();
+			SimpleTaskStatus taskStatus = new RasterTaskStatus("Drawing " + getName() + "...", cancel);
+			manager.add(taskStatus);
+			taskStatus.setAutoremove(true);
+
+			try {
+				WMTSDataParameters par = getWMTSParameters(getParameters());
+				//getParameters().setExtent(ext.toRectangle2D());
+				par.setWidth((int)viewPort.getImageSize().getWidth());
+				par.setHeight((int)viewPort.getImageSize().getHeight());
+				
+				getRender().drawTiledService(g, vp2, viewPort.getImageSize(), taskStatus);
+			} catch (RasterDriverException e) {
+				throw new ReadException("Problems drawing this layer: " + e.getMessage(), e);
+			} catch (InvalidSetViewException e) {
+				throw new ReadException("Problems drawing this layer: " + e.getMessage(), e);
+			} catch (ProcessInterruptedException e) {
+				throw new ReadException("Problems drawing this layer: " + e.getMessage(), e);
+			} finally {
+				taskStatus.terminate();
+			}
+		}
+		disableStopped();
+	}
+	
+
+	/**
+	 * @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)
+	 */
+	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 {
+		draw(null, g, viewPort, cancel,scale);
+	}
+
+	/**
+	 * Inserta la extensi�n total de la capa.
+	 *
+	 * @param fullExtent
+	 *            Rectangulo.
+	 */
+	public void setFullExtent(Rectangle2D fullExtent) {
+		this.setFullEnvelope(this.getEnvelopeFromRectable2D(fullExtent));
+	}
+
+	/**
+	 * Inserta la extensi�n total de la capa en la proyeccion original.
+	 *
+	 * @param fullExtent
+	 *            Rect�ngulo.
+	 */
+	public void setFullEnvelope(Envelope envelope) {
+		Envelope cur = this.getFullEnvelope();
+		if (cur == envelope) {
+			return;
+		}
+		if (cur != null && cur.equals(envelope)) {
+			return;
+		}
+
+		this.fullEnvelope = envelope;
+		this.updateDrawVersion();
+	}
+
+	public HashMap<String, Object> getProperties() {
+		HashMap<String, Object> info = new HashMap<String, Object>();
+		WMTSDataParameters par = getWMTSParameters(getParameters());
+		String layerName = par.getLayer().getTitle();
+		try {
+			info.put("name", getName());
+			info.put("selectedLayer", layerName);
+			info.put("host", par.getURI());
+			info.put("srs", par.getSRSCode());
+			info.put("imageformat", par.getImageFormat());
+			info.put("infoformat", par.getInfoFormat());
+			//info.put("styles", getParameters().getStyles());
+			return info;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+
+	public String getTocImageIcon() {
+		return "icon-layer-wmts";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.layers.FLyrRasterSE#isActionEnabled(int)
+	 */
+	public boolean isActionEnabled(int action) {
+		switch (action) {
+		case IRasterLayerActions.ZOOM_PIXEL_RESOLUTION:
+		case IRasterLayerActions.FLYRASTER_BAR_TOOLS:
+		case IRasterLayerActions.BANDS_FILE_LIST:
+		case IRasterLayerActions.COLOR_TABLE:
+		case IRasterLayerActions.GEOLOCATION:
+		case IRasterLayerActions.PANSHARPENING:
+		case IRasterLayerActions.SAVE_COLORINTERP:
+		case IRasterLayerActions.SAVEAS:
+		case IRasterLayerActions.BANDS_RGB:
+		case IRasterLayerActions.CLIPPING:
+		case IRasterLayerActions.ENHANCED:
+		case IRasterLayerActions.STATS:
+		case IRasterLayerActions.NODATA:
+		case IRasterLayerActions.HISTOGRAM:
+			return false;
+		case IRasterLayerActions.REMOTE_ACTIONS:
+			return true;
+		}
+
+		return super.isActionEnabled(action);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.layers.FLyrRasterSE#getLegend()
+	 */
+	public ILegend getLegend() {
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.fmap.layers.FLyrRaster#isRemote()
+	 */
+	public boolean isRemote() {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.layers.FLyrRasterSE#overviewsSupport()
+	 */
+	public boolean overviewsSupport() {
+		return false;
+	}
+
+	protected void updateDrawVersion() {
+		if (this.disableUpdateDrawVersion != null){
+
+			Thread curThread = Thread.currentThread();
+
+			Thread aThread;
+
+			Iterator<WeakReference<Thread>> iter = this.disableUpdateDrawVersion.iterator();
+			while (iter.hasNext()){
+				aThread = (Thread) ((WeakReference<?>)iter.next()).get();
+				if (aThread == null){
+					iter.remove();
+				} else if(aThread.equals(curThread)){
+					return;
+				}
+			}
+		}
+		super.updateDrawVersion();
+	}
+
+	protected void disableUpdateDrawVersion() {
+		if (this.disableUpdateDrawVersion == null) {
+			this.disableUpdateDrawVersion = new ArrayList<WeakReference<Thread>>();
+		}
+		this.disableUpdateDrawVersion.add(new WeakReference<Thread>(Thread.currentThread()));
+	}
+
+	protected void enableUpdateDrawVersion() {
+		if (this.disableUpdateDrawVersion == null) {
+			return;
+		}
+		Thread curThread = Thread.currentThread();
+		Thread aThread;
+
+		Iterator<WeakReference<Thread>> iter = this.disableUpdateDrawVersion.iterator();
+		while (iter.hasNext()) {
+			aThread = (Thread) ((WeakReference<?>)iter.next()).get();
+			if (aThread == null) {
+				iter.remove();
+			} else if(aThread.equals(curThread)) {
+				iter.remove();
+				break;
+			}
+		}
+
+	}
+
+	@SuppressWarnings("unused")
+	private Rectangle2D.Double getRectable2DFromEnvelope(Envelope env) {
+		return new Rectangle2D.Double(env.getMinimum(0), env.getMinimum(1), env
+				.getLength(0), env.getLength(1));
+	}
+
+	private Envelope getEnvelopeFromRectable2D(Rectangle2D rect) {
+		try {
+			return geomManager.createEnvelope(rect.getMinX(), rect.getMinY(),
+					rect.getMaxX(), rect.getMaxY(),
+					SUBTYPES.GEOM2D);
+		} catch (CreateEnvelopeException e) {
+			logger.error("Error creating the envelope", e);
+		}
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.fmap.layers.FLyrRaster#getFileFormat()
+	 */
+	@Override
+	public String getFileFormat() {
+		return "WMTS";
+	}
+	
+
+	/**
+	 * Devuelve el envelope en la proyeccion de la vista
+	 */
+	public Envelope getFullEnvelope() {
+		Envelope rAux;
+		rAux = this.fullEnvelope;
+
+		// Esto es para cuando se crea una capa nueva con el fullExtent de ancho
+		// y alto 0.
+		if (rAux == null || rAux.getMaximum(0) - rAux.getMinimum(0) == 0
+				&& rAux.getMaximum(1) - rAux.getMinimum(1) == 0) {
+			try {
+				rAux = geomManager.createEnvelope(0, 0, 100, 100, SUBTYPES.GEOM2D);
+			} catch (CreateEnvelopeException e) {
+				logger.error("Error creating the envelope", e);
+			}
+		}
+		// Si existe reproyecci�n, reproyectar el extent
+		ICoordTrans ct = getCoordTrans();
+		if (ct != null) {
+			Point2D pt1 = new Point2D.Double(rAux.getMinimum(0), rAux
+					.getMinimum(1));
+			Point2D pt2 = new Point2D.Double(rAux.getMaximum(0), rAux
+					.getMaximum(1));
+			pt1 = ct.convert(pt1, null);
+			pt2 = ct.convert(pt2, null);
+			try {
+				rAux = geomManager.createEnvelope(pt1.getX(), pt1.getY(), pt2
+						.getX(), pt2.getY(), SUBTYPES.GEOM2D);
+			} catch (CreateEnvelopeException e) {
+				logger.error("Error creating the envelope", e);
+			}// new
+			// Rectangle2D.Double();
+		}
+		return rAux;
+
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.fmap.layers.FLyrRaster#getFullRasterExtent()
+	 */
+	public Extent getFullRasterExtent() {
+		Envelope env = getFullEnvelope();
+		double minx = env.getMinimum(0);
+		double miny = env.getMinimum(1);
+		double maxx = env.getMaximum(0);
+		double maxy = env.getMaximum(1);
+		Point2D ul = new Point2D.Double(minx, maxy);
+		Point2D ur = new Point2D.Double(maxx, maxy);
+		Point2D ll = new Point2D.Double(minx, miny);
+		Point2D lr = new Point2D.Double(maxx, miny);
+		return rManager.getDataStructFactory().createExtent(ul, lr, ur, ll);
+	}
+
+    public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel)
+		throws LoadLayerException, DataException {
+		
+		return null;
+	}
+    
+    public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel, boolean fast)
+    throws LoadLayerException, DataException {
+
+    	Point2D pReal = getMapContext().getViewPort().toMapPoint(p);
+    	String fInfo = null;
+    	try {
+    		fInfo = getDataStore().getInfoByPoint(pReal.getX(), pReal.getY(), new CancelTaskImpl(cancel));
+    	} catch (InfoByPointException e) {
+    		throw new LoadLayerException("Error in getInfoByPoint", e);
+    	}
+    	int type = DynObjectSetWMTSInfo.TYPE_TEXT;
+    	WMTSDataParameters wmtsParams = getWMTSParameters(params);
+
+    	if(wmtsParams.getInfoFormat() != null) {
+    		if(wmtsParams.getInfoFormat().compareTo("text/html") == 0)
+    			type = DynObjectSetWMTSInfo.TYPE_HTML;
+    		if(wmtsParams.getInfoFormat().compareTo("application/vnd.ogc.gml") == 0)
+    			type = DynObjectSetWMTSInfo.TYPE_XML;
+    	}
+    	return new DynObjectSetWMTSInfo(fInfo, type);
+    }
+    
+    /**
+     * Sets the data store parameters
+     * @param params
+     * @throws InitializeException
+     */
+    public void setParameters(DataStoreParameters params) throws InitializeException {
+    	this.params = params;
+
+		if(params instanceof TileDataParameters) {
+			((TileDataParameters)params).deleteCache(deleteCache);
+		}
+		
+    	DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
+		try {
+			DataStore dStore = dataman.openStore(params.getDataStoreName(), params);
+			this.setDataStore(dStore);
+			
+			if(params instanceof WMTSDataParameters) {
+				this.setName(((WMTSDataParameters) params).getURI());
+			}
+			
+			if(params instanceof TileDataParameters) {
+				DataParameters p = ((TileDataParameters) params).getDataParameters();
+				if(p instanceof WMTSDataParameters) {
+					this.setName(((WMTSDataParameters) p).getURI());
+				}
+			}
+			
+		} catch (ValidateDataParametersException e) {
+			throw new InitializeException(e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new InitializeException(e);
+		} catch (InitializeException e) {
+			throw new InitializeException(e);
+		} catch (LoadLayerException e) {
+			throw new InitializeException(e);
+		}
+    }
+    
+    @SuppressWarnings("deprecation")
+	public DataStoreParameters getParameters() {
+    	if(params == null) {
+    		DataManager datamanager = DALLocator.getDataManager();
+			WMTSServerExplorerParameters explorerParams = null;
+			try {
+				explorerParams = (WMTSServerExplorerParameters) datamanager.createServerExplorerParameters(WMTSServerExplorer.NAME);
+				explorerParams.setHost("");
+				explorer = (WMTSServerExplorer) datamanager.createServerExplorer(explorerParams);
+				params = explorer.getStoreParameters();
+			} catch (InitializeException e) {
+			} catch (ProviderNotRegisteredException e) {
+			} catch (ValidateDataParametersException e) {
+			}
+    	}
+    	return getWMTSParameters(params);
+    }
+    
+    /**
+     * Gets <code>WMTSDataParameters</code>
+     * @param parameters
+     * @return
+     */
+    private WMTSDataParameters getWMTSParameters(DataStoreParameters parameters) {
+    	WMTSDataParameters params = null;
+    	if(parameters instanceof WMTSDataParameters) {
+			params = (WMTSDataParameters) parameters;
+		}
+		
+		if(parameters instanceof TileDataParameters) {
+			DataParameters p = ((TileDataParameters) parameters).getDataParameters();
+			if(p instanceof WMTSDataParameters) {
+				params = (WMTSDataParameters) p;
+			}
+		}
+		return params;
+    }
+    
+    /**
+     * Sets the explorer
+     * @param explorer
+     */
+    public void setExplorer(WMTSServerExplorer explorer) {
+    	this.explorer = explorer;
+    }
+    
+    /**
+     * Gets the explorer
+     * @return
+     */
+    public WMTSServerExplorer getExplorer() {
+    	return this.explorer;
+    }
+
+	public Image getImageLegend() {
+		return null;
+	}
+
+	public String getPathImage() {
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.mapcontext.layers.FLyrDefault#cloneLayer()
+	 */
+	public FLayer cloneLayer() throws Exception {
+		RasterDataStore  ds = dataStore.cloneDataStore();
+		FLyrWMTS newLayer = new FLyrWMTS();
+		newLayer.setName(getName());
+		newLayer.setOpenRasterStore(ds);
+		newLayer.fullEnvelope = fullEnvelope;
+		newLayer.params = params;
+		newLayer.firstLoad = firstLoad;
+		newLayer.explorer = explorer;
+		
+		List<RasterFilter> filters = getRender().getFilterList().getStatusCloned();
+
+		//Hacemos una copia de las bandas a renderizar
+		if(getRender().getRenderBands() != null) {
+			int[] rb = new int[getRender().getRenderBands().length];
+			for (int i = 0; i < rb.length; i++)
+				rb[i] = getRender().getRenderBands()[i];
+			newLayer.getRender().setRenderBands(rb);
+		}
+
+		//Asignamos el entorno
+		if(newLayer.getRender().getFilterList() == null)
+			newLayer.getRender().setFilterList(RasterLocator.getManager().createEmptyFilterList(getRender().getFilterList().getInitDataType()));
+		newLayer.getRender().getFilterList().setEnv(getRender().getFilterList().getEnv());
+		newLayer.getRender().getFilterList().setStatus(filters);
+
+		// Asignamos los valores noData del original
+		newLayer.setNoDataValue(getNoDataValue());
+		if(dataStore.getNoDataValue().isDefined())
+			newLayer.setNoDataTransparent(true);
+		newLayer.enableOpen();
+		
+		return newLayer;
+	}
+
+	/**
+	 * Assigns the flag to delete this layer from the cache
+	 * @param selected
+	 */
+	public void deleteCache(boolean deleteCache) {
+		this.deleteCache = deleteCache;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectIteratorWMTSInfo.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectIteratorWMTSInfo.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectIteratorWMTSInfo.java	(revision 1459)
@@ -0,0 +1,92 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.wmts.app.wmtsclient.layer;
+
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.DynObjectSet;
+
+/**
+ * {@link DynObject} implementation to facade a iterator of a WMTSInfo
+ * and allow to be used as a {@link DynObjectSet} iterator.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @version $Id$
+ * 
+ */
+public class DynObjectIteratorWMTSInfo implements DisposableIterator {
+
+    private ArrayList<Object> infoList = new ArrayList<Object>();
+    private int               index    = -1;
+
+    /**
+     * Creates a new DynObjects iterator facade over a feature iterator.
+     * Each WMTSInfo will be returned through a new or reused
+     * {@link DynObjectWMTSInfo} which allows the {@link Feature} to be
+     * used like a DynObject.
+     * 
+     * @param featureIterator
+     *            to facade
+     * @param featureFacade
+     *            if not null this object will be reused as the facade for the
+     *            Feature objects of the feature iterator
+     */
+    public DynObjectIteratorWMTSInfo(Object info) {
+        this.infoList.add(info);
+        index = 0;
+    }
+    
+    public void addObject(Object info) {
+    	this.infoList.add(info);
+    	if(index == -1)
+    		index = 0;
+    }
+
+    public synchronized void dispose() {
+    	this.infoList.clear();
+    	index = -1;
+    }
+
+    public synchronized boolean hasNext() {
+        return (infoList.size() == 0 || index >= infoList.size()) ? false : true;
+    }
+
+    public synchronized Object next() {
+        Object o = infoList.get(index);
+        index ++;
+        return o;
+    }
+
+    public synchronized void remove() {
+    	if(index < infoList.size() && index >= 0) {
+    		index --;
+    		infoList.remove(index);
+    	}
+    }
+    
+    public long getSize() {
+        return infoList.size();
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectIteratorWMTSInfo.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/toc/WMTSPropsTocMenuEntry.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/toc/WMTSPropsTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/toc/WMTSPropsTocMenuEntry.java	(revision 1459)
@@ -0,0 +1,61 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.toc;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.dialog.WMTSPropsDialog;
+import org.gvsig.raster.wmts.app.wmtsclient.layer.FLyrWMTS;
+
+
+/**
+ * The TOC WMTS properties.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSPropsTocMenuEntry extends AbstractTocContextMenuAction {
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		WMTSPropsDialog dialog = new WMTSPropsDialog(selectedItems[0]);
+		PluginServices.getMDIManager().addWindow(dialog);
+	}
+
+	public String getText() {
+		return PluginServices.getText(this, "wmts_properties");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		return selectedItems.length == 1 && selectedItems[0].isAvailable();
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if (selectedItems.length != 1) {
+			return false;
+		}
+		return selectedItems[0] instanceof FLyrWMTS;
+
+	}
+
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/toc/WMTSPropsTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/dialog/WMTSPropsDialog.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/dialog/WMTSPropsDialog.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/dialog/WMTSPropsDialog.java	(revision 1459)
@@ -0,0 +1,285 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.dialog;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.HashMap;
+
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.app.gui.wizards.WizardListener;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.util.CancelTaskImpl;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.WMTSGUIInterface;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.WMTSParamsPanel;
+import org.gvsig.raster.wmts.app.wmtsclient.layer.FLyrWMTS;
+import org.gvsig.raster.wmts.io.WMTSServerExplorer;
+import org.gvsig.remoteclient.wmts.exception.WMTSException;
+
+
+/**
+ * The TOC WMTS properties panel container.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSPropsDialog extends JPanel implements IWindow, ButtonsPanelListener {
+	private static final long         serialVersionUID      = 1L;
+	private FLyrWMTS                  fLayer                = null;
+	private WindowInfo                m_ViewInfo            = null;
+	private ButtonsPanel              buttonsPanel          = null;   
+	private WMTSGUIInterface          wmtsGUIInterface      = null;
+    private WMTSServerExplorer        explorer              = null;
+
+    public WMTSPropsDialog() {
+    	initialize(null);
+    }
+    
+    public WMTSPropsDialog(FLayer layer) {
+		super();
+		if(layer instanceof FLyrWMTS) {
+			fLayer = (FLyrWMTS)layer;
+			initialize(fLayer);
+		}
+	}
+
+	private void initialize(FLyrWMTS layer) {
+		HashMap<String, Object> hash = layer != null ? layer.getProperties() : null;
+		wmtsGUIInterface = getParamsPanel(hash);
+		wmtsGUIInterface.addWizardListener(new WizardListener(){
+			@SuppressWarnings("deprecation")
+			public void wizardStateChanged(boolean finishable) {
+				getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(finishable);
+				getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(finishable);
+			}
+
+			public void error(Exception e) {
+			}
+
+        });
+		setLayout(new BorderLayout());
+        this.add(wmtsGUIInterface.getComponent(), BorderLayout.CENTER);
+        this.add(getButtonsPanel(), BorderLayout.SOUTH);
+	}
+	
+	/**
+	 * Gets the buttons panel
+	 * @return
+	 */
+	public ButtonsPanel getButtonsPanel() {
+		if(buttonsPanel == null) {
+			buttonsPanel = new ButtonsPanel();
+			buttonsPanel.addApply();
+			buttonsPanel.addAccept();
+			buttonsPanel.addClose();
+			buttonsPanel.addButtonPressedListener(this);
+		}
+		return buttonsPanel;
+	}
+
+	/**
+	 * With getParamsPanel we have access to the map config TabbedPane.
+	 * If this panel doesn't exist yet (which can occur when an existing project is
+	 * recovered) it is been automatically constructed by connecting to the server,
+	 * reloading the necessary data, filling up the content and setting the selected
+	 * values that were selected when the projet was saved.
+	 *
+	 *
+	 * Since a connection to the server is needed when rebuiliding the panel, this
+	 * causes a delay for the panel's showing up or a nullPointer error if there is
+	 * no path to the server.
+	 *
+	 *
+	 * Con getParamsPanel tenemos acceso a juego de pesta�as de configuraci�n
+	 * del mapa. Si este panel todav�a no existe (como puede ser cuando
+	 * recuperamos un proyecto guardado) �ste se crea autom�ticamente conectando
+	 * al servidor, recuperando los datos necesarios, rellenando el contenido y
+	 * dejando seleccionados los valores que estaban seleccionados cuando se
+	 * guarda el proyecto.
+	 *
+	 *
+	 * Como para reconstruirse requiere una conexi�n con el servidor esto causa
+	 * un retardo en la aparici�n en el toc o un error de nullPointer si no
+	 * hay conexi�n hasta el servidor.
+	 *
+	 *
+	 * @return WMSParamsPanel
+	 */
+	public WMTSGUIInterface getParamsPanel(HashMap<String, Object> info) {
+		if (info == null) {
+			WMTSGUIInterface toc = new WMTSParamsPanel();
+			return toc;
+		}
+
+		try {
+			if(explorer == null) {
+				explorer = ((FLyrWMTS)fLayer).getExplorer();
+
+				try {
+					explorer.connect(new CancelTaskImpl());
+				} catch (WMTSException e) {
+					RasterToolsUtil.messageBoxError("The connection cannot be established", this, e);
+					return null;
+				} 
+			}
+		} catch (Exception e) {
+			explorer = null;
+			JOptionPane.showMessageDialog(null, "error_comunicacion_servidor", "Error", JOptionPane.ERROR_MESSAGE);
+		}
+		
+		try {
+			WMTSGUIInterface toc = new WMTSParamsPanel();
+			((WMTSParamsPanel)toc).setWizardData(explorer);
+			toc.updateSelectedInfo(info);
+			return toc;
+		} catch (Exception e) {
+			JOptionPane.showMessageDialog(null, "error_comunicacion_servidor", "Error", JOptionPane.ERROR_MESSAGE);
+		}
+
+		return null;
+	}
+
+    @SuppressWarnings("unused")
+	private class CommandListener implements ActionListener {
+
+        /**
+         * Creates a new ComandosListener object.
+         *
+         * @param lg DOCUMENT ME!
+         */
+        public CommandListener(WMTSPropsDialog tp) {
+        }
+
+		/* (non-Javadoc)
+		 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+		 */
+        public void actionPerformed(ActionEvent e) {
+        	if (e.getActionCommand() == "CANCEL") {
+        		close();
+        	} else {
+   				MapControl mapCtrl = null;
+
+				IWindow[] w = PluginServices.getMDIManager().getAllWindows();
+				for (int i = 0; i < w.length; i++) {
+					if (w[i] instanceof org.gvsig.app.project.documents.view.gui.AbstractViewPanel) {
+						MapContext mapContext = ((org.gvsig.app.project.documents.view.gui.AbstractViewPanel)w[i]).getMapControl().getMapContext();
+						if(mapContext == fLayer.getMapContext())
+							mapCtrl = ((org.gvsig.app.project.documents.view.gui.AbstractViewPanel)w[i]).getMapControl();
+					}
+				}
+				
+        		try {
+        			FLayer[] layerList = wmtsGUIInterface.getLayers();
+        			removeDuplicate(layerList, mapCtrl);
+        			for (int i = 0; i < layerList.length; i++) {
+        				mapCtrl.getMapContext().getLayers().addLayer(layerList[i]);
+        			}
+        			mapCtrl.getMapContext().invalidate();
+        		} catch (LoadLayerException exc) {
+        			exc.printStackTrace();
+        		}
+        	}
+		}
+    }
+    
+    private void removeDuplicate(FLayer[] layerList, MapControl mapCtrl) {
+    	FLayers lyrs = mapCtrl.getMapContext().getLayers();
+    	for (int i = 0; i < lyrs.getLayersCount(); i++) {
+			FLayer lyr = lyrs.getLayer(i);
+			for (int j = 0; j < layerList.length; j++) {
+				if(lyr.getName().compareTo(layerList[j].getName()) == 0) {
+					lyrs.removeLayer(lyr);
+				}
+			}
+		}
+    }
+    
+    
+	public WindowInfo getWindowInfo() {
+		if (m_ViewInfo == null) {
+			m_ViewInfo = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
+			m_ViewInfo.setTitle(PluginServices.getText(this,"fit_WMTS_layer"));
+	        m_ViewInfo.setWidth(500);
+	        m_ViewInfo.setHeight(500);
+		}
+		return m_ViewInfo;
+	}
+
+	public void close() {
+		PluginServices.getMDIManager().closeWindow(this);
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.DIALOG_PROFILE;
+	}
+
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		if(	e.getButton() == ButtonsPanel.BUTTON_APPLY || 
+			e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			MapControl mapCtrl = null;
+
+			IWindow[] w = PluginServices.getMDIManager().getAllWindows();
+			for (int i = 0; i < w.length; i++) {
+				if (w[i] instanceof org.gvsig.app.project.documents.view.gui.AbstractViewPanel) {
+					MapContext mapContext = ((org.gvsig.app.project.documents.view.gui.AbstractViewPanel)w[i]).getMapControl().getMapContext();
+					if(mapContext == fLayer.getMapContext())
+						mapCtrl = ((org.gvsig.app.project.documents.view.gui.AbstractViewPanel)w[i]).getMapControl();
+				}
+			}
+			
+    		try {
+    			FLayer[] layerList = wmtsGUIInterface.getLayers();
+    			if(layerList.length > 0 && layerList[0] != null) {
+    				if(layerList[0] instanceof FLyrWMTS) {
+    					mapCtrl.getMapContext().getLayers().removeLayer(fLayer);
+    					mapCtrl.getMapContext().getLayers().addLayer(layerList[0]);
+    					fLayer = (FLyrWMTS)layerList[0];
+    				}
+    			}
+    			//removeDuplicate(layerList, mapCtrl);
+    			mapCtrl.getMapContext().invalidate();
+    		} catch (LoadLayerException exc) {
+    			exc.printStackTrace();
+    		}
+		}
+		
+		if(	e.getButton() == ButtonsPanel.BUTTON_CLOSE ||
+			e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			close();
+		}
+	}
+
+}  //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/dialog/WMTSPropsDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/StylesPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/StylesPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/StylesPanel.java	(revision 1459)
@@ -0,0 +1,77 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JScrollPane;
+
+import org.gvsig.gui.beans.DefaultBean;
+
+/**
+ * This is the Styles tab of the WMTS wizard.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class StylesPanel extends DefaultBean{
+	private static final long   serialVersionUID   = 1L;
+	private JScrollPane         jScrollPane        = null;
+    private StyleTree           treeStyles         = null;
+
+    public StylesPanel() {
+        super();
+        setLayout(new BorderLayout());
+        add(getJScrollPane(), BorderLayout.CENTER);
+    }
+    
+    /**
+     * This method initializes jScrollPane3
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private JScrollPane getJScrollPane() {
+        if (jScrollPane == null) {
+            jScrollPane = new JScrollPane();
+            jScrollPane.setViewportView(getStyleTree());
+        }
+        return jScrollPane;
+    }
+
+    /**
+     * This method initializes treeStyles
+     *
+     * @return javax.swing.JTree
+     */
+    public StyleTree getStyleTree() {
+        if (treeStyles == null) {
+            treeStyles = new StyleTree();
+            treeStyles.addMouseListener(new java.awt.event.MouseAdapter() {
+            	public void mouseClicked(java.awt.event.MouseEvent e) {
+            		//StyleTreeModel model = (StyleTreeModel) treeStyles.getModel();
+            		//callValueChanged(model.getStylesSelection(/*parent.selectedLayersToArray()*/));
+            		callValueChanged(null);
+            	}
+            });
+        }
+        return treeStyles;
+    }
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/StylesPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/ConnectPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/ConnectPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/ConnectPanel.java	(revision 1459)
@@ -0,0 +1,164 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.utils.swing.jcomboServer.JComboServer;
+
+/**
+ * Connect panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ConnectPanel extends JPanel {
+	private static final long   serialVersionUID   = 1L;
+	private JButton             btnConnect         = null;
+	private JButton             btnCancel          = null;
+	private JComboServer        cmbHost            = null;
+	private JCheckBox           chkCaching         = null;
+	private JPanel              pSouth             = null;
+	private JPanel              pMain              = null;
+	
+	public ConnectPanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		setBorder(javax.swing.BorderFactory.createTitledBorder(
+				null, PluginServices.getText(this, "server"),
+				javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+				javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.anchor = GridBagConstraints.WEST;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 2, 2, 0);
+		add(getTxtHost(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridy = 1;
+		add(getJPanelSouth(), gridBagConstraints1);
+	}
+	
+	public JPanel getJPanelSouth() {
+		if(pSouth == null) {
+			pSouth = new JPanel();
+			pSouth.setLayout(new GridBagLayout());
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints1.anchor = GridBagConstraints.WEST;
+			gridBagConstraints1.gridx = 0;
+			gridBagConstraints1.gridy = 0;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 0);
+			pSouth.add(getChkCaching(), gridBagConstraints1);
+			
+			gridBagConstraints1.anchor = GridBagConstraints.EAST;
+			gridBagConstraints1.gridx = 1;
+			gridBagConstraints1.gridy = 0;
+			gridBagConstraints1.weightx = 0;
+			pSouth.add(getBtnConnect(), gridBagConstraints1);
+			
+			gridBagConstraints1.anchor = GridBagConstraints.EAST;
+			gridBagConstraints1.gridx = 2;
+			gridBagConstraints1.gridy = 0;
+			pSouth.add(getBtnCancel(), gridBagConstraints1);
+			
+			
+		}
+		return pSouth;
+	}
+	
+	public JPanel getJPanelMain() {
+		if(pMain == null)
+			pMain = new JPanel();
+		return pMain;
+	}
+	
+	/**
+	 * This method initializes btnConnect
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBtnConnect() {
+		if (btnConnect == null) {
+			btnConnect = new JButton();
+			btnConnect.setPreferredSize(new java.awt.Dimension(110, 20));
+			btnConnect.setText(PluginServices.getText(this, "conectar"));
+		}
+		return btnConnect;
+	}
+	
+	/**
+	 * This method initializes btnCancel
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBtnCancel() {
+		if (btnCancel == null) {
+			btnCancel = new JButton();
+			btnCancel.setEnabled(false);
+			btnCancel.setPreferredSize(new java.awt.Dimension(110, 20));
+			btnCancel.setText(PluginServices.getText(this, "cancel"));
+		}
+		return btnCancel;
+	}
+	
+	/**
+	 * This method initializes txtHost
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public JComboServer getTxtHost() {
+		if (cmbHost == null) {
+			cmbHost = new JComboServer();
+			cmbHost.setModel(new DefaultComboBoxModel());
+			cmbHost.setPreferredSize(new java.awt.Dimension(350, 20));
+			cmbHost.setEditable(true);
+		}
+
+		return cmbHost;
+	}
+	
+	/**
+	 * This method initializes chkCaching
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	public JCheckBox getChkCaching() {
+		if (chkCaching == null) {
+			chkCaching = new JCheckBox();
+			chkCaching.setText(PluginServices.getText(this, "refresh_capabilities"));
+			chkCaching.setToolTipText(PluginServices.getText(this, "refresh_capabilities_tooltip"));
+		}
+		return chkCaching;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/ConnectPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/NextPrevPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/NextPrevPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/NextPrevPanel.java	(revision 1459)
@@ -0,0 +1,131 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+
+/**
+ * Panel with the next and previous buttons
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class NextPrevPanel extends JPanel {
+	private static final long             serialVersionUID   = 1L;
+	private JButton                       btnSiguiente       = null;
+	private JButton                       btnAnterior        = null;
+	protected JLabel                      lblServerType      = null;
+	protected JLabel                      lblServerTypeValue = null;
+	
+	public NextPrevPanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.anchor = GridBagConstraints.WEST;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.insets = new java.awt.Insets(2,2,2,2);
+		add(getJLabelServerType(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 1;
+		add(getJLabelServerTypeValue(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 2;
+		gridBagConstraints1.anchor = GridBagConstraints.EAST;
+		gridBagConstraints1.weightx = 0;
+		add(getBtnPrev(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 3;
+		gridBagConstraints1.anchor = GridBagConstraints.EAST;
+		add(getBtnNext(), gridBagConstraints1);
+	}
+	
+	/**
+	 * This method initializes btnSiguiente
+	 *
+	 * @return javax.swing.JButton
+	 */
+	public javax.swing.JButton getBtnNext() {
+		if (btnSiguiente == null) {
+			btnSiguiente = new JButton();
+			btnSiguiente.setPreferredSize(new java.awt.Dimension(110, 20));
+			btnSiguiente.setText(PluginServices.getText(this, "siguiente"));
+		}
+		return btnSiguiente;
+	}
+
+	/**
+	 * This method initializes btnAnterior
+	 *
+	 * @return javax.swing.JButton
+	 */
+	public javax.swing.JButton getBtnPrev() {
+		if (btnAnterior == null) {
+			btnAnterior = new JButton();
+			btnAnterior.setPreferredSize(new java.awt.Dimension(110, 20));
+			btnAnterior.setText(PluginServices.getText(this, "anterior"));
+		}
+		return btnAnterior;
+	}
+	
+	/**
+	 * This method initializes jLabelName
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabelServerType() {
+		if (lblServerType == null) {
+			lblServerType = new JLabel();
+			lblServerType.setFont(new java.awt.Font("Arial", java.awt.Font.PLAIN, 11));
+			lblServerType.setText(PluginServices.getText(this, "server_type")+":");
+		}
+
+		return lblServerType;
+	}
+	
+	/**
+	 * This method initializes jLabelName
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	public javax.swing.JLabel getJLabelServerTypeValue() {
+		if (lblServerTypeValue == null) {
+			lblServerTypeValue = new JLabel();
+			lblServerTypeValue.setFont(new java.awt.Font("Arial", java.awt.Font.BOLD, 11));
+			lblServerTypeValue.setText("-");
+		}
+
+		return lblServerTypeValue;
+	}
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/NextPrevPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/IServerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/IServerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/IServerPanel.java	(revision 1459)
@@ -0,0 +1,188 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main;
+
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.utils.swing.jcomboServer.JComboServer;
+
+/**
+ * Connect panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class IServerPanel extends JPanel implements ActionListener {
+	private static final long   serialVersionUID   = 1L;
+	private ConnectPanel        connectPanel       = null;
+	private DescriptionPanel    descPanel          = null;
+	private JPanel              checkPanel         = null;
+	private JCheckBox           chkInvertAxisOrder = null;
+	
+	public IServerPanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.weighty = 0.0;
+		gridBagConstraints1.insets = new java.awt.Insets(10,2,10,2);
+		add(getConnectPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.insets = new java.awt.Insets(2,2,2,2);
+		gridBagConstraints1.gridy = 1;
+		add(getCheckPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.fill = GridBagConstraints.BOTH;
+		gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 2;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.weighty = 1.0;
+		add(getDescriptionPanel(), gridBagConstraints1);
+	}
+	
+	private ConnectPanel getConnectPanel() {
+		if(connectPanel == null) {
+			connectPanel = new ConnectPanel();
+		}
+		return connectPanel;
+	}
+	
+	private JPanel getCheckPanel() {
+		if(checkPanel == null) {
+			checkPanel = new JPanel();
+			FlowLayout f = new FlowLayout();
+			f.setAlignment(FlowLayout.LEFT);
+			f.setVgap(0);
+			f.setHgap(0);
+			checkPanel.setLayout(f);
+			checkPanel.add(getChkInvertAxisOrder());
+		}
+		return checkPanel;
+	}
+	
+	private DescriptionPanel getDescriptionPanel() {
+		if(descPanel == null) {
+			descPanel = new DescriptionPanel();
+		}
+		return descPanel;
+	}
+	
+	/**
+	 * This method initializes chkInvertAxisOrder
+	 * @return CheckBox
+	 */
+	public JCheckBox getChkInvertAxisOrder() {
+		if (chkInvertAxisOrder == null) {
+			chkInvertAxisOrder = new JCheckBox();
+			chkInvertAxisOrder.setText(PluginServices.getText(this, "invert_axis_order"));
+			chkInvertAxisOrder.setSelected(false);
+			chkInvertAxisOrder.addActionListener(this);
+		}
+		return chkInvertAxisOrder;
+	}
+	
+	/**
+	 * Gets the connect button
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBtnConnect() {
+		return getConnectPanel().getBtnConnect();
+	}
+	
+	/**
+	 * Gets the cancel button
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBtnCancel() {
+		return getConnectPanel().getBtnCancel();
+	}
+	
+	/**
+	 * Gets the host combo box
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public JComboServer getTxtHost() {
+		return getConnectPanel().getTxtHost();
+	}
+	
+	/**
+	 * Gets the caching check box
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	public JCheckBox getChkCaching() {
+		return getConnectPanel().getChkCaching();
+	}
+	
+	/**
+	 * Gets the title label
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	public javax.swing.JLabel getJLabelTitle() {
+		return getDescriptionPanel().getJLabelTitle();
+	}
+	
+	/**
+	 * Gets the text box
+	 * @return javax.swing.JTextArea
+	 */
+	public javax.swing.JTextArea getTxtAbstract() {
+		return getDescriptionPanel().getTxtAbstract();
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == getChkInvertAxisOrder()) {
+			String string = PluginServices.getText(this, "accept");
+			Object[] options = {string};
+			JOptionPane.showOptionDialog((Component)/*PluginServices.getMainFrame()*/this,
+						"<html>" + PluginServices.getText(this, "cache_refresh").replaceAll("\n", "<br>") + "</html>",
+						PluginServices.getText(this, "confirmacion"),
+						JOptionPane.OK_OPTION,
+						JOptionPane.INFORMATION_MESSAGE,
+						null,
+						options,
+						string);
+		}
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/IServerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/DescriptionPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/DescriptionPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/DescriptionPanel.java	(revision 1459)
@@ -0,0 +1,190 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main;
+
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+
+import org.gvsig.andami.PluginServices;
+
+/**
+ * Connect panel
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DescriptionPanel extends JPanel {
+	private static final long             serialVersionUID   = 1L;
+	private JTextArea                     txtAbstract        = null;
+	private JScrollPane                   jScrollPane        = null;
+	private JPanel                        jPanelTxt          = null;
+	//private NextPrevPanel                 nextPrevPanel      = null;
+	private JPanel                        jPanelName         = null;
+	private JLabel                        jLabelName         = null;
+	private JLabel                        lblTitle           = null;
+	
+	public DescriptionPanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = GridBagConstraints.BOTH;
+		gridBagConstraints1.anchor = GridBagConstraints.WEST;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.weighty = 1.0;
+		gridBagConstraints1.insets = new java.awt.Insets(2,2,2,2);
+		add(getJPanelTxt(), gridBagConstraints1);
+		
+		/*gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+		gridBagConstraints1.gridy = 1;
+		gridBagConstraints1.weighty = 0.0;
+		gridBagConstraints1.insets = new java.awt.Insets(10,2,10,2);
+		add(getNextPrevPanel(), gridBagConstraints1);*/
+	}
+	
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	/*public NextPrevPanel getNextPrevPanel() {
+		if (nextPrevPanel == null) {
+			nextPrevPanel = new NextPrevPanel();
+		}
+		return nextPrevPanel;
+	}*/
+	
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanelTxt() {
+		if (jPanelTxt == null) {
+			jPanelTxt = new javax.swing.JPanel();
+			jPanelTxt.setLayout(new GridBagLayout());
+			jPanelTxt.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "description"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints1.anchor = GridBagConstraints.WEST;
+			gridBagConstraints1.gridx = 0;
+			gridBagConstraints1.gridy = 0;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.weighty = 0.0;
+			gridBagConstraints1.insets = new java.awt.Insets(2,2,2,2);
+			jPanelTxt.add(getJPanelName(), gridBagConstraints1);
+			
+			gridBagConstraints1.fill = GridBagConstraints.BOTH;
+			gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+			gridBagConstraints1.gridx = 0;
+			gridBagConstraints1.gridy = 1;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.weighty = 1.0;
+			jPanelTxt.add(getJScrollPane(), gridBagConstraints1);
+		}
+
+		return jPanelTxt;
+	}
+	
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanelName() {
+		if (jPanelName == null) {
+			jPanelName = new javax.swing.JPanel();
+			jPanelName.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 1));
+			jPanelName.add(getJLabelName());
+			jPanelName.add(getJLabelTitle());
+		}
+		return jPanelName;
+	}
+	
+	/**
+	 * This method initializes txtAbstract
+	 * @return javax.swing.JTextArea
+	 */
+	public javax.swing.JTextArea getTxtAbstract() {
+		if (txtAbstract == null) {
+			txtAbstract = new javax.swing.JTextArea();
+			txtAbstract.setWrapStyleWord(true);
+			txtAbstract.setColumns(30);
+			txtAbstract.setLineWrap(true);
+		}
+		return txtAbstract;
+	}
+	
+	/**
+	 * This method initializes jScrollPane
+	 * @return javax.swing.JScrollPane
+	 */
+	private javax.swing.JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new javax.swing.JScrollPane();
+			jScrollPane.setViewportView(getTxtAbstract());
+		}
+
+		return jScrollPane;
+	}
+	
+	/**
+	 * This method initializes jLabelName
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabelName() {
+		if (jLabelName == null) {
+			jLabelName = new javax.swing.JLabel();
+			jLabelName.setText(PluginServices.getText(this, "name") + ":");
+		}
+
+		return jLabelName;
+	}
+
+	/**
+	 * This method initializes lblTitle
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	public javax.swing.JLabel getJLabelTitle() {
+		if (lblTitle == null) {
+			lblTitle = new javax.swing.JLabel();
+			lblTitle.setText("-");
+		}
+
+		return lblTitle;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/main/DescriptionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/format/IFormatsPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/format/IFormatsPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/format/IFormatsPanel.java	(revision 1459)
@@ -0,0 +1,243 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.format;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JCheckBox;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.wizard.WMTSParametersListModel;
+
+/**
+ * Formats panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class IFormatsPanel extends JPanel {
+	private static final long      serialVersionUID   = 1L;
+	private JScrollPane            jScrollImageFormats        = null;
+	private JList                  lstImageFormats            = null;
+	private JScrollPane            jScrollInfoFormats         = null;
+	private JList                  lstInfoFormats             = null;
+	private JScrollPane            jScrollLstSrs              = null;
+	private JList                  lstSRSs                    = null;
+	private JPanel                 jPanelImageFormats         = null;
+	private JPanel                 jPanelInfoFormats          = null;
+	private JPanel                 jPanelLstSrs               = null;
+	private JCheckBox              chkTransparency            = null;
+	
+	public IFormatsPanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = GridBagConstraints.BOTH;
+		gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.weighty = 1.0;
+		gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
+		add(getJPanelImageFormats(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridy = 1;
+		add(getJPanelLstSrs(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridy = 2;
+		add(getJPanelInfoFormats(), gridBagConstraints1);
+	}
+	
+	/**
+	 * This method initializes jPanelImageFormats
+	 * @return Panel
+	 */
+	private JPanel getJPanelInfoFormats() {
+		if (jPanelInfoFormats == null) {
+			jPanelInfoFormats = new JPanel();
+			jPanelInfoFormats.setLayout(new GridBagLayout());
+			jPanelInfoFormats.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "select_info_formats"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null,
+					null));
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = GridBagConstraints.BOTH;
+			gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.weighty = 1.0;
+			gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
+			jPanelInfoFormats.add(getJScrollInfoFormats(), gridBagConstraints1);
+		}
+		return jPanelInfoFormats;
+	}
+	
+	/**
+	 * This method initializes jPanel5
+	 *
+	 * @return Panel
+	 */
+	private JPanel getJPanelLstSrs() {
+		if (jPanelLstSrs == null) {
+			jPanelLstSrs = new JPanel();
+			jPanelLstSrs.setLayout(new GridBagLayout());
+			jPanelLstSrs.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "seleccionar_srs"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null,
+					null));
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = GridBagConstraints.BOTH;
+			gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.weighty = 1.0;
+			gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
+			jPanelLstSrs.add(getJScrollLstSrs(), gridBagConstraints1);
+		}
+		return jPanelLstSrs;
+	}
+
+	/**
+	 * This method initializes jPanelImageFormats
+	 * @return Panel
+	 */
+	private JPanel getJPanelImageFormats() {
+		if (jPanelImageFormats == null) {
+			jPanelImageFormats = new JPanel();
+			jPanelImageFormats.setLayout(new GridBagLayout());
+			jPanelImageFormats.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "select_formats"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null,
+					null));
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = GridBagConstraints.BOTH;
+			gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.weighty = 1.0;
+			gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
+			jPanelImageFormats.add(getJScrollImageFormats(), gridBagConstraints1);
+			/*gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints1.gridy = 1;
+			gridBagConstraints1.weighty = 0.0;
+			jPanelImageFormats.add(getChkTransparency(), gridBagConstraints1);*/
+		}
+		return jPanelImageFormats;
+	}
+	
+	/**
+	 * This method initializes jScrollPane6
+	 * @return ScrollPane
+	 */
+	private JScrollPane getJScrollInfoFormats() {
+		if (jScrollInfoFormats == null) {
+			jScrollInfoFormats = new JScrollPane();
+			jScrollInfoFormats.setViewportView(getLstInfoFormats());
+		}
+
+		return jScrollInfoFormats;
+	}
+
+	/**
+	 * This method initializes jScrollImageFormats
+	 * @return ScrollPane
+	 */
+	private JScrollPane getJScrollImageFormats() {
+		if (jScrollImageFormats == null) {
+			jScrollImageFormats = new JScrollPane();
+			jScrollImageFormats.setViewportView(getLstImageFormats());
+		}
+
+		return jScrollImageFormats;
+	}
+	
+	/**
+	 * This method initializes lstFormats
+	 * @return List
+	 */
+	public JList getLstImageFormats() {
+		if (lstImageFormats == null) {
+			lstImageFormats = new JList();
+			lstImageFormats.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+		}
+		return lstImageFormats;
+	}
+	
+	/**
+	 * This method initializes lstFormats
+	 * @return List
+	 */
+	public JList getLstInfoFormats() {
+		if (lstInfoFormats == null) {
+			lstInfoFormats = new JList();
+			lstInfoFormats.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+		}
+		return lstInfoFormats;
+	}
+	
+	/**
+	 * This method initializes lstSRSs
+	 *
+	 * @return JList
+	 */
+	public JList getLstSRSs() {
+		if (lstSRSs == null) {
+			lstSRSs = new JList();
+			lstSRSs.setModel(new WMTSParametersListModel());
+			lstSRSs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+		}
+		return lstSRSs;
+	}
+	
+	/**
+	 * This method initializes jScrollLstSrs
+	 * @return ScrollPane
+	 */
+	private JScrollPane getJScrollLstSrs() {
+		if (jScrollLstSrs == null) {
+			jScrollLstSrs = new JScrollPane();
+			jScrollLstSrs.setViewportView(getLstSRSs());
+		}
+
+		return jScrollLstSrs;
+	}
+	
+	/**
+	 * This method initializes chkTrasparency
+	 * @return CheckBox
+	 */
+	public JCheckBox getChkTransparency() {
+		if (chkTransparency == null) {
+			chkTransparency = new JCheckBox();
+			chkTransparency.setText(PluginServices.getText(this,
+					"wms_transparency"));
+			chkTransparency.setSelected(true);
+		}
+		return chkTransparency;
+	}
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/format/IFormatsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/InfoPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/InfoPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/InfoPanel.java	(revision 1459)
@@ -0,0 +1,222 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel;
+
+import java.awt.BorderLayout;
+import java.util.Vector;
+
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.WMTSParamsPanel.LayerUI;
+import org.gvsig.raster.wmts.io.WMTSServerExplorer;
+import org.gvsig.remoteclient.wmts.struct.WMTSServiceIdentification;
+import org.gvsig.remoteclient.wmts.struct.WMTSTheme;
+
+
+/**
+ * Service Information Panel
+ */
+class InfoPanel extends JPanel {
+	private static final long serialVersionUID = 1L;
+	private final String bgColor0 = "\"#FEEDD6\""; // light salmon
+    private final String bgColor1 = "\"#EAEAEA\""; // light grey
+    //private final String bgColor2 = "\"#F2FEFF\""; // light blue
+    private final String bgColor3 = "\"#FBFFE1\""; // light yellow
+
+    private final String service_title       = PluginServices.getText(this, "service_info");
+    private final String server              = PluginServices.getText(this, "server");
+    private final String server_type         = PluginServices.getText(this, "server_type");
+    private final String server_abstract     = PluginServices.getText(this, "server_abstract");
+    private final String server_title        = PluginServices.getText(this, "server_title");
+    private final String layers_title        = PluginServices.getText(this, "selected_layers");
+    private final String layer_title         = PluginServices.getText(this, "layer_title");
+    private final String layer_abstract      = PluginServices.getText(this, "layer_abstract");
+    private final String selected_dimensions = PluginServices.getText(this, "selected_dimensions");
+    private final String style               = PluginServices.getText(this, "style");
+    private final String format_title        = PluginServices.getText(this, "format");
+    private final String srs_title           = "SRS";
+    private final String properties			 = PluginServices.getText(this, "properties");
+    private final String layer_name			 = PluginServices.getText(this, "name");
+	private JEditorPane editor = null;
+
+
+    /**
+     * Creates a new instance of InfoPanel with double buffer and null layout
+     *
+     */
+	public InfoPanel() {
+		super();
+        setLayout(new BorderLayout());
+        JScrollPane src = new JScrollPane();
+        add(src, BorderLayout.CENTER);
+        src.setViewportView(getEditor());
+	}
+
+    /**
+     * This method initializes tblInfo
+     *
+     * @return javax.swing.JTable
+     */
+    private JEditorPane getEditor() {
+        if (editor == null) {
+            editor = new JEditorPane();
+            editor.setEditable(false);
+        }
+        return editor;
+    }
+
+
+    /**
+     * Fills the text pane with a data table describing the service and the
+     * selected settings.
+     *
+     * @param dataSource
+     */
+    @SuppressWarnings("unchecked")
+	public void refresh(WMTSServerExplorer explorer, Vector layers, Vector styles, String format, String srs) {
+
+    	WMTSServiceIdentification id = explorer.getServiceIdentification();
+    	
+        String server_text = explorer.getHost();
+        String server_type_text = id.getServiceType();
+        String server_title_text = id.getTitle();
+        String server_abstract_text = id.getAbstract();
+        String font = "Arial";
+
+        if (server_text == null)
+            server_text = "-";
+        if (server_type_text == null)
+            server_type_text = "-";
+        if (server_title_text == null)
+            server_title_text = "-";
+        if (server_abstract_text == null)
+            server_abstract_text = "-";
+
+        if (format == null)
+            format = PluginServices.getText(this, "none_selected");
+        if (srs == null)
+            srs = PluginServices.getText(this, "none_selected");
+
+        String layers_html = "";
+        for (int i = 0; i < layers.size(); i++) {
+        	WMTSTheme layer = ((LayerUI) layers.get(i)).theme;
+            String layer_name_text = layer.getTitle();
+            String style_title = (((LayerUI) layers.get(i)).styleSelected == null) ? PluginServices.getText(this, "not_available") : ((LayerUI) layers.get(i)).styleSelected.getTitle();
+            String layer_abstract_text = layer.getAbstract();
+            String layer_title_text = layer.getTitle();
+
+            if (layer_name_text == null)
+            	layer_name_text = "-";
+            if (style_title == null)
+            	style_title = "-";
+            if (layer_abstract_text == null)
+            	layer_abstract_text = "-";
+            if (layer_title_text == null)
+            	layer_title_text = "-";
+            String layer_html =
+            	"  <tr valign=\"top\">" +
+                "     <td bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"Arial\" size=\"3\" align=\"right\"><b>"+layer_name+"</b></font></td>" +
+                "     <td bgcolor="+bgColor0+"><font face=\"Arial\" size=\"3\">"+layer_name_text+"</font></td>" +
+                "  </tr>" +
+                "  <tr valign=\"top\">" +
+                "     <td width=\"119\" height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"Arial\" size=\"3\"><b>"+layer_title+"</b></font></td>" +
+                "     <td width=\"322\" height=\"18\" bgcolor="+bgColor1+"><font face=\"Arial\" size=\"3\">"+layer_title_text+"</font></td>" +
+                "  </tr>" +
+                "  <tr valign=\"top\">" +
+                "     <td bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"Arial\" size=\"3\" align=\"right\"><b>"+layer_abstract+"</b></font></td>" +
+                "     <td bgcolor="+bgColor0+"><font face=\"Arial\" size=\"3\">"+layer_abstract_text+"</font></td>" +
+                "  </tr>" +
+                "  <tr valign=\"top\">" +
+                "     <td bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"Arial\" size=\"3\" align=\"right\"><b>"+style+"</b></font></td>" +
+                "     <td bgcolor="+bgColor1+"><font face=\"Arial\" size=\"3\">"+style_title+"</font></td>" +
+                "  </tr>" +
+                "  <tr>" +
+                "  </tr>";
+            layers_html += layer_html;
+        }
+        if (!layers_html.equals(""))
+            layers_html =
+                "  <tr valign=\"top\" bgcolor=\"#FFFFFF\">" +
+                "    <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+layers_title+"</font></b></td>" +
+                "  </tr>" + layers_html;
+        String dimension_html = "";
+        if (!dimension_html.equals(""))
+        	dimension_html =
+        		"  <tr valign=\"top\">" +
+        		"    <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+selected_dimensions+"</font></b></td>" +
+        		"  </tr>" + dimension_html;
+
+        String format_html =
+        	"  <tr valign=\"top\" bgcolor=\"#FFFFFF\">" +
+            "    <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+properties+"</font></b></td>" +
+            "  </tr>" +
+            "  <tr valign=\"top\" bgcolor="+bgColor0+">" +
+            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+format_title+"</b></font></td>" +
+            "    <td><font face=\""+font+"\" size=\"3\"><font face=\""+font+"\" size=\"3\">"+format+"</font></td>" +
+            "  </tr>" +
+            "  <tr valign=\"top\" bgcolor="+bgColor1+">" +
+            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+srs_title+"</font></b></td>" +
+            "    <td><font face=\""+font+"\" size=\"3\">"+srs+"</font></td>" +
+            "  </tr>";
+
+        String html =
+
+            "<html>" +
+            "<body>" +
+            "<table align=\"center\" width=\"437\" height=\"156\" border=\"0\" cellpadding=\"4\" cellspacing=\"4\">" +
+            "  <tr valign=\"top\" bgcolor=\"#FFFFFF\">" +
+            "    <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+service_title+"</font></b></td>" +
+            "  </tr>" +
+            "  <tr valign=\"top\" bgcolor="+bgColor0+">" +
+            "    <td width=\"92\" height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server+"</font></b></td>" +
+            "    <td width=\"268\"><font face=\""+font+"\" size=\"3\">"+server_text+"</font></td>" +
+            "  </tr>" +
+            "  <tr valign=\"top\" bgcolor="+bgColor1+">" +
+            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_type+"</b></font></td>" +
+            "    <td><font face=\""+font+"\" size=\"3\">"+server_type_text+"</font></td>" +
+            "  </tr>" +
+            "  <tr valign=\"top\" bgcolor="+bgColor0+">" +
+            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_title+"</b></font></td>" +
+            "    <td><font face=\""+font+"\" size=\"3\"><font face=\""+font+"\" size=\"3\">"+server_title_text+"</font></td>" +
+            "  </tr>" +
+            "  <tr valign=\"top\" bgcolor="+bgColor1+">" +
+            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_abstract+"</font></b></td>" +
+            "    <td><font face=\""+font+"\" size=\"3\">"+server_abstract_text+"</font></td>" +
+            "  </tr>" +
+
+            "  <tr>" +
+            "  </tr>" +
+            layers_html +
+            dimension_html +
+            format_html +
+            "</table>" +
+            "</body>" +
+            "</html>";
+
+        getEditor().setContentType("text/html");
+        getEditor().setText(html);
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/InfoPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/ILayerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/ILayerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/ILayerPanel.java	(revision 1459)
@@ -0,0 +1,246 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextField;
+
+import org.gvsig.andami.PluginServices;
+
+/**
+ * Layer panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ILayerPanel extends JPanel {
+	private static final long      serialVersionUID   = 1L;
+	private JTextField             jTxtNomCapa                = null;
+	private LayerTree              treeLayers                 = null;
+	private JPanel                 jPanelNameLayer            = null;
+	private JPanel                 jPanelSelectLayers         = null;
+	private JCheckBox              chkExtendedNames           = null;
+	private JScrollPane            jScrollTreeLayers          = null;
+	private LayersSelectedPanel    layersSelectedPanel        = null;
+	private AddDelLayerPanel       addDelLayerPanel           = null;
+	
+	public ILayerPanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 2, 2, 0);
+		add(getJPanelNameLayer(), gridBagConstraints1);
+		
+		gridBagConstraints1.fill = GridBagConstraints.BOTH;
+		gridBagConstraints1.gridy = 1;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.weighty = 1.0;
+		add(getJPanelSelectLayers(), gridBagConstraints1);
+	}
+	
+	/**
+	 * This method initializes jPanel4
+	 * @return Panel
+	 */
+	private JPanel getJPanelNameLayer() {
+		if (jPanelNameLayer == null) {
+			jPanelNameLayer = new JPanel();
+			jPanelNameLayer.setLayout(new GridBagLayout());
+			jPanelNameLayer.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "layer_name"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null,
+					null));
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
+			jPanelNameLayer.add(getJTxtNomCapa(), gridBagConstraints1);
+		}
+
+		return jPanelNameLayer;
+	}
+	
+	/**
+	 * This method initializes LayersSelectedPanel
+	 * @return Panel
+	 */
+	private LayersSelectedPanel getLayersSelectedPanel() {
+		if (layersSelectedPanel == null) {
+			layersSelectedPanel = new LayersSelectedPanel();
+		}
+		return layersSelectedPanel;
+	}
+	
+	/**
+	 * This method initializes LayersSelectedPanel
+	 * @return Panel
+	 */
+	private AddDelLayerPanel getAddDelLayerPanel() {
+		if (addDelLayerPanel == null) {
+			addDelLayerPanel = new AddDelLayerPanel();
+		}
+		return addDelLayerPanel;
+	}
+	
+	/**
+	 * This method initializes lstSelectedLayers
+	 *
+	 * @return List
+	 */
+	public LayerList getLstSelectedLayers() {
+		return getLayersSelectedPanel().getLstSelectedLayers();
+	}
+	
+	/**
+	 * This method initializes jTextField
+	 * @return TextField
+	 */
+	public JTextField getJTxtNomCapa() {
+		if (jTxtNomCapa == null) {
+			jTxtNomCapa = new JTextField();
+			jTxtNomCapa.setText(PluginServices.getText(this, "WMTSLayer"));
+		}
+		return jTxtNomCapa;
+	}
+	
+	/**
+	 * This method initializes jPanel2
+	 * @return Panel
+	 */
+	private JPanel getJPanelSelectLayers() {
+		if (jPanelSelectLayers == null) {
+			jPanelSelectLayers = new JPanel();
+			jPanelSelectLayers.setLayout(new GridBagLayout());
+			jPanelSelectLayers.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "select_layers"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null,
+					null));
+			
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = GridBagConstraints.BOTH;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.weighty = 1.0;
+			gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
+			jPanelSelectLayers.add(getJScrollTreeLayers(), gridBagConstraints1);
+			
+			gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints1.weighty = 0.0;
+			gridBagConstraints1.gridy = 1;
+			jPanelSelectLayers.add(getLayersSelectedPanel(), gridBagConstraints1);
+			
+			gridBagConstraints1.gridy = 2;
+			jPanelSelectLayers.add(getAddDelLayerPanel(), gridBagConstraints1);
+			
+		}
+		return jPanelSelectLayers;
+	}
+	
+	/**
+	 * This method initializes btnUp
+	 *
+	 * @return Button
+	 */
+	public JButton getBtnUp() {
+		return layersSelectedPanel.getBtnUp();
+	}
+
+	/**
+	 * This method initializes btnDown
+	 * @return Button
+	 */
+	public JButton getBtnDown() {
+		return layersSelectedPanel.getBtnDown();
+	}
+	
+	/**
+	 * This method initializes btnDel
+	 * @return Button
+	 */
+	public JButton getBtnDel() {
+		return getAddDelLayerPanel().getBtnRemove();
+	}
+
+	/**
+	 * This method initializes btnAdd
+	 * @return Button
+	 */
+	public JButton getBtnAdd() {
+		return getAddDelLayerPanel().getBtnAdd();
+	}
+	
+	/**
+	 * This method initializes chkExtendedNames
+	 *
+	 * @return CheckBox
+	 */
+	public JCheckBox getChkExtendedNames() {
+		if (chkExtendedNames == null) {
+			chkExtendedNames = new JCheckBox();
+			chkExtendedNames.setText(PluginServices.getText(this, "show_layer_names"));
+		}
+		return chkExtendedNames;
+	}
+	
+	/**
+	 * This method initializes treeLayers
+	 *
+	 * @return Tree
+	 */
+	public LayerTree getTreeLayers() {
+		if (treeLayers == null) {
+			treeLayers = new LayerTree();
+			treeLayers.setRootVisible(true);
+		}
+
+		return treeLayers;
+	}
+	
+	/**
+	 * This method initializes jScrollTreeLayers
+	 *
+	 * @return ScrollPane
+	 */
+	private JScrollPane getJScrollTreeLayers() {
+		if (jScrollTreeLayers == null) {
+			jScrollTreeLayers = new JScrollPane();
+			jScrollTreeLayers.setViewportView(getTreeLayers());
+			jScrollTreeLayers.setPreferredSize(new java.awt.Dimension(205, 75));
+		}
+
+		return jScrollTreeLayers;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/ILayerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayerList.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayerList.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayerList.java	(revision 1459)
@@ -0,0 +1,72 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+
+import org.gvsig.gui.beans.controls.dnd.JDnDList;
+
+
+/**
+ * Class implementing a JList component adapted to the WMTSLayerNode
+ * needs (use it as a JList with drag'n'drop capabilities).
+ * 
+ * @author jaume dominguez faus - jaume.dominguez@iver.es
+ *
+ */
+public class LayerList extends JDnDList {
+	private static final long serialVersionUID = 1L;
+	public boolean showLayerNames = false;
+	//private int count = 0; 
+	public LayerList() {
+		super();
+		setCellRenderer(new MyRenderer());
+	}
+	
+	@SuppressWarnings("serial")
+	private class MyRenderer extends DefaultListCellRenderer {
+		public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+			super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+			/*if (value instanceof WMTSLayerNode){
+				WMTSLayerNode layer = (WMTSLayerNode) value;
+                
+                if (!showLayerNames) {
+                	if (layer.getName() != null || layer.getName() == "") {
+                		String text = layer.toString();
+                		text = text.substring(text.indexOf(']')+2, text.length());
+                		setText(text);
+                	}
+                }
+                
+                Dimension sz  = getPreferredSize();
+                sz.setSize((sz.getWidth()+50) - (50*count), sz.getHeight());
+                setPreferredSize(sz);
+                count++;
+            } */
+			return this;
+		}
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayerList.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayersSelectedPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayersSelectedPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayersSelectedPanel.java	(revision 1459)
@@ -0,0 +1,151 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.controls.dnd.JDnDListModel;
+
+/**
+ * Layer list panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LayersSelectedPanel extends JPanel {
+	private static final long      serialVersionUID           = 1L;
+	private JButton                btnUp                      = null;
+	private JButton                btnDown                    = null;
+	private LayerList              lstSelectedLayers          = null;
+	private JPanel                 jPanelControlLayers        = null;
+	private JScrollPane            jScrollPanel               = null;
+	
+	public LayersSelectedPanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		//gridBagConstraints1.fill = GridBagConstraints.BOTH;
+		gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1.0;
+		//gridBagConstraints1.weighty = 1.0;
+		gridBagConstraints1.insets = new java.awt.Insets(2, 0, 2, 0);
+		add(getJScrollPane(), gridBagConstraints1);
+		
+		//Esto solo si es una lista
+		
+		/*gridBagConstraints1.fill = GridBagConstraints.VERTICAL;
+		gridBagConstraints1.gridx = 1;
+		gridBagConstraints1.weightx = 0.0;
+		add(getJPanelControlLayers(), gridBagConstraints1);*/
+	}
+	
+	/**
+	 * This method initializes jScrollPane5
+	 *
+	 * @return ScrollPane
+	 */
+	private JScrollPane getJScrollPane() {
+		if (jScrollPanel == null) {
+			jScrollPanel = new JScrollPane();
+			jScrollPanel.setViewportView(getLstSelectedLayers());
+			jScrollPanel.setPreferredSize(new java.awt.Dimension(205, 32));
+		}
+		return jScrollPanel;
+	}
+	
+	/**
+	 * This method initializes lstSelectedLayers
+	 * @return List
+	 */
+	public LayerList getLstSelectedLayers() {
+		if (lstSelectedLayers == null) {
+			lstSelectedLayers = new LayerList();
+			lstSelectedLayers.setModel(new JDnDListModel());
+			lstSelectedLayers.setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+		}
+		return lstSelectedLayers;
+	}
+	
+	/**
+	 * This method initializes jPanel2
+	 * @return Panel
+	 */
+	@SuppressWarnings("unused")
+	private JPanel getJPanelControlLayers() {
+		if (jPanelControlLayers == null) {
+			jPanelControlLayers = new JPanel();
+			jPanelControlLayers.setLayout(new GridBagLayout());
+			
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = GridBagConstraints.VERTICAL;
+			gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+			gridBagConstraints1.weighty = 0.0;
+			gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
+			
+			jPanelControlLayers.add(getBtnUp(), gridBagConstraints1);
+			
+			gridBagConstraints1.gridy = 1;
+			jPanelControlLayers.add(getBtnDown(), gridBagConstraints1);
+		}
+		return jPanelControlLayers;
+	}
+	
+	/**
+	 * This method initializes btnUp
+	 * @return Button
+	 */
+	public JButton getBtnUp() {
+		if (btnUp == null) {
+			btnUp = new JButton();
+			btnUp.setPreferredSize(new Dimension(30, 30));
+			btnUp.setToolTipText(PluginServices.getText(this, "move_layer_up"));
+			btnUp.setIcon(IconThemeHelper.getImageIcon("aplication-preferences-uparrow"));
+		}
+		return btnUp;
+	}
+
+	/**
+	 * This method initializes btnDown
+	 * @return Button
+	 */
+	public JButton getBtnDown() {
+		if (btnDown == null) {
+			btnDown = new JButton();
+			btnDown.setPreferredSize(new Dimension(30, 30));
+			btnDown.setToolTipText(PluginServices.getText(this, "move_layer_down"));
+			btnDown.setIcon(IconThemeHelper.getImageIcon("aplication-preferences-downarrow"));
+		}
+		return btnDown;
+	}
+
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayersSelectedPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/AddDelLayerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/AddDelLayerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/AddDelLayerPanel.java	(revision 1459)
@@ -0,0 +1,113 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+
+/**
+ * Layer list panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class AddDelLayerPanel extends JPanel {
+	private static final long      serialVersionUID           = 1L;
+	
+	private JButton                btnAdd                     = null;
+	private JButton                btnRemove                  = null;
+	private JPanel                 jPanelAddRemoveLayer       = null;
+	
+	public AddDelLayerPanel() {
+		init();
+	}
+	
+	private void init() {
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 2);
+		add(getJPanelAddRemoveLayer(), gridBagConstraints1);
+	}
+	
+	/**
+	 * This method initializes jPanel4
+	 * @return Panel
+	 */
+	private JPanel getJPanelAddRemoveLayer() {
+		if (jPanelAddRemoveLayer == null) {
+			jPanelAddRemoveLayer = new JPanel();
+			jPanelAddRemoveLayer.setLayout(new GridBagLayout());
+
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints1.anchor = GridBagConstraints.WEST;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
+			
+			jPanelAddRemoveLayer.add(/*getChkInvertAxisOrder()*/new JPanel(), gridBagConstraints1);
+			
+			gridBagConstraints1.anchor = GridBagConstraints.EAST;
+			gridBagConstraints1.weightx = 0.0;
+			gridBagConstraints1.gridx = 1;
+			jPanelAddRemoveLayer.add(getBtnAdd(), gridBagConstraints1);
+			
+			gridBagConstraints1.gridx = 2;
+			jPanelAddRemoveLayer.add(getBtnRemove(), gridBagConstraints1);
+		}
+
+		return jPanelAddRemoveLayer;
+	}
+	
+	/**
+	 * This method initializes btnConnect
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBtnAdd() {
+		if (btnAdd == null) {
+			btnAdd = new JButton();
+			btnAdd.setPreferredSize(new java.awt.Dimension(100, 20));
+			btnAdd.setText(PluginServices.getText(this, "add"));
+		}
+		return btnAdd;
+	}
+	
+	/**
+	 * This method initializes btnCancel
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBtnRemove() {
+		if (btnRemove == null) {
+			btnRemove = new JButton();
+			btnRemove.setEnabled(false);
+			btnRemove.setPreferredSize(new java.awt.Dimension(100, 20));
+			btnRemove.setText(PluginServices.getText(this, "remove"));
+		}
+		return btnRemove;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/AddDelLayerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayerTree.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayerTree.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayerTree.java	(revision 1459)
@@ -0,0 +1,139 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer;
+
+import java.awt.Component;
+
+import javax.swing.JToolTip;
+import javax.swing.JTree;
+import javax.swing.ToolTipManager;
+import javax.swing.tree.DefaultTreeCellRenderer;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.controls.MultiLineToolTip;
+import org.gvsig.remoteclient.wmts.struct.WMTSLayer;
+
+
+/**
+ * LayerTree extends the standard JTree class to allow use custom tooltips.
+ * It is just JTree containing RemoteLayerNode at its nodes.
+ * 
+ * @author jaume
+ *
+ */
+@SuppressWarnings("serial")
+public class LayerTree extends JTree {
+	public boolean showLayerNames = false;
+
+	public LayerTree(){
+        super();
+        ToolTipManager.sharedInstance().registerComponent(this);
+        ToolTipManager.sharedInstance().setDismissDelay(60*1000);
+        setCellRenderer(new MyRenderer());
+    }
+
+    /**
+     * Layer tree specific renderer allowing to show multiple line
+     * tooltips 
+     * @author jaume
+     *
+     */
+    private class MyRenderer extends DefaultTreeCellRenderer {
+       
+        
+       public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
+            super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
+            if (value instanceof WMTSLayer) {
+            	WMTSLayer layer = (WMTSLayer) value;
+                
+                String myAbstract = layer.getAbstract();
+                
+                if (myAbstract == null)
+                    myAbstract = "-";
+                else 
+                    myAbstract = format(myAbstract.trim(), 100);
+                
+                String text =
+                    PluginServices.getText(this, "abstract") + ":\n" + myAbstract + "\n\n";
+                
+                setToolTipText(text);
+                
+                if (!showLayerNames) {
+                	if (layer.getTitle() != null || layer.getTitle() == "") {
+                		text = layer.toString();
+                		text = text.substring(text.indexOf(']') + 2, text.length());
+                		setText(text);
+                	}
+                }
+                
+            } else {
+                setToolTipText(null);
+            }
+            return this;
+        }
+    }
+    
+    
+    /**
+     * Cuts the message text to force its lines to be shorter or equal to 
+     * lineLength.
+     * @param message, the message.
+     * @param lineLength, the max line length in number of characters.
+     * @return the formated message.
+     */
+    public static String format(String message, int lineLength){
+        if (message.length() <= lineLength) return message;
+        String[] lines = message.split("\n");
+        String theMessage = "";
+        
+        for (int i = 0; i < lines.length; i++) {
+            String line = lines[i].trim();
+            if (line.length() < lineLength)
+                theMessage += line + "\n";
+            else {
+                String[] chunks = line.split(" ");
+                String newLine  = "";
+                for (int j = 0; j < chunks.length; j++) {
+                    int currentLength = newLine.length();
+                    chunks[j] = chunks[j].trim();
+                    if (chunks[j].length() == 0)
+                        continue;
+                    if ((currentLength + chunks[j].length() + " ".length()) <= lineLength)
+                        newLine += chunks[j] + " ";
+                    else {
+                        newLine += "\n"+chunks[j]+" ";
+                        theMessage += newLine;
+                        newLine = "";
+                    }
+                }
+            }
+        }
+        return theMessage;
+    }
+    
+    public JToolTip createToolTip() {
+    	MultiLineToolTip tip = new MultiLineToolTip();
+    	tip.setComponent(this);
+    	return tip;
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/layer/LayerTree.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/WMTSParamsPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/WMTSParamsPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/WMTSParamsPanel.java	(revision 1459)
@@ -0,0 +1,1069 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Vector;
+import java.util.prefs.Preferences;
+
+import javax.swing.JComponent;
+import javax.swing.JList;
+import javax.swing.JTabbedPane;
+import javax.swing.ListModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.TreePath;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.gui.WizardPanel;
+import org.gvsig.app.gui.wizards.WizardListenerSupport;
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.gui.beans.controls.dnd.JDnDListModel;
+import org.gvsig.gui.beans.listeners.BeanListener;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.format.IFormatsPanel;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer.ILayerPanel;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer.LayerList;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.layer.LayerTree;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.wizard.LayerTreeModel;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.wizard.WMTSParametersListModel;
+import org.gvsig.raster.wmts.app.wmtsclient.layer.FLyrWMTS;
+import org.gvsig.raster.wmts.io.WMTSDataParameters;
+import org.gvsig.raster.wmts.io.WMTSServerExplorer;
+import org.gvsig.remoteclient.wmts.struct.WMTSStyle;
+import org.gvsig.remoteclient.wmts.struct.WMTSTheme;
+
+
+/**
+ * This class implements the map option panel.
+ *
+ * It includes a set of Listeners that implement some control rules which
+ * refresh the component values that depends on those selected in the other
+ * components to avoid to choose an invalid set of options. It also includes a
+ * method (isCorrectlyConfigured()) that checks if the current set of values is
+ * enough to correctly launch a GetMap request.
+ *
+ * The information is obtained from a WMTSWizardDataSource object.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+@SuppressWarnings("unchecked")
+public class WMTSParamsPanel extends WizardPanel 
+	implements WMTSGUIInterface, ActionListener, ItemListener, KeyListener, ListSelectionListener, MouseListener, TreeSelectionListener {
+	private static final long      serialVersionUID           = 1L;
+	
+	private InfoPanel              tabInfo                    = null;
+	private ILayerPanel            layerPanel                 = null;
+	private StylesPanel            tabStyle                   = null;
+	private IFormatsPanel          formatsPanel               = null;
+	
+	private ArrayList<TreePath>    selectedPaths              = new ArrayList<TreePath>();
+	private WizardListenerSupport  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;
+
+	/**
+	 * Layer to add to the selected layers box 
+	 * @author Nacho Brodin (nachobrodin@gmail.com)
+	 */
+	class LayerUI {
+		public WMTSTheme       theme                = null;
+		public int             imageFormatSelected  = 0;
+		public int             infoFormatSelected   = 0;
+		public int             srsFormatSelected    = 0;
+		public WMTSStyle       styleSelected        = null;
+		
+		public LayerUI(WMTSTheme theme) {
+			this.theme = theme;
+		}
+		
+		public String toString() {
+			return theme.toString();
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.wmts.app.wmtsclient.gui.panel.WMTSGUIInterface#getComponent()
+	 */
+	public JComponent getComponent() {
+		return this;
+	}
+	
+	public WMTSParamsPanel() {
+		super();
+		initialize();
+	}
+
+	// TODO: crear nuevo constructor para a�adir los panels que quieras...
+	public WMTSParamsPanel(WMTSServerExplorer data) {
+		super();
+		setWizardData(data);
+		this.setLayout(null);
+		this.setVisible(false);
+		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);
+		}
+		this.add(jTabbedPane, null);
+
+		setListenerSupport(new WizardListenerSupport());
+	}
+
+	/**
+	 * This method initializes panelPage2
+	 *
+	 * @return Panel
+	 */
+	private void initialize() {
+		this.setLayout(new BorderLayout());
+		this.setVisible(false);
+		this.add(getJTabbedPane(), BorderLayout.CENTER);
+	}
+	
+	/**
+	 * This method initializes the main panel with tabs
+	 *
+	 * @return JTabbedPane
+	 */
+	public JTabbedPane getJTabbedPane() {
+		if (jTabbedPane == null) {
+			jTabbedPane = new JTabbedPane();
+			jTabbedPane.setBounds(4, 4, 502, 415);
+			InfoPanel ip = getTabInfo();
+			ip.addFocusListener(new FocusListener() {
+				public void focusGained(FocusEvent e) {
+					refreshInfo();
+				}
+
+				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);
+		}
+		return jTabbedPane;
+	}
+	
+	/**
+	 * This method initializes the information panel
+	 * @return Panel
+	 */
+	private InfoPanel getTabInfo() {
+		if (tabInfo == null) {
+			tabInfo = new InfoPanel();
+		}
+		return tabInfo;
+	}
+	
+	/**
+	 * This method initializes the panel with the layer list 
+	 * @return
+	 */
+	private ILayerPanel getLayerPanel() {
+		if (layerPanel == null) {
+			layerPanel = new ILayerPanel();
+			layerPanel.getLstSelectedLayers().addMouseListener(this);
+			layerPanel.getLstSelectedLayers().addListSelectionListener(this);
+			layerPanel.getJTxtNomCapa().addKeyListener(this);
+			layerPanel.getChkExtendedNames().addItemListener(this);
+			layerPanel.getBtnAdd().addActionListener(this);
+			layerPanel.getBtnDel().addActionListener(this);
+			layerPanel.getBtnDown().addActionListener(this);
+			layerPanel.getBtnUp().addActionListener(this);
+			layerPanel.getChkExtendedNames().addActionListener(this);
+			layerPanel.getTreeLayers().addMouseListener(this);
+			layerPanel.getTreeLayers().addTreeSelectionListener(this);
+		}
+		return layerPanel;
+	}
+	
+	/**
+	 * This method initializes the panel with the list of styles
+	 * @return Panel
+	 */
+	private StylesPanel getTabStyle() {
+		if (tabStyle == null) {
+			tabStyle = new StylesPanel();
+			tabStyle.setEnabled(false);
+			tabStyle.addListener(new BeanListener() {
+				public void beanValueChanged(Object value) {
+					fireWizardComplete(isCorrectlyConfigured());
+				};
+			});
+			tabStyle.addFocusListener(new FocusAdapter() {
+				public void focusGained(FocusEvent e) {
+					refreshStyleTree();
+				}
+			});
+		}
+		return tabStyle;
+	}
+	
+	/**
+	 * This method initializes the panel with the formats and SRSs
+	 * @return Panel
+	 */
+	private IFormatsPanel getJPanelFormatsAndSrs() {
+		if (formatsPanel == null) {
+			formatsPanel = new IFormatsPanel();
+			formatsPanel.getLstImageFormats().addListSelectionListener(this);
+			formatsPanel.getLstInfoFormats().addListSelectionListener(this);
+			formatsPanel.getLstSRSs().addListSelectionListener(this);
+			formatsPanel.getChkTransparency().addItemListener(this);
+		}
+		return formatsPanel;
+	}
+	
+	/**
+	 * Returns the index of the CRS within the CRS list.
+	 *
+	 * @param crs
+	 * @return The CRS's index if it exists, -1 if it not exists.
+	 */
+	public int getSRSIndex(String crs) {
+		for (int i = 0; i < getLstSRSs().getModel().getSize(); i++) {
+			if (crs != null
+					&& crs.compareTo(getLstSRSs().getModel().getElementAt(i).toString()) == 0) {
+				return i;
+			}
+		}
+		return -1;
+	}
+
+	/**
+	 * Returns the index of the format within the formats list.
+	 * @param format
+	 * @return The format's index if it exists, -1 if it not exists.
+	 */
+	public int getImageFormatIndex(String format) {
+		for (int i = 0; i < getImageFormats().getModel().getSize(); i++) {
+			if (format != null && 
+				format.compareTo(getImageFormats().getModel().getElementAt(i).toString()) == 0) {
+				return i;
+			}
+		}
+		return -1;
+	}
+	
+	/**
+	 * Returns the index of the format within the formats list.
+	 * @param format
+	 * @return The format's index if it exists, -1 if it not exists.
+	 */
+	public int getInfoFormatIndex(String format) {
+		for (int i = 0; i < getInfoFormats().getModel().getSize(); i++) {
+			if (format != null && 
+				format.compareTo(getInfoFormats().getModel().getElementAt(i).toString()) == 0) {
+				return i;
+			}
+		}
+		return -1;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.wmts.app.wmtsclient.gui.panel.WMTSGUIInterface#updateInfo(java.util.HashMap)
+	 */
+	public void updateSelectedInfo(HashMap info) {
+		setLayerName((String)info.get("name"));
+
+		setVisible(true);
+		setListenerSupport(new WizardListenerSupport());
+
+		String selectedLayer = (String) info.get("selectedLayer");
+		setSelectedLayer(selectedLayer);
+
+		// srs
+		String srs = (String) info.get("srs");
+		int index = getSRSIndex( srs );
+		if (index != -1) {
+			getLstSRSs().setSelectedIndex(index);
+		}
+
+		// image format
+		String imageFormat = (String) info.get("imageformat");
+		index = getImageFormatIndex(imageFormat);
+		if (index != -1) {
+			getImageFormats().setSelectedIndex(index);
+		}
+
+		// info format
+		String infoFormat = (String) info.get("infoformat");
+		index = getInfoFormatIndex(infoFormat);
+		if (index != -1) {
+			getInfoFormats().setSelectedIndex(index);
+		}
+
+		refreshInfo();
+	}
+	
+	private void setSelectedLayer(String name) {
+		LayerTreeModel treeModel = (LayerTreeModel)getLayerPanel().getTreeLayers().getModel();
+		WMTSTheme theme = (WMTSTheme)treeModel.getNodeByName(name);
+		
+		JDnDListModel modelo = (JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel();
+		modelo.addElement(0, new LayerUI(theme));
+		getLayerPanel().getLstSelectedLayers().setSelectedIndex(0);
+		
+		refreshSelectedLayerData();
+	}
+
+	/**
+	 * Gets the available layers in WMTS maintaining the tree structure
+	 *
+	 * @return
+	 */
+	public LayerTree getLayerStructure() {
+		return layerPanel.getTreeLayers();
+	}
+	
+	/**
+	 * Gets the list of the styles
+	 * @return
+	 */
+	public Vector getStyleTitles() {
+		return getTabStyle().getStyleTree().getStyleSelectionTitles();
+	}
+
+	/**
+	 * Gets the list of the selected layers
+	 * @return
+	 */
+	public Vector getSelectedLayersVector() {
+		JDnDListModel mod = (JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel();
+		Vector lyrs = new Vector();
+		for (int i = 0; i < mod.getSize(); i++) {
+			lyrs.add(mod.getElementAt(i));
+		}
+		return lyrs;
+	}
+	
+	/**
+	 * Gets the currently shown style tree.
+	 * @return
+	 */
+	public StyleTree getStyleTree() {
+		return getTabStyle().getStyleTree();
+	}
+	
+	/**
+	 * Gets an array with the list of layers
+	 * @return
+	 */
+	public LayerUI[] selectedLayersToArray() {
+		JDnDListModel modelo = ((JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel());
+		ArrayList elements = modelo.getElements();
+		LayerUI[] layers = (LayerUI[]) elements.toArray(new LayerUI[0]);
+		return layers;
+	}
+	
+	/**
+	 * Gets the SRS list
+	 * @return
+	 */
+	public JList getLstSRSs() {
+		return getJPanelFormatsAndSrs().getLstSRSs();
+	}
+	
+	/**
+	 * Gets the image format list
+	 * @return
+	 */
+	public JList getImageFormats() {
+		return getJPanelFormatsAndSrs().getLstImageFormats();
+	}
+	
+	/**
+	 * Gets the info format list
+	 * @return
+	 */
+	public JList getInfoFormats() {
+		return getJPanelFormatsAndSrs().getLstInfoFormats();
+	}
+	
+	//*****************************************************************
+
+	/**
+	 * This method checks for the options selected within the configuration
+	 * dialog are correct and enough to perform a GetMap request.
+	 *
+	 * @return true if you're done, false if not.
+	 */
+	public boolean isCorrectlyConfigured() {
+		this.repaint();
+		Object[] values = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+		getLayerPanel().getBtnDel().setEnabled(values != null && values.length > 0);
+		return (values == null || values.length == 0) ? false : true;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	private void delLayer() {
+		int[] indices = getLayerPanel().getLstSelectedLayers().getSelectedIndices();
+
+		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);
+			layerPanel.getLstSelectedLayers().clearSelection();
+			fireWizardComplete(isCorrectlyConfigured());
+
+			// 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();
+			refreshInfo();
+		} catch (ArrayIndexOutOfBoundsException ex) {
+			// if you reach this, please, tell me how you did it.
+			ex.printStackTrace();
+		}
+	}
+
+	/**
+	 * 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);
+		callStateChanged(b);
+	}
+
+	/**
+	 * Refreshes the content shown by this component and dependent of the selected layer.
+	 * If the layer selected is changed then the list of srs, image formats, information formats and so on,
+	 * will change.
+	 */
+	public void refreshSelectedLayerData() {
+		refreshSRS();
+		refreshImageFormats();
+		refreshInfoFormats();
+		getLayerPanel().getLstSelectedLayers().repaint();
+		refreshStyleTree();
+	}
+
+	/**
+	 * Refreshes the info tab
+	 */
+	public void refreshInfo() {
+		getTabInfo().refresh(explorer, getSelectedLayersVector(),
+				getStyleTitles(), getSelectedImageFormat(), getSelectedSRS());
+	}
+	
+	/**
+	 * Refreshes the style tab
+	 */
+	private void refreshStyleTree() {
+		StyleTreeModel model = new StyleTreeModel(PluginServices.getText(this, "selected_layers"));
+		jTabbedPane.setEnabledAt(stylesTabIndex, false);
+		
+		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+		if(selectedValues != null && selectedValues.length == 1) {
+			int s = getJPanelFormatsAndSrs().getLstSRSs().getSelectedIndex();
+			if(s != -1)
+				((LayerUI)selectedValues[0]).srsFormatSelected = s;
+		}
+		
+		ListModel listModel = getLayerPanel().getLstSelectedLayers().getModel();
+		for (int i = 0; i < listModel.getSize(); i++) {
+			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);
+			}
+		}
+
+		getStyleTree().setModel(model);
+		getStyleTree().expandAll();
+		getStyleTree().repaint();
+	}
+	
+	/**
+	 * Refreshes the Image formats list
+	 */
+	private void refreshImageFormats() {
+		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+		if( (selectedValues == null || selectedValues.length == 0) &&
+			getImageFormats().getModel() != null && 
+			getImageFormats().getModel() instanceof WMTSParametersListModel) {
+			((WMTSParametersListModel)getImageFormats().getModel()).removeAllItems();
+		}
+		if(selectedValues != null && selectedValues.length == 1) {
+			ArrayList formats = ((LayerUI)selectedValues[0]).theme.getLayer().getFormat();
+			WMTSParametersListModel model = new WMTSParametersListModel(formats);
+			getImageFormats().setModel(model);
+			getImageFormats().setSelectedIndex(((LayerUI)selectedValues[0]).imageFormatSelected);
+		}
+	}
+	
+	/**
+	 * Refreshes the Information formats list
+	 */
+	private void refreshInfoFormats() {
+		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+		if( (selectedValues == null || selectedValues.length == 0) &&
+			getInfoFormats().getModel() != null && 
+			getInfoFormats().getModel() instanceof WMTSParametersListModel) {
+				((WMTSParametersListModel)getInfoFormats().getModel()).removeAllItems();
+		}
+		if(selectedValues != null && selectedValues.length == 1) {
+			ArrayList formats = ((LayerUI)selectedValues[0]).theme.getLayer().getInfoFormat();
+			WMTSParametersListModel model = new WMTSParametersListModel(formats);
+			getInfoFormats().setModel(model);
+			getInfoFormats().setSelectedIndex(((LayerUI)selectedValues[0]).infoFormatSelected);
+		}
+	}
+	
+	/**
+	 * Refreshes the SRS list
+	 */
+	private void refreshSRS() {
+		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+		if( (selectedValues == null || selectedValues.length == 0) &&
+			getLstSRSs().getModel() != null &&
+			getLstSRSs().getModel() instanceof WMTSParametersListModel) {
+			((WMTSParametersListModel)getLstSRSs().getModel()).removeAllItems();
+		}
+		if(selectedValues != null && selectedValues.length == 1) {
+			ArrayList formats = ((LayerUI)selectedValues[0]).theme.getLayer().getSrsList();
+			WMTSParametersListModel model = new WMTSParametersListModel(formats);
+			getLstSRSs().setModel(model);
+			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 (modelo.addElement(0, new LayerUI(nodo))) {
+				alguno = true;
+			}
+			getLayerPanel().getLstSelectedLayers().setSelectedIndex(0);
+		}
+
+		if (alguno) {
+			refreshSelectedLayerData();
+		}
+		refreshInfo();
+	}
+	
+	public void setListenerSupport(WizardListenerSupport support) {
+		listenerSupport = support;
+	}
+
+	/**
+	 * Sets the explorer
+	 * @param data
+	 */
+	public void setWizardData(WMTSServerExplorer data) {
+		explorer = data;
+		((JDnDListModel)getLayerPanel().getLstSelectedLayers().getModel()).clear();
+		layerPanel.getLstSelectedLayers().repaint();
+
+		getLayerPanel().getTreeLayers().setModel(new LayerTreeModel(explorer.getThemes()));
+		refreshInfo();
+	}
+
+
+	public String getLayersQuery() {
+		ArrayList elements = ((JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel()).getElements();
+		LayerUI[] layers = (LayerUI[]) elements.toArray(new LayerUI[0]);
+
+		// Nombre separado por comas de las capas
+		String layersQuery = layers[layers.length - 1].theme.getTitle();
+
+		for (int i = layers.length - 2; i >= 0; i--) {
+			layersQuery += ("," + layers[i].theme.getTitle());
+		}
+
+		return layersQuery;
+	}
+
+	/**
+	 * Returns the name of the layer that the user has typed-in
+	 *
+	 * @return
+	 */
+	public String getLayerName() {
+		return getLayerPanel().getJTxtNomCapa().getText();
+	}
+
+	public void setLayerName(String name) {
+		getLayerPanel().getJTxtNomCapa().setText(name);
+	}
+
+	/**
+	 * Sets the focus to the tab next to the current one.
+	 *
+	 * Enfoca a la solapa siguiente a la actualmente enfocada del TabbedPane
+	 *
+	 */
+	public void avanzaTab() {
+		int currentPage = currentPage();
+		int nPages = getNumTabs();
+		if (nPages - 1 > currentPage) {
+			getJTabbedPane().setSelectedIndex(nextEnabledPage());
+		}
+	}
+
+	/**
+	 * Sets the focus to the tab previous to the current one.
+	 *
+	 * Enfoca a la solapa anterior a la actualmente enfocada del TabbedPane
+	 *
+	 */
+	public void retrocedeTab() {
+		this.getJTabbedPane().setSelectedIndex(previousEnabledPage());
+
+	}
+
+	/**
+	 * Returns the index of the current tab.
+	 *
+	 * Devuelve el �ndice de la p�gina actual del wizard.
+	 *
+	 * @return
+	 */
+	public int currentPage() {
+		return getJTabbedPane().getSelectedIndex();
+	}
+
+	/**
+	 * 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() {
+		return getJTabbedPane().getTabCount();
+	}
+
+	/**
+	 * <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() {
+		int currentPage = currentPage();
+		int j = 0;
+		if (currentPage == 0) {
+			j = -1;
+		}
+		for (int i = currentPage - 1; i > -1; i--) {
+			if (getJTabbedPane().isEnabledAt(i)) {
+				j = i;
+				break;
+			}
+		}
+		return j;
+	}
+
+	/**
+	 * <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() {
+		int currentPage = currentPage();
+		int nPages = getNumTabs();
+		if (currentPage == nPages) {
+			return -1;
+		}
+		for (int i = currentPage + 1; i < nPages; i++) {
+			if (getJTabbedPane().isEnabledAt(i)) {
+				return i;
+			}
+		}
+		return -1;
+	}
+
+	/**
+	 * 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.getStoreParameters();
+			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;
+	}
+	
+	/**
+	 * Returns the current selected SRS.
+	 * @return
+	 */
+	public String getSelectedSRS() {
+		return (String) getJPanelFormatsAndSrs().getLstSRSs().getSelectedValue();
+	}
+	
+	private String getSelectedImageFormat() {
+		return (String) getJPanelFormatsAndSrs().getLstImageFormats().getSelectedValue();
+	}
+	
+	private String getSelectedInfoFormat() {
+		return (String) getJPanelFormatsAndSrs().getLstInfoFormats().getSelectedValue();
+	}
+	
+	private WMTSStyle getSelectedStyle(String layerName) {
+		return (WMTSStyle) getStyleTree().getSelectedStyle(layerName);
+	}
+	
+	@SuppressWarnings("unused")
+	private boolean getSelectedTransparency() {
+		return getJPanelFormatsAndSrs().getChkTransparency().isSelected();
+	}
+
+	public void initWizard() {
+	}
+
+	public void execute() {
+	}
+
+	protected boolean nodeSelected(TreePath[] selection, WMTSTheme node) {
+		for (int i = 0; i < selection.length; i++) {
+			Object[] components = selection[i].getPath();
+			for (int j = 0; j < components.length; j++) {
+				if (components[j] instanceof WMTSTheme) {
+					if (((WMTSTheme) components[j]).getTitle().compareTo(
+							node.getTitle()) == 0) {
+						return true;
+					}
+				}
+			}
+		}
+		return false;
+	}
+
+	public ArrayList getSelectedPaths() {
+		return selectedPaths;
+	}
+
+	public LayerTree getJustTreeLayer() {
+		return getLayerPanel().getTreeLayers();
+	}
+
+	@Override
+	public DataStoreParameters[] getParameters() {
+		return null;
+	}
+
+	@Override
+	public void close() {
+	}
+	
+	public WMTSServerExplorer getExplorer() {
+		return explorer;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == getLayerPanel().getBtnDown()) {
+			LayerList list = getLayerPanel().getLstSelectedLayers();
+			int[] selectedIndices = list.getSelectedIndices();
+			int index = list.getSelectedIndex();
+			if (selectedIndices != null
+					&& selectedIndices.length == 1
+					&& index < getLayerPanel().getLstSelectedLayers().getModel().getSize() - 1) {
+				JDnDListModel m = (JDnDListModel) list.getModel();
+				m.itemsMoved(index + 1, new int[] { index });
+				list.setSelectedIndex(index + 1);
+			}
+		}
+		
+		if(e.getSource() == getLayerPanel().getBtnUp()) {
+			LayerList list = getLayerPanel().getLstSelectedLayers();
+			int[] selectedIndices = list.getSelectedIndices();
+			int index = list.getSelectedIndex();
+			if (selectedIndices != null && selectedIndices.length == 1
+					&& index > 0) {
+				JDnDListModel m = (JDnDListModel) list.getModel();
+				m.itemsMoved(index - 1, new int[] { index });
+				list.setSelectedIndex(index - 1);
+			}
+		}
+		
+		if(e.getSource() == getLayerPanel().getBtnAdd()) {
+			addLayer();
+		}
+		
+		if(e.getSource() == getLayerPanel().getBtnDel()) {
+			delLayer();
+		}
+		
+		if(e.getSource() == getLayerPanel().getChkExtendedNames()) {
+			fPrefs.putBoolean("show_layer_names", getLayerPanel().getChkExtendedNames().isSelected());
+		}
+	}
+
+	public void itemStateChanged(ItemEvent e) {
+		if(e.getSource() == getLayerPanel().getChkExtendedNames()) {
+			boolean b = getLayerPanel().getChkExtendedNames().isSelected();
+			getLayerPanel().getTreeLayers().showLayerNames = b;
+			getLayerPanel().getTreeLayers().repaint();
+			getLayerPanel().getLstSelectedLayers().showLayerNames = b;
+			getLayerPanel().getLstSelectedLayers().repaint();
+			getStyleTree().showLayerNames = b;
+		}
+		
+		if(e.getSource() == getJPanelFormatsAndSrs().getChkTransparency()) {
+			fireWizardComplete(isCorrectlyConfigured());
+		}
+	}
+	
+	public void keyTyped(KeyEvent e) {
+		if(e.getSource() == getLayerPanel().getJTxtNomCapa()) {
+			fireWizardComplete(isCorrectlyConfigured());
+		}
+	}
+
+	public void keyPressed(KeyEvent e) {
+	}
+
+	public void keyReleased(KeyEvent e) {
+	}
+
+	public void valueChanged(ListSelectionEvent e) {
+		fireWizardComplete(isCorrectlyConfigured());
+		/*if(e.getSource() == getLayerPanel().getLstSelectedLayers()) {
+			fireWizardComplete(isCorrectlyConfigured());
+		}*/
+		
+		/*if(e.getSource() == getLstSRSs()) {
+			//fireWizardComplete(isCorrectlyConfigured());
+			Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+			if(selectedValues != null && selectedValues.length == 1) {
+				int s = getJPanelFormatsAndSrs().getLstSRSs().getSelectedIndex();
+				if(s != -1)
+					((LayerUI)selectedValues[0]).srsFormatSelected = s;
+			}
+		}
+		
+		if(e.getSource() == getJPanelFormatsAndSrs().getLstInfoFormats()) {
+			//fireWizardComplete(isCorrectlyConfigured());
+			Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+			if(selectedValues != null && selectedValues.length == 1) {
+				int s = getJPanelFormatsAndSrs().getLstInfoFormats().getSelectedIndex();
+				if(s != -1)
+					((LayerUI)selectedValues[0]).infoFormatSelected = s;
+			}
+		}
+
+		if(e.getSource() == getJPanelFormatsAndSrs().getLstImageFormats()) {
+			//fireWizardComplete(isCorrectlyConfigured());
+			Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+			if(selectedValues != null && selectedValues.length == 1) {
+				int s = getJPanelFormatsAndSrs().getLstImageFormats().getSelectedIndex();
+				if(s != -1)
+					((LayerUI)selectedValues[0]).imageFormatSelected = s;
+			}
+		}*/
+	}
+
+	public void mouseClicked(MouseEvent e) {
+		if(e.getSource() == getLayerPanel().getTreeLayers()) {
+			if (e.getClickCount() == 2) {
+				addLayer();
+			}
+		}
+	}
+
+	public void mouseEntered(MouseEvent e) {
+	}
+
+	public void mouseExited(MouseEvent e) {
+	}
+
+	public void mousePressed(MouseEvent e) {
+	}
+
+	public void mouseReleased(MouseEvent e) {
+		if(e.getSource() == getLayerPanel().getLstSelectedLayers()) {
+			refreshSelectedLayerData();
+		}
+	}
+	
+
+	public void valueChanged(TreeSelectionEvent e) {
+		if(e.getSource() == getLayerPanel().getTreeLayers()) {
+			boolean isGetMapable = false;
+			TreePath[] selecciones = getLayerPanel().getTreeLayers().getSelectionPaths();
+
+			if (selecciones != null) {
+				for (int i = 0; i < selecciones.length && !isGetMapable; i++) {
+					if(selecciones[i].getLastPathComponent() instanceof WMTSTheme) {
+						WMTSTheme layer = ((WMTSTheme) selecciones[i].getLastPathComponent());
+						isGetMapable = layer.getChildCount() == 0 || layer.getTitle() != null;
+					}
+				}
+
+			}
+			getLayerPanel().getBtnAdd().setEnabled(isGetMapable);
+			fireWizardComplete(isCorrectlyConfigured());
+		}
+	}
+
+	public void setDeleteCache(boolean deleteCache) {
+		this.deleteCache = deleteCache;
+	}
+
+} // @jve:decl-index=0:visual-constraint="10,10"

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/WMTSParamsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/StyleTree.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/StyleTree.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/StyleTree.java	(revision 1459)
@@ -0,0 +1,371 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.Vector;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTree;
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.WMTSParamsPanel.LayerUI;
+import org.gvsig.remoteclient.wmts.struct.WMTSStyle;
+import org.gvsig.remoteclient.wmts.struct.WMTSTheme;
+
+
+/**
+ * This class holds a visual tree that handles the selection of the styles in the
+ * selected layers. It encapsulates any gui interface handling the mouse selection.
+ * <p>
+ * It has a method getStylesSelection that returns the current selection in a 
+ * bi-dimensional string array containing the layer name and the selected style name.
+ * </p>
+ * <p>
+ * Keep in mind that although it's similar to LayersTree it is not the same.
+ * It does not use the same instances of the WMTSLayerNode that LayerTreeModel
+ * because it allows to repeat layers. So, each layer is a completely new 
+ * WMTSLayerNode containing same properties but not the same parent (which is always
+ * the tree root) and each style is a completely new FMapStyle containing same
+ * properties but its parent is one of the layers of the StylesTree and not one
+ * of those of the Layers tree.
+ * </p>
+ * 
+ * @author jaume dominguez faus
+ *
+ */
+@SuppressWarnings("serial")
+public class StyleTree extends JTree {
+	private static final long serialVersionUID  = 1L;
+	public boolean            showLayerNames    = false;
+	
+    public StyleTree() {
+        super();
+        initialize();
+    }
+    
+  
+	private void initialize() {
+        setToggleClickCount(1);
+        setRowHeight(22);
+        
+        setCellRenderer(new DefaultTreeCellRenderer() {
+            public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
+                if (leaf) {
+                    JPanel leafComponent = new JPanel();
+                    leafComponent.setBackground(Color.WHITE);
+                    JRadioButton leafRadioButton = new JRadioButton("", ((StyleTreeModel) getModel()).isSelected((WMTSStyle) value));//selected);
+                    leafRadioButton.setBackground(Color.WHITE);
+                    leafComponent.add(leafRadioButton);
+                    leafComponent.add(new JLabel(((WMTSStyle) value).getIdentifier()));
+                    return leafComponent;
+                } else {
+                	super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
+                	if (value instanceof WMTSTheme) {
+                		WMTSTheme layer = (WMTSTheme) value;
+                		if (!showLayerNames) {
+                			if (layer.getIdentifier() != null || layer.getIdentifier() == "") {
+                				String text = layer.toString();
+                				text = text.substring(text.indexOf(']') + 2, text.length());
+                				setText(text);
+                			}
+                		}
+                	}
+            		return this;
+                }
+            }});
+        addMouseListener(new java.awt.event.MouseAdapter() { 
+            public void mouseClicked(java.awt.event.MouseEvent e) {
+                ((StyleTreeModel)getModel()).setSelectedLeaf(getSelectionPath());
+                clearSelection();
+                repaint();
+            }
+        });
+    }
+    
+	/**
+	 * Expands this tree.
+	 *
+	 */
+	public void expandAll() {
+		int row = 0; 
+		while (row < getRowCount()) {
+			expandRow(row);
+			row++;
+		}
+	}
+	
+	/**
+	 * Returns a Vector of Strings containing the style titles.
+	 */
+	@SuppressWarnings("unchecked")
+	public Vector getStyleSelectionTitles() {
+		if (getModel() instanceof StyleTreeModel)
+			return ((StyleTreeModel)getModel()).getStyleSelectionTitles();
+		else
+			return null;
+	}
+    
+    /**
+     * Sets the selected styles in the StylesTree. The argument styleNames is
+     * a Vector with exactly the same amount of strings than the amount of
+     * themes (layers) contained by the tree. A blank or null string will
+     * leave the default style for that layer, but this element <b>must exist</b>
+     * in the array in any case.
+     * 
+     * @param styleNames, Vector containing the style names. 
+     * The styles order <b>must match</b> with the layer order. 
+     */
+    @SuppressWarnings("unchecked")
+	public void initSelections(Vector styleNames){
+    	if (styleNames!=null) {
+    		StyleTreeModel model = (StyleTreeModel) getModel();
+    		model.setStylesSelection(styleNames);
+    	}
+    }
+    
+    /**
+     * Gets the style selected
+     * @param layerName
+     * @return
+     */
+    public WMTSStyle getSelectedStyle(String layerName) {
+    	StyleTreeModel model = (StyleTreeModel) getModel();
+    	LayerUI layerUI = model.getLayer(layerName);
+    	if(layerUI != null)
+    		return layerUI.styleSelected;
+    	return null;
+    }
+	
+}
+
+class StyleTreeModel implements TreeModel {
+	private String             root   = null;
+	private ArrayList<LayerUI> layers = new ArrayList<LayerUI>();
+
+	public StyleTreeModel(String root) {
+		this.root = root;
+    }
+	
+	public LayerUI getLayer(String layerName) {
+		for (int i = 0; i < layers.size(); i++) {
+			if(layers.get(i).theme.getLayer().getTitle().compareTo(layerName) == 0) {
+				return layers.get(i);
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Will return true if this style is selected.
+	 * @param style
+	 * @return
+	 */
+	public boolean isSelected(WMTSStyle style) {
+		for (int i = 0; i < layers.size(); i++) {
+			LayerUI layerUI = layers.get(i);
+			if(layerUI.styleSelected == style)
+				return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Gets the names of the selected styles into a Vector using the same order
+	 * as they was represented in the StylesTree.
+	 * @return
+	 */
+	public Vector<String> getStyleSelectionTitles() {
+		Vector<String> v = new Vector<String>();
+		for (int i = 0; i < layers.size(); i++) {
+			LayerUI layer = (LayerUI) layers.get(i);
+			WMTSStyle sty = layer.styleSelected;
+			if (sty == null) 
+				v.add("");
+			else 
+				v.add(sty.getIdentifier());
+		}
+		return v;
+	}
+
+	/**
+	 * Sets the selected styles in the StylesTree. The argument styleNames is
+	 * a Vector with exactly the same amount of strings than the amount of
+	 * themes (layers) contained by the tree. A blank or null string will
+	 * leave the default style for that layer, but this element <b>must exist</b>
+	 * in the array in any case.
+	 * 
+	 * @param styleNames, Vector containing the style names. 
+	 * The styles order <b>must match</b> with the layer order. 
+	 */
+	@SuppressWarnings("unchecked")
+	public void setStylesSelection(Vector styleNames) {
+		for (int i = 0; i < layers.size(); i++) {
+			LayerUI layer = (LayerUI) layers.get(i);
+			for (int j = 0; j < layer.theme.getLayer().getStyle().size(); j++) {
+				WMTSStyle sty = (WMTSStyle) layer.theme.getLayer().getStyle().get(j);
+				if ( sty.getIdentifier().compareTo((String) styleNames.get(i)) == 0) {
+					layer.styleSelected = sty;
+				}
+			}
+		}
+	}
+	
+	/**
+	 * Adds a new branch to this tree. It must be a layer node.
+	 * @param node
+	 * @return <b>True</b>, if the added branch actually defines any style.
+	 *         <b>False</b>, if the layer has no styles.
+	 */
+	@SuppressWarnings("unchecked")
+	public boolean addLayerBranch(LayerUI node) {
+		layers.add(node);
+		
+		//Si no hay ninguno seleccionado seleccionamos el primero
+		for (int i = 0; i < layers.size(); i++) {
+			if(layers.get(i).styleSelected == null) {
+				ArrayList<WMTSStyle> sty = layers.get(i).theme.getLayer().getStyle();
+				if(sty != null && sty.size() > 0 && sty.get(0) != null)
+					layers.get(i).styleSelected = sty.get(0);
+			}
+		}
+
+		if (node.theme.getLayer().getStyle() == null || node.theme.getLayer().getStyle().size() == 0) {
+			return false;
+		}
+		return true;
+	}
+	
+	/**
+     * Sets a leaf (an style) selected.
+     * @param selectionPath to this leaf.
+     */
+	protected void setSelectedLeaf(TreePath selectionPath) {
+		if (selectionPath != null) {
+			Object[] objects = selectionPath.getPath();
+			Object item = objects[objects.length - 1];
+			if (isLeaf(item)) {
+				LayerUI layer = (LayerUI)objects[objects.length - 2]; 
+				WMTSStyle style = (WMTSStyle) item;
+				for (int j = 0; j < layer.theme.getLayer().getStyle().size(); j++) {
+					WMTSStyle sty = (WMTSStyle)layer.theme.getLayer().getStyle().get(j);
+					if(sty.getIdentifier().equals(style.getIdentifier())) {
+						layer.styleSelected = sty;
+					}
+				}
+			}
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
+	 */
+	public int getChildCount(Object parent) {
+        if (parent instanceof LayerUI)
+            return ((LayerUI) parent).theme.getLayer().getStyle().size();
+        if (parent instanceof WMTSStyle)
+        	return 0;
+        return layers.size();
+    }
+
+	/*
+	 *  (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object)
+	 */
+	public boolean isLeaf(Object node) {
+		return (node instanceof WMTSStyle);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener)
+	 */
+	public void addTreeModelListener(TreeModelListener l) {
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener)
+	 */
+	public void removeTreeModelListener(TreeModelListener l) {
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
+	 */
+	public Object getChild(Object parent, int index) {
+		if (parent instanceof WMTSStyle)
+            return null;
+        
+        if (parent instanceof LayerUI)
+        	return ((LayerUI) parent).theme.getLayer().getStyle().get(index);
+        
+        return layers.get(index);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object, java.lang.Object)
+	 */
+	@SuppressWarnings("unchecked")
+	public int getIndexOfChild(Object parent, Object child) {
+		if (parent instanceof LayerUI && child instanceof WMTSStyle) {
+			ArrayList<WMTSStyle> listStyle = ((LayerUI)parent).theme.getLayer().getStyle();
+			for (int i = 0; i < listStyle.size(); i++) {
+				WMTSStyle sty = listStyle.get(i);
+				if(sty.equals(child))
+					return i;
+			}
+		}
+		
+		if(child instanceof LayerUI) {
+			for (int i = 0; i < layers.size(); i++) {
+				LayerUI layerUI = layers.get(i);
+				if(layerUI.equals(child))
+					return i;
+			}
+		}
+		
+		return -1;
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)
+	 */
+	public void valueForPathChanged(TreePath path, Object newValue) {
+	}
+
+	public Object getRoot() {
+		return root;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/StyleTree.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/WMTSGUIInterface.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/WMTSGUIInterface.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/WMTSGUIInterface.java	(revision 1459)
@@ -0,0 +1,64 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.wmts.app.wmtsclient.gui.panel;
+
+import java.util.HashMap;
+
+import javax.swing.JComponent;
+
+import org.gvsig.app.gui.wizards.WizardListener;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.raster.wmts.app.wmtsclient.layer.FLyrWMTS;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface WMTSGUIInterface {
+	/**
+	 * Gets the component associated.
+	 * @return
+	 */
+	public JComponent getComponent();
+	
+	/**
+	 * Adds a listener to the wizard
+	 * @param listener
+	 */
+	public void addWizardListener(WizardListener listener);
+	
+	/**
+	 * Gets the layer list 
+	 * @return
+	 * @throws LoadLayerException
+	 */
+	//TODO: A eliminar cuando el interface salga a un proyecto swing. Esta funcionalidad debe ir en la extension
+	public FLyrWMTS[] getLayers() throws LoadLayerException;
+	
+	/**
+	 * Updates the selected elements by the user in the properties panel 
+	 * @param info
+	 */
+	public void updateSelectedInfo(HashMap<String, Object> info);
+	
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/panel/WMTSGUIInterface.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSParametersListModel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSParametersListModel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSParametersListModel.java	(revision 1459)
@@ -0,0 +1,74 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.wizard;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.TreeSet;
+
+import javax.swing.AbstractListModel;
+
+
+/**
+ * Data model for a list of SRSs
+ */
+public class WMTSParametersListModel extends AbstractListModel {
+	private static final long serialVersionUID = 1L;
+	
+	ArrayList<Object> srs = new ArrayList<Object>();
+	
+	public WMTSParametersListModel(ArrayList<Object> obj) {
+		srs = obj;
+	}
+	
+	public WMTSParametersListModel() {
+	}
+	
+	public int getSize() {
+		return srs.size();
+	}
+
+	public Object getElementAt(int index) {
+		if(srs.size() > 0 && index >= 0 && index < srs.size())
+			return srs.get(index);
+		return null;
+	}
+	
+	public void removeAllItems() {
+		srs.clear();
+	}
+	
+	public void setAll(Collection<Object> c) {
+		srs.clear();
+		srs.addAll(c);
+	}
+	
+	public Collection<Object> intersect(Collection<Object> c) {
+		TreeSet<Object> resul = new TreeSet<Object>();
+    	for (int i = 0; i < srs.size(); i++) {
+			if (c.contains(srs.get(i)))
+				resul.add(srs.get(i));
+		}
+    	return resul;	
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSParametersListModel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSWizard.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSWizard.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSWizard.java	(revision 1459)
@@ -0,0 +1,467 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.wizard;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.prefs.Preferences;
+
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.persistence.serverData.ServerDataPersistence;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.gui.WizardPanel;
+import org.gvsig.app.gui.wizards.WizardListener;
+import org.gvsig.app.gui.wizards.WizardListenerSupport;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.gui.beans.Messages;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.util.CancelTaskImpl;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.WMTSParamsPanel;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main.IServerPanel;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.panel.main.NextPrevPanel;
+import org.gvsig.raster.wmts.app.wmtsclient.layer.FLyrWMTS;
+import org.gvsig.raster.wmts.io.WMTSDataParameters;
+import org.gvsig.raster.wmts.io.WMTSServerExplorer;
+import org.gvsig.raster.wmts.io.WMTSServerExplorerParameters;
+import org.gvsig.remoteclient.wmts.exception.WMTSException;
+import org.gvsig.remoteclient.wmts.struct.WMTSServiceIdentification;
+import org.gvsig.utils.NotExistInXMLEntity;
+import org.gvsig.utils.XMLEntity;
+import org.gvsig.utils.swing.jcomboServer.ServerData;
+
+/**
+ * The WMTS properties container panel.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+@SuppressWarnings({ "unused", "deprecation" })
+public class WMTSWizard extends WizardPanel implements ActionListener {
+	private static final long             serialVersionUID   = 1L;
+	//private static Logger               logger             = Logger.getLogger(WMTSWizard.class.getName());
+	protected int                         page               = 0;
+	protected boolean                     connected          = false;
+	private IServerPanel                  serverPanel        = null;
+	private NextPrevPanel                 nextPrevPanel      = null;
+	
+	private WizardListenerSupport         listenerSupport    = null;
+	protected WMTSParamsPanel             wmtsParamsPanel    = null;
+	private static Preferences            fPrefs             = Preferences.userRoot().node( "gvsig.wmts-wizard" );
+	private boolean                       refreshing         = fPrefs.getBoolean("refresh_capabilities", false);
+	protected int                         firstPage          = 0;
+	private IProjection                   proj               = null;
+	private ICancellable                  cancel             = null;
+	private WMTSDataParameters            storeParams        = null;
+	private WMTSServerExplorer            explorer           = null;
+
+	/**
+	 * This is the default constructor
+	 */
+	public WMTSWizard() {
+		super();
+		firstPage = 0;
+		page = firstPage;
+		initialize();
+		
+		IWindow[] windows = PluginServices.getMDIManager().getAllWindows();
+		for (int i = 0; i < windows.length; i++) {
+			if(windows[i] instanceof AbstractViewPanel)
+				proj = ((AbstractViewPanel)windows[i]).getProjection();
+		}
+		cancel = new CancelTaskImpl();
+	}
+	
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		setTabName("WMTS");
+		setLayout(new GridBagLayout());
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = GridBagConstraints.BOTH;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.weighty = 1.0;
+		gridBagConstraints1.insets = new java.awt.Insets(2, 12, 10, 12);
+		
+		setVisible(true);
+		add(getIserverPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.insets = new java.awt.Insets(2, 0, 10, 0);
+		add(getPanelPage2(), gridBagConstraints1);
+		gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.anchor = GridBagConstraints.EAST;
+		gridBagConstraints1.weighty = 0;
+		gridBagConstraints1.gridy = 1;
+		add(getNextPrevPanel(), gridBagConstraints1);
+		activarVisualizarBotones();
+		loadServers();
+	}
+	
+	/**
+	 * This method checks for the options selected within the configuration
+	 * dialog are correct.
+	 *
+	 * @return true if you're done, false if not.
+	 */
+	public boolean areSettingsValid() {
+		return wmtsParamsPanel.isCorrectlyConfigured();
+	}
+	
+	private WizardListenerSupport getWizardListenerSupport() {
+		if(listenerSupport == null)
+			listenerSupport = new WizardListenerSupport();
+		return listenerSupport;
+	}
+	
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public NextPrevPanel getNextPrevPanel() {
+		if (nextPrevPanel == null) {
+			nextPrevPanel = new NextPrevPanel();
+			nextPrevPanel.getBtnNext().addActionListener(this);
+			nextPrevPanel.getBtnPrev().addActionListener(this);
+		}
+		return nextPrevPanel;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param host DOCUMENT ME!
+	 */
+	private void addHost(String host) {
+		host = host.trim();
+
+		ServerDataPersistence persistence = new ServerDataPersistence(this,ServerData.SERVER_TYPE_WMTS);
+		persistence.addServerData(new ServerData(host, ServerData.SERVER_TYPE_WMTS));
+		persistence.setPersistent();
+	}
+	
+	/**
+	 * Thread to connect to a WMTS server
+	 * @author Nacho Brodin (nachobrodin@gmail.com)
+	 */
+	public class ConnectThread extends Thread {
+		private ICancellable              cancel      = null;
+		private WMTSServerExplorer        explorer    = null;
+		private WMTSWizard                wizard      = null;
+		
+		public ConnectThread(ICancellable cancel, WMTSServerExplorer explorer, WMTSWizard wizard) {
+			this.cancel = cancel;
+			this.explorer = explorer;
+			this.wizard = wizard;
+		}
+		
+	    public void run() {
+	    	try {
+	    		explorer.connect(cancel);
+			} catch (WMTSException e) {
+				serverPanel.getTxtAbstract().setText("Connection closed... \n" + e.getMessage());
+				JOptionPane.showMessageDialog(null, Messages.getText("wmts_cant_connect"), Messages.getText("Error"), JOptionPane.ERROR_MESSAGE);
+				return;
+			} finally {
+				((CancelTaskImpl)cancel).setCanceled(false);
+			}
+			
+			DataStoreParameters parameters = explorer.getStoreParameters();
+			if(parameters instanceof WMTSDataParameters) {
+				storeParams = (WMTSDataParameters) parameters;
+			}
+			
+			if(parameters instanceof TileDataParameters) {
+				DataParameters p = ((TileDataParameters) parameters).getDataParameters();
+				if(p instanceof WMTSDataParameters)
+					storeParams = (WMTSDataParameters) p;
+			}
+			
+			wizard.rellenarControles();
+	    }
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	private void rellenarControles() {
+		try {
+			String host = serverPanel.getTxtHost().getModel().getSelectedItem().toString();
+			WMTSServiceIdentification id = explorer.getServiceIdentification();
+			
+			serverPanel.getJLabelTitle().setText(id.getTitle());
+			nextPrevPanel.getJLabelServerTypeValue().setText(id.getServiceType());
+			serverPanel.getTxtAbstract().setText(id.getAbstract());
+
+			addHost(host);
+			wmtsParamsPanel.setWizardData(explorer);
+			connected = true;
+			activarVisualizarBotones();
+		} catch (Exception e) {
+			if (e.getMessage() == null) {
+				serverPanel.getTxtAbstract().setText(PluginServices.getText(this,"error"));
+			} else {
+				serverPanel.getTxtAbstract().setText(e.getMessage());
+			}
+			getWizardListenerSupport().callError(e);
+			nextPrevPanel.getBtnNext().setEnabled(false);
+			nextPrevPanel.getBtnPrev().setEnabled(true);
+		} finally {
+			serverPanel.getBtnCancel().setEnabled(false);
+		}
+	}
+	
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == serverPanel.getBtnConnect()) {
+			serverPanel.getBtnCancel().setEnabled(true);
+			serverPanel.getTxtAbstract().setText("Trying to connect...");
+			
+			String host = serverPanel.getTxtHost().getModel().getSelectedItem().toString();
+			try {
+				DataManager datamanager = DALLocator.getDataManager();
+				WMTSServerExplorerParameters explorerParams = (WMTSServerExplorerParameters) datamanager.createServerExplorerParameters(WMTSServerExplorer.NAME);
+				explorerParams.setHost(host);
+				explorerParams.setLongitudeFirst(serverPanel.getChkInvertAxisOrder().isSelected());
+				
+				explorer = (WMTSServerExplorer) datamanager.createServerExplorer(explorerParams);
+				
+				((CancelTaskImpl)cancel).setCanceled(false);
+				new ConnectThread(cancel, explorer, this).start();
+				
+			} catch (InitializeException e1) {
+				serverPanel.getTxtAbstract().setText("Error creating WMTS layer");
+			} catch (ProviderNotRegisteredException e1) {
+				serverPanel.getTxtAbstract().setText("Provider not registered. I cannot connect.");
+			} catch (ValidateDataParametersException e1) {
+				serverPanel.getTxtAbstract().setText("Parameters not valid. I cannot connect.");
+			}
+		}
+		
+		if(e.getSource() == serverPanel.getBtnCancel()) {
+			serverPanel.getTxtAbstract().setText("Cancelled...");
+			((CancelTaskImpl)cancel).setCanceled(true);
+			serverPanel.getBtnCancel().setEnabled(false);
+		}
+		
+		if(e.getSource() == nextPrevPanel.getBtnPrev()) {
+			page --;
+			if (page > firstPage) {
+				wmtsParamsPanel.retrocedeTab();
+				page = wmtsParamsPanel.currentPage() + 1;
+				activarVisualizarBotones();
+			} else if (page == firstPage){
+				activarVisualizarBotones();
+				page = firstPage +1;
+				serverPanel.getJLabelTitle().setText("-");
+				serverPanel.getTxtAbstract().setText("");
+				wmtsParamsPanel.retrocedeTab();
+				getIserverPanel().setVisible(true);
+				getPanelPage2().setVisible(false);
+				nextPrevPanel.getBtnNext().setEnabled(false);
+				connected = false;
+			}
+			getWizardListenerSupport().callStateChanged(wmtsParamsPanel.isCorrectlyConfigured());
+		}
+		
+		if(e.getSource() == nextPrevPanel.getBtnNext()) {
+			if (page > firstPage) {
+				// si page es mayor que cero, vamos enfocando las
+				// sucesivas SOLAPAS del WMTSParamsPanel
+				wmtsParamsPanel.avanzaTab();
+				page = wmtsParamsPanel.currentPage();
+			}
+			page++;
+			getIserverPanel().setVisible(false);
+			getPanelPage2().setVisible(true);
+			activarVisualizarBotones();
+		}
+	}
+	
+	private JPanel getIserverPanel() {
+		if (serverPanel == null) {
+			serverPanel = new IServerPanel();
+			serverPanel.getBtnCancel().addActionListener(this);
+			serverPanel.getBtnConnect().addActionListener(this);
+		}
+		return serverPanel;
+	}	
+	
+	protected JPanel getPanelPage2() {
+		if (wmtsParamsPanel == null){
+			wmtsParamsPanel = new WMTSParamsPanel();
+			wmtsParamsPanel.setListenerSupport(getWizardListenerSupport());
+			wmtsParamsPanel.getJTabbedPane().addMouseListener(
+					new java.awt.event.MouseAdapter() {
+						public void mouseClicked(java.awt.event.MouseEvent e) {
+							page = wmtsParamsPanel.currentPage() + 1;
+							activarVisualizarBotones();
+						}
+					});
+		}
+		return wmtsParamsPanel;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	protected void activarVisualizarBotones() {
+		if (page == firstPage) {
+			nextPrevPanel.getBtnPrev().setEnabled(false);
+			nextPrevPanel.getBtnPrev().setVisible(true);
+
+			if (connected) {
+				nextPrevPanel.getBtnNext().setEnabled(true);
+			} else {
+				nextPrevPanel.getBtnNext().setEnabled(false);
+			}
+		} else if (page < wmtsParamsPanel.getNumTabs()) {
+			nextPrevPanel.getBtnNext().setEnabled(true);
+			nextPrevPanel.getBtnNext().setVisible(true);
+			nextPrevPanel.getBtnPrev().setEnabled(true);
+			nextPrevPanel.getBtnPrev().setVisible(true);
+			if (wmtsParamsPanel.nextEnabledPage()==-1) {
+				nextPrevPanel.getBtnNext().setEnabled(false);
+			}
+			getWizardListenerSupport().callStateChanged(wmtsParamsPanel.isCorrectlyConfigured());
+		} else if (page == wmtsParamsPanel.getNumTabs()) {
+			nextPrevPanel.getBtnNext().setVisible(false);
+			nextPrevPanel.getBtnNext().setEnabled(false);
+			getWizardListenerSupport().callStateChanged(wmtsParamsPanel.isCorrectlyConfigured());
+		}
+	}
+
+	/**
+	 * This method initializes txtHost
+	 * @return javax.swing.JTextField
+	 */
+	private void loadServers() {
+		ServerDataPersistence persistence = new ServerDataPersistence(this, ServerData.SERVER_TYPE_WMTS);
+		ServerData[] servers = persistence.getArrayOfServerData();
+
+		if (servers.length == 0) {
+			PluginServices ps = PluginServices.getPluginServices(this);
+			XMLEntity xml = ps.getPersistentXML();
+			try {
+				String[] oldServers = xml.getStringArrayProperty("wmts-servers");
+				servers = new ServerData[oldServers.length];
+				for (int i = 0; i < oldServers.length; i++) {
+					servers[i] = new ServerData(oldServers[i], ServerData.SERVER_TYPE_WMTS);
+				}
+				xml.remove("wmts-servers");
+				ps.setPersistentXML(xml);
+			} catch (NotExistInXMLEntity e) {
+				// Old servers doesn't exist
+				servers = new ServerData[2];
+				servers[0] = new ServerData("http://v2.suite.opengeo.org/geoserver/gwc/service/wmts/", ServerData.SERVER_TYPE_WMTS);
+				servers[1] = new ServerData("http://maps.opengeo.org/geowebcache/service/wmts", ServerData.SERVER_TYPE_WMTS);
+				
+				/*servers[0] = new ServerData("http://www.ign.es/wmts/ign-base", ServerData.SERVER_TYPE_WMTS);
+				servers[1] = new ServerData("http://maps.opengeo.org/geowebcache/service/wmts", ServerData.SERVER_TYPE_WMTS);
+				servers[2] = new ServerData("http://v2.suite.opengeo.org/geoserver/gwc/service/wmts/", ServerData.SERVER_TYPE_WMTS);*/
+			}
+
+			for (int i = 0; i < servers.length; i++) {
+				persistence.addServerData(servers[i]);
+			}
+			persistence.setPersistent();
+		}
+
+		serverPanel.getTxtHost().setServerList(servers);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 * @param listener
+	 */
+	public void addWizardListener(WizardListener listener) {
+		getWizardListenerSupport().addWizardListener(listener);
+		getWizardListenerSupport().callStateChanged(false);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 * @param listener
+	 */
+	public void removeWizardListener(WizardListener listener) {
+		getWizardListenerSupport().removeWizardListener(listener);
+	}
+
+	/**
+	 * Devuelve el host que est� escrito en el cuadro de texto del host o null
+	 * en caso de que no haya nada escrito o est� mal escrito
+	 *
+	 * @return URL del host
+	 */
+	public URL getHost() {
+		try {
+			if ((serverPanel.getTxtHost() == null)|| (serverPanel.getTxtHost().getModel().getSelectedItem() == null)) {
+				return new URL(explorer.getHost());
+			} else {
+				return new URL(serverPanel.getTxtHost().getModel().getSelectedItem().toString());
+			}
+		} catch (MalformedURLException e) {
+			return null;
+		}
+	}
+
+	public void initWizard() {
+	}
+	
+	@Override
+	public DataStoreParameters[] getParameters() {
+		return null;
+	}
+
+	@Override
+	public void close() {
+	}
+
+	@Override
+	public void execute() {
+		try {
+			wmtsParamsPanel.setDeleteCache(serverPanel.getChkCaching().isSelected());
+			FLyrWMTS[] layerList = wmtsParamsPanel.getLayers();
+			for (int i = 0; i < layerList.length; i++) {
+				getMapCtrl().getMapContext().getLayers().addLayer(layerList[i]);
+			}
+		} catch (LoadLayerException e) {
+			e.printStackTrace();
+		}
+	}
+}  //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSWizard.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/LayerTreeModel.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/LayerTreeModel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/LayerTreeModel.java	(revision 1459)
@@ -0,0 +1,126 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient.gui.wizard;
+
+import java.util.ArrayList;
+
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import org.gvsig.remoteclient.wmts.struct.WMTSTheme;
+import org.gvsig.remoteclient.wmts.struct.WMTSThemes;
+
+/**
+ * Model for the layer three 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+@SuppressWarnings("unchecked")
+public class LayerTreeModel implements TreeModel {
+
+	private WMTSThemes root      = null;
+
+	public LayerTreeModel(WMTSThemes root){
+		this.root = root;
+	}
+
+	public Object getRoot() {
+		return root;
+	}
+
+	public int getChildCount(Object parent) {
+		if(parent instanceof WMTSTheme)
+			return ((WMTSTheme)parent).getChildCount();
+		if(parent instanceof WMTSThemes)
+			return ((WMTSThemes)parent).getChildCount();
+		return 0;
+	}
+
+    public boolean isLeaf(Object node) {
+		return (getChildCount(node) <= 0);
+	}
+
+	public void addTreeModelListener(TreeModelListener l) {
+	}
+
+	public void removeTreeModelListener(TreeModelListener l) {
+	}
+
+	public Object getChild(Object parent, int index) {
+		if(parent instanceof WMTSTheme)
+			return ((WMTSTheme)parent).getChildren(index);
+		if(parent instanceof WMTSThemes)
+			return ((WMTSThemes)parent).getChildren(index);
+		return null;
+	}
+
+	public int getIndexOfChild(Object parent, Object child) {
+		if(parent instanceof WMTSTheme)
+			return ((WMTSTheme)parent).getIndexOfChild((WMTSTheme)parent);
+		if(parent instanceof WMTSThemes)
+			return ((WMTSThemes)parent).getIndexOfChild((WMTSTheme)parent);
+		return -1;
+	}
+
+	public void valueForPathChanged(TreePath path, Object newValue) {
+	}
+
+    /**
+     * @param node, the tree's desired node.
+     * @return Returns the name of the node.
+     */
+    public String getName(Object node) {
+        return ((WMTSTheme) node).getLayer().getTitle();
+    }
+    
+    /**
+     * @param node, the tree's desired node.
+     * @return Returns the namedStyles.
+     */
+	public ArrayList getStyles(Object node) {
+        return ((WMTSTheme) node).getLayer().getStyle();
+    }
+   
+    /**
+     * @param node, the tree's desired node.
+     * @return Returns the title.
+     */
+    public String getTitle(Object node) {
+        return ((WMTSTheme) node).getTitle();
+    }
+    
+    public String toString(){
+        return getTitle(this);
+    }
+    
+    /**
+     * Searches in the tree for the first (and must be the unique) RemoteLayerNode with
+     * the name specified by name.
+     * @param name
+     * @return
+     */
+    public Object getNodeByName(String name) {
+    	return root.getNodeByName(name);
+    }
+    
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/LayerTreeModel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSClientExtension.java
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSClientExtension.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSClientExtension.java	(revision 1459)
@@ -0,0 +1,171 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+ 
+package org.gvsig.raster.wmts.app.wmtsclient;
+
+import java.awt.Component;
+import java.awt.geom.Point2D;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.about.AboutManager;
+import org.gvsig.about.AboutParticipant;
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.ApplicationManager;
+import org.gvsig.app.extension.AddLayer;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.raster.fmap.layers.Multiresolution;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.toc.WMTSPropsTocMenuEntry;
+import org.gvsig.raster.wmts.app.wmtsclient.gui.wizard.WMTSWizard;
+import org.gvsig.raster.wmts.app.wmtsclient.layer.DynObjectSetWMTSInfo;
+import org.gvsig.raster.wmts.app.wmtsclient.layer.FLyrWMTS;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+
+
+/**
+ * Extension for adding WMTS support to gvSIG.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSClientExtension extends Extension {
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.andami.plugins.IExtension#initialize()
+	 */
+    public void initialize() {
+    	// Adds an entry to the TOC's floating menu to those layers defined in this extension
+		ExtensionPoint exPoint = ToolsLocator.getExtensionPointManager().add("View_TocActions");
+		exPoint.append("WMTSPropsTocMenuEntry", "", new WMTSPropsTocMenuEntry());
+
+        // Adds a new tab to the "add layer" wizard for WMTS layer creation
+    	AddLayer.addWizard(WMTSWizard.class);
+
+    	//ToolsLocator.getExtensionPointManager().add("CatalogLayers").append("OGC:WMTS", "", FLyrWMTS.class);
+    	initilizeIcons();
+    	DynObjectSetWMTSInfo.registerDynClass();
+    }
+    
+    /*
+	 * (non-Javadoc)
+	 * @see org.gvsig.andami.plugins.Extension#postInitialize()
+	 */
+	public void postInitialize() {
+		FLyrWMTS.registerPersistent();
+		addAboutInfo();
+	}
+	
+	private void addAboutInfo() {
+        ApplicationManager application = ApplicationLocator.getManager();
+        
+        AboutManager about = application.getAbout();
+        about.addDeveloper("PRODEVELOP", getClass().getClassLoader()
+            .getResource("about/wmts-about.html"), 2);
+
+        AboutParticipant participant = about.getDeveloper("PRODEVELOP");
+        participant.addContribution(
+            "WMTS",
+            "Cliente para Web Map Tile Service", 
+            2011,3,1, 
+            2011,3,30
+        );      
+    }
+
+    @SuppressWarnings("deprecation")
+	public void execute(String actionCommand) {
+    	AbstractViewPanel theView = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow();
+		MapControl mapCtrl = theView.getMapControl();
+		ViewPort viewPort = mapCtrl.getViewPort();
+		
+		Multiresolution lyrMultires = null;
+		
+		FLayers lyrs = mapCtrl.getMapContext().getLayers();
+		for (int i = 0; i < lyrs.getLayersCount(); i++) {
+			FLayer lyr = lyrs.getLayer(i);
+			if(lyr instanceof FLyrWMTS) {
+				lyrMultires = ((Multiresolution)lyr);
+			}
+		}
+		
+    	if(actionCommand.compareTo("NEXT_LEVEL") == 0) {
+    		if(!lyrMultires.increaseZoomLevel()) {
+    			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), "max_zoom_reached");
+    			return;
+    		}
+    	}
+    	
+    	if(actionCommand.compareTo("PREV_LEVEL") == 0) {
+    		if(!lyrMultires.decreaseZoomLevel()) {
+    			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), "min_zoom_reached");
+    			return;
+    		}
+    	}
+    	
+    	Point2D center = new Point2D.Double(viewPort.getExtent().getCenterX(), viewPort.getExtent().getCenterY());
+		Envelope r;
+		try {
+			r = lyrMultires.getCoordsInLevel(center, lyrMultires.getZoomLevel(), 
+					viewPort.getImageWidth(), viewPort.getImageHeight());
+		} catch (CreateEnvelopeException e) {
+			return;
+		}
+		
+		mapCtrl.getViewPort().setEnvelope(r);
+		mapCtrl.invalidate();
+    }
+
+    public boolean isEnabled() {
+        return true;
+    }
+
+    public boolean isVisible() {
+    	IWindow window = PluginServices.getMDIManager().getActiveWindow();
+    	if(window instanceof AbstractViewPanel) {
+    		AbstractViewPanel theView = (AbstractViewPanel) window;
+    		MapControl mapCtrl = theView.getMapControl();
+    		FLayers lyrs = mapCtrl.getMapContext().getLayers();
+    		for (int i = 0; i < lyrs.getLayersCount(); i++) {
+    			if(lyrs.getLayer(i) instanceof FLyrWMTS)
+    				return true;
+    		}
+    	}
+        return false;
+    }
+
+
+    void initilizeIcons(){
+		IconThemeHelper.registerIcon(null, "level-plus", this);
+		IconThemeHelper.registerIcon(null, "level-less", this);
+		IconThemeHelper.registerIcon(null, "icon-layer-wmts", this);
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSClientExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/pom.xml	(revision 1459)
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.wmts.app.wmtsclient</artifactId>
+	<packaging>jar</packaging>
+	<name>Formats: WMTS support</name>
+	<description>Web Map Tile Service support</description>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.wmts.app</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+	</parent>
+	<dependencies>
+	   	<dependency>
+             <groupId>org.gvsig</groupId>
+             <artifactId>org.gvsig.about.api</artifactId>
+             <scope>compile</scope>
+        </dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.tools.app.basic</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.wmts.io</artifactId>
+            <version>2.0.0-SNAPSHOT</version>
+        </dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.remoteclient</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.app</artifactId>
+			<version>2.0-SNAPSHOT</version>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.lib.api</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.fmap</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.lib.impl</artifactId>
+			<version>2.0.0-SNAPSHOT</version>
+			<scope>compile</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <classifier>spi</classifier>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.control</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.utils</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.ui</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.symbology.lib.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.symbology.lib.impl</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.projection</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.compat</artifactId>
+            <scope>compile</scope>
+        </dependency>          
+	</dependencies>
+	<build>
+		<plugins>
+			<!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+                    <excludes>
+                        <exclude>**/TestWMTSDriver*</exclude>
+                    </excludes>
+				</configuration>
+			</plugin>		
+		</plugins>
+	</build>
+	<profiles>
+		<profile>
+			<id>gvsig-install</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+			<properties>
+				<!--
+					Default gvSIG installation folder relative to the current workspace-->
+				
+				<gvsig.install.dir>${basedir}/../../build/product</gvsig.install.dir>
+		        <package.info.dependencies>required: org.gvsig.raster.tilecache.app -ge 2, required: org.gvsig.raster.tools.app.basic -ge 2</package.info.dependencies>
+		        <package.info.baseDownloadURL>http://devel.gvsig.org/download/projects/Raster/pool/org.gvsig.raster.wmts.app.wmtsclient</package.info.baseDownloadURL>
+		        <package.info.categories>OGC,Remote Services,Raster</package.info.categories>
+			</properties>
+		</profile>
+	</profiles>
+</project>

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/distribution/distribution.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/distribution/distribution.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/distribution/distribution.xml	(revision 1459)
@@ -0,0 +1,31 @@
+<assembly>
+	<id>distribution</id>
+	<formats>
+		<format>dir</format>
+	</formats>
+	<fileSets>
+		<!-- Estructure for the extension -->
+		<fileSet>
+			<directory>src/main/resources</directory>
+			<outputDirectory>${extension.install.dir.name}
+			</outputDirectory>
+		</fileSet>
+	</fileSets>
+	<files>
+	   <file>
+          <source>package.info</source>
+          <outputDirectory>${extension.install.dir.name}</outputDirectory>
+       </file>
+    </files>
+	<dependencySets>
+		<dependencySet>
+			<outputDirectory>${extension.install.dir.name}/${library-dir}
+			</outputDirectory>
+			<includes>
+				<include>org.gvsig:org.gvsig.raster.wmts.app.wmtsclient:jar</include>
+				<include>org.gvsig:org.gvsig.raster.wmts.io:jar</include>
+				<include>org.gvsig:org.gvsig.remoteclient</include>
+			</includes>
+		</dependencySet>
+	</dependencySets>
+</assembly>

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/distribution/distribution.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/buildNumber.properties
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/buildNumber.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/buildNumber.properties	(revision 1459)
@@ -0,0 +1,3 @@
+#maven.buildNumber.plugin properties file
+#Thu Feb 07 16:38:41 CET 2013
+buildNumber=29

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient
___________________________________________________________________
Added: svn:ignore
   + .settings
target
.classpath
.project
package.info



Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app
___________________________________________________________________
Added: svn:ignore
   + target
.settings
.project


Index: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/distribution/distribution.xml
===================================================================
--- org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/distribution/distribution.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/distribution/distribution.xml	(revision 1459)
@@ -0,0 +1,2 @@
+<assembly>
+</assembly>
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts/distribution/distribution.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.wmts/tags/buildNumber_29/org.gvsig.raster.wmts
___________________________________________________________________
Added: svn:ignore
   + target
.project
build
.settings


