Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/pom.xml	(revision 6892)
@@ -0,0 +1,110 @@
+<?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>
+	
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.wmts</artifactId>
+		<version>2.2.43</version>
+	</parent>
+	
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.cache.lib.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.lib.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.lib.impl</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.raster.wmts.ogc.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.wmts.ogc.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        
+        
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.impl</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.file.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.projection.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.projection.cresques.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    <!--
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.operation</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+    -->
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.compat.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.compat.se</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	</dependencies>
+</project>

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/README.txt
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/README.txt	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/README.txt	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/README.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/log4j.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/log4j.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/log4j.xml	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/log4j.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 6892)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.io.DefaultWMTSIOLibrary
Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/TemplateRasterProvider.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/TemplateRasterProvider.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/TemplateRasterProvider.java	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/resources/TemplateRasterProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 6892)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.io.DefaultWMTSIOLibrary
Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/TileDownloaderForWMTS.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/TileDownloaderForWMTS.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/TileDownloaderForWMTS.java	(revision 6892)
@@ -0,0 +1,121 @@
+/* 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.compat.net.ICancellable;
+import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+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.WMTSDataParameters;
+import org.gvsig.raster.wmts.ogc.WMTSClient;
+import org.gvsig.raster.wmts.ogc.WMTSOGCLocator;
+import org.gvsig.raster.wmts.ogc.WMTSStatus;
+import org.gvsig.raster.wmts.ogc.exception.ServerErrorException;
+import org.gvsig.raster.wmts.ogc.exception.WMTSException;
+
+/**
+ * Tile getter
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TileDownloaderForWMTS extends BaseTileDownloader {
+	private WMTSClient             ogcClient  = null;
+
+	public TileDownloaderForWMTS(RasterDataStore store,
+			int tilePxWidth,
+			int tilePxHeight) {
+		super(store, tilePxWidth, tilePxHeight);
+	}
+
+	/**
+	 * Gets the connector from the URL
+	 * @return
+	 * @throws RemoteServiceException
+	 */
+	public WMTSClient getOGCClient() throws WMTSException {
+		if(ogcClient == null) {
+			WMTSDataParameters p = (WMTSDataParameters)store.getParameters();
+			ogcClient = p.getOGCClient();
+			if(ogcClient != null)
+				return ogcClient;
+
+			URL url = null;
+			try {
+				url = p.getURI().toURL();
+			} catch (Exception e) {
+				throw new WMTSException("Malformed URL",e);
+			}
+			try {
+				ogcClient = WMTSOGCLocator.getManager().createWMTSClient(url.toString());
+				ogcClient.connect(false, new ICancellable() {
+					public boolean isCanceled() {
+						return false;
+					}
+
+					public Object getID() {
+						return null;
+					}
+				});
+			} catch (ConnectException e) {
+				throw new WMTSException("Connect exception",e);
+			} catch (IOException e) {
+				throw new WMTSException("Connect exception",e);
+			}
+		}
+		return ogcClient;
+	}
+
+	public synchronized Tile downloadTile(Tile tile) throws TileGettingException {
+		try {
+			WMTSStatus status = (WMTSStatus)tile.getDownloaderParams("WMTSStatus");
+			status.setTileRow(tile.getRow());
+			status.setTileCol(tile.getCol());
+
+			String urlFromTemplate = status.getResourceURL(tile.getRow() + "" + tile.getCol() + "");
+			//System.out.println(urlFromTemplate);
+			File f = null;
+			if(urlFromTemplate != null)
+				f = getOGCClient().getTile(urlFromTemplate, tile.getCancelled(), tile.getFile());
+			else
+				f = getOGCClient().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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSTileServer.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSTileServer.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSTileServer.java	(revision 6892)
@@ -0,0 +1,54 @@
+package org.gvsig.raster.wmts.io.downloader;
+
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+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.ogc.struct.WMTSTileMatrix;
+import org.gvsig.raster.wmts.ogc.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 RasterDataStore            store                = null;
+	private String                     suffix               = ".tif";
+	private WMTSTileMatrixSetLink      tileMatrixSetLink    = null;
+	
+	public WMTSTileServer(RasterDataStore store, 
+			WMTSTileMatrixSetLink tileMatrixSetLink) {
+		this.store = store;
+		this.tileMatrixSetLink = tileMatrixSetLink;
+	}
+	
+	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(store, tileWidth, tileHeight);
+		//}
+		return downloader;
+	}
+
+	public CacheStruct getStruct() {
+		if(struct == null) {
+			struct = new WMTSCacheStruct(store, tileMatrixSetLink);
+		}
+		return struct;
+	}
+	
+	public void setStruct(CacheStruct struct) {
+		//La structura de cache es proporcionada por el servidor
+	}
+	
+	public String getFileSuffix() {
+		return suffix;
+	}
+	
+	public void setFileSuffix(String extension) {
+		this.suffix = extension;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSCacheStruct.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSCacheStruct.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSCacheStruct.java	(revision 6892)
@@ -0,0 +1,273 @@
+/* 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.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+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.raster.wmts.ogc.WMTSStatus;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrix;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixLimits;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSet;
+import org.gvsig.raster.wmts.ogc.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 List<WMTSTileMatrixLimits>    tileMatrixSetLimits = null;
+	private double[]                      pixelSize           = null;
+    private RasterDataStore               store               = null;
+
+    public WMTSCacheStruct(RasterDataStore store, WMTSTileMatrixSetLink tileMatrixSetLink) {
+    	this.store = store;
+    	this.tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		this.tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits();
+		pixelSize = ((WMTSProvider)store.getProvider()).getPixelSizeByLevel();
+		serverURL = ((WMTSProvider)store.getProvider()).getURIOfFirstProvider().getPath();
+		layerName = ((WMTSDataParameters)store.getParameters()).getLayer().getTitle();
+    }
+
+	public int getNumberOfLevels() {
+		return tileMatrixSet.getTileMatrix().size();
+	}
+
+	public String getLayerName() {
+		return layerName;
+	}
+
+	public String getServerURL() {
+		return serverURL + getDimension();
+	}
+
+	public int[] getTileSizeByLevel(int level) {
+		return new int[] {
+			((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getTileWidth(),
+			((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getTileHeight()
+		};
+	}
+
+	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();
+		}
+	}
+
+	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();
+		}
+	}
+
+	public int getLayerInitXTilePositionByLevel(int level) {
+		if(tileMatrixSetLimits != null && tileMatrixSetLimits.size() > level) {
+			WMTSTileMatrixLimits l = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level);
+			return l.getMinTileCol();
+		} else
+			return 0;
+	}
+
+	public int getLayerInitYTilePositionByLevel(int level) {
+		if(tileMatrixSetLimits != null && tileMatrixSetLimits.size() > level) {
+			WMTSTileMatrixLimits l = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level);
+			return l.getMinTileRow();
+		} else
+			return 0;
+	}
+
+	public long getWorldHeightOfTileMatrixByLevel(int level) {
+		return ((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getMatrixWidth();
+	}
+
+	public long getWorldWidthOfTileMatrixByLevel(int level) {
+		return ((WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level)).getMatrixHeight();
+	}
+
+	public double getPixelSizeByLevel(int level) {
+		if(level < pixelSize.length)
+			return pixelSize[level];
+		else
+			return pixelSize[pixelSize.length - 1];
+	}
+
+	public Point2D[] getTileExtent(Tile tile) {
+		return getTileExtent(tile.getLevel(), tile.getCol(), tile.getRow());
+	}
+
+	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)};
+	}
+
+	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 = ((WMTSProvider)store.getProvider()).buildWMTSStatus(r, bufWidth, bufHeight);
+			tile.setDownloaderParams("WMTSStatus", status);
+		} catch (RasterDriverException e) {
+			throw new TileBuildException(e);
+		}
+
+		return tile;
+	}
+
+	public List<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 = ((WMTSProvider)store.getProvider()).buildWMTSStatus(r, bufWidth, bufHeight);
+
+			//Conversi�n a tiles de la librer�a
+			List<WMTSTile> tiles = status.getTileList();
+			List<Tile> tileList = new ArrayList<Tile>();
+			for (int i = 0; i < tiles.size(); i++) {
+				WMTSTile tOrigin = (WMTSTile) tiles.get(i);
+				Tile t = TileCacheLocator.getManager().createTile(status.getLevel(), tOrigin.getCol(), tOrigin.getRow());
+				t.setUl(new Point2D.Double(tOrigin.getULX(), tOrigin.getULY()));
+				t.setLr(new Point2D.Double(tOrigin.getLRX(), tOrigin.getLRY()));
+				t.setWidthPx(tOrigin.getWidthPx());
+				t.setHeightPx(tOrigin.getHeightPx());
+				t.setDownloaderParams("WMTSStatus", status.cloneStatus());
+				tileList.add(t);
+			}
+			return tileList;
+		} catch (RasterDriverException e) {
+			throw new TileBuildException(e);
+		}
+	}
+
+	public double[] getTileSizeInRealCoordsByLevel(int level) {
+		return new double[] {
+				getPixelSizeByLevel(level) * getTileSizeByLevel(level)[0],
+				getPixelSizeByLevel(level) *  getTileSizeByLevel(level)[1]
+			};
+	}
+
+	public String getFileSuffix() {
+		return ((WMTSProvider)store.getProvider()).getFileSuffix();
+	}
+
+	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());
+	}
+
+	public String getEPSG() {
+		/*IProjection proj = provider.getProjection();
+		if(proj != null)
+			return proj.getAbrev();
+		return null;*/
+		return ((WMTSProvider)store.getProvider()).getSRSCode();
+	}
+
+	private String getDimension() {
+		WMTSDataParameters p = (WMTSDataParameters)(((WMTSProvider)store.getProvider()).getDataParameters());
+		String dimension = p.getDimension();
+		String dimensionValue = p.getDimensionSelectedValue();
+		if(dimension != null && dimensionValue != null)
+			return dimension + "_" + dimensionValue;
+		return "";
+	}
+
+	public String getFileSize() {
+		return "0";
+	}
+
+	public List<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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/package.html
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/package.html	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/package.html	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorer.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorer.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorer.java	(revision 6892)
@@ -0,0 +1,228 @@
+/* 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.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataServerExplorerParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.NewDataStoreParameters;
+import org.gvsig.fmap.dal.coverage.exception.ConnectException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataServerExplorer;
+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.AbstractDataServerExplorer;
+import org.gvsig.fmap.dal.spi.DataServerExplorerProvider;
+import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices;
+import org.gvsig.raster.wmts.ogc.WMTSClient;
+import org.gvsig.raster.wmts.ogc.WMTSOGCLocator;
+
+/**
+ * Explorer for a WMTS server
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSServerExplorer extends AbstractDataServerExplorer implements RasterDataServerExplorer, DataServerExplorerProvider {
+	public static final String           NAME                     = WMTSProvider.NAME;
+	private WMTSClient                   ogcClient                = null;
+//	private WMTSServerExplorerParameters parameters               = null;
+	private static final Logger         logger                    = LoggerFactory.getLogger(WMTSServerExplorer.class);
+
+	public WMTSServerExplorer(
+			WMTSServerExplorerParameters parameters,
+			DataServerExplorerProviderServices services)
+			throws InitializeException {
+                super(parameters, services);
+//		this.parameters = parameters;
+	}
+
+	public String getDataStoreProviderName() {
+		return WMTSProvider.NAME;
+	}
+
+	public String getDescription() {
+		return WMTSProvider.DESCRIPTION;
+	}
+
+	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;
+	}
+
+	public List<?> getDataStoreProviderNames() {
+		return null;
+	}
+
+	public WMTSServerExplorerParameters getParameters() {
+		return (WMTSServerExplorerParameters) super.getParameters();
+	}
+
+	public List<?> list() throws DataException {
+		return null;
+	}
+
+	public List<?> list(int mode) throws DataException {
+		return null;
+	}
+
+	public void remove(DataStoreParameters parameters) throws DataException {
+
+	}
+
+	public String getProviderName() {
+		return WMTSProvider.NAME;
+	}
+
+	//**********************************************
+	//Connector
+	//**********************************************
+
+	public DataStoreParameters getStoredParameters() {
+		DataManager manager = DALLocator.getDataManager();
+		WMTSDataParameters wmtsParams = null;
+		try {
+			wmtsParams = (WMTSDataParameters) manager.createStoreParameters(this.getDataStoreProviderName());
+			String host = getParameters().getHost();
+            try {
+                wmtsParams.setURI(new URI(host));
+            } catch (URISyntaxException e) {
+                logger.warn("Can't create URI from "+host, e);
+            }
+			wmtsParams.setOGCClient(getOGCClient());
+
+			if(WMTSProvider.TILED) {
+				TileDataParameters tileParams = (TileDataParameters) manager.createStoreParameters("Tile Store");
+				tileParams.setDataParameters(wmtsParams);
+				return tileParams;
+			}
+		} catch (InitializeException e) {
+            logger.warn("Can't get DataStoreParameters from WMTSServerExplorer", e);
+		} catch (ProviderNotRegisteredException e) {
+            logger.warn("Can't get DataStoreParameters from WMTSServerExplorer", e);
+		}
+		return wmtsParams;
+	}
+
+	public void connect(ICancellable cancellable) throws ConnectException {
+		URL url = null;
+		boolean override = false;
+
+		try {
+			url = new URL(getParameters().getHost());
+		} catch (Exception e) {
+			throw new ConnectException("Malformed URL",e);
+		}
+        try {
+        	ogcClient = WMTSOGCLocator.getManager().createWMTSClient(url.toString());
+        	ogcClient.setForceChangeAxisOrder(getParameters().isLongitudeFirst());
+        	if (!ogcClient.connect(override, cancellable))
+        		throw new ConnectException("Error connecting");
+        } catch (IOException e) {
+			throw new ConnectException(e.getMessage(), e);
+		}
+	}
+
+	public boolean isHostReachable(int timeout) {
+		URL url = null;
+		URLConnection con = null;
+		try {
+			url = new URL(getParameters().getHost());
+			con = url.openConnection();
+			if(con == null)
+				return false;
+			con.connect();
+		} catch (MalformedURLException e) {
+			return false;
+		} catch (IOException e) {
+			return false;
+		}
+
+		InputStream stream = null;
+		try {
+			stream = con.getInputStream();
+			if(stream == null)
+				return false;
+		} catch (IOException e) {
+		}
+
+		return true;
+	}
+
+	/**
+	 * Checks if the network and host are reachable
+	 * @return true if both are reachable and false if they are not
+	 */
+	public boolean isHostReachable() {
+		return isHostReachable(RasterDataServerExplorer.TIME);
+	}
+
+	public boolean isConnected() {
+		if(ogcClient != null)
+			return true;
+		return false;
+	}
+
+	public WMTSClient getOGCClient() {
+		return ogcClient;
+	}
+
+	public String getHost() {
+		return getParameters().getHost();
+	}
+
+	public DataServerExplorerProviderServices getServerExplorerProviderServices() {
+		return null;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSProvider.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSProvider.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSProvider.java	(revision 6892)
@@ -0,0 +1,1459 @@
+/* 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.Image;
+import java.awt.Rectangle;
+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.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+
+import javax.swing.ImageIcon;
+
+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.datastruct.NoData;
+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.InvalidSourceException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+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.CloseException;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.OpenException;
+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.buffer.SpiRasterQuery;
+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.AbstractRasterProvider;
+import org.gvsig.raster.impl.provider.MemoryTileMatrixBuffer;
+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.DefaultRasterStore;
+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.raster.wmts.ogc.WMTSClient;
+import org.gvsig.raster.wmts.ogc.WMTSOGCLocator;
+import org.gvsig.raster.wmts.ogc.WMTSStatus;
+import org.gvsig.raster.wmts.ogc.exception.DownloadException;
+import org.gvsig.raster.wmts.ogc.exception.ServerErrorException;
+import org.gvsig.raster.wmts.ogc.exception.WMTSException;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrix;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixLimits;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSet;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSetLink;
+import org.gvsig.tools.ToolsLocator;
+
+import org.apache.commons.io.FilenameUtils;
+import org.cresques.cts.IProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * Provider for WMTS service
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSProvider extends AbstractRasterProvider 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 WMTSClient                  ogcClient                = 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 List<WMTSTile>         tiles          = null;
+		private WMTSStatus             status         = null;
+
+		public RequestThreadManager(TilePipe pipe, List<WMTSTile> tiles, WMTSStatus status) {
+			this.pipe = pipe;
+			this.tiles = tiles;
+			this.status = status;
+		}
+
+		public void run() {
+			for (int i = 0; i < tiles.size(); i++) {
+				WMTSTile tile = tiles.get(i);
+				WMTSStatus statusCopy = status.cloneStatus();
+				statusCopy.setTileRow(tile.getRow());
+				statusCopy.setTileCol(tile.getCol());
+				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 WMTSTile      tile    = null;
+
+		public RequestTileLauncher(TilePipe pipe, WMTSStatus status, WMTSTile tile) {
+			this.pipe = pipe;
+			this.status = status;
+			this.tile = tile;
+		}
+
+		public void run() {
+			try {
+				//File file = getConnector().getTile(status, null);
+				URL url = getOGCClient().getTileURL(status);
+				tile.setFile(getOGCClient().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
+	 * @throws OpenException
+     * @deprecated use {@link #WMTSProvider(URI)}, this constructor will be removed in gvSIG 2.5
+	 */
+	public WMTSProvider(String params) throws NotSupportedExtensionException, OpenException {
+		super(params);
+        logger.info("Deprecated use of WMTSProvider constructor");
+		if(params instanceof String) {
+			WMTSDataParameters p = new WMTSDataParametersImpl();
+            try {
+                p.setURI(new URI((String) params));
+            } catch (URISyntaxException e) {
+                throw new OpenException("Can't create URI from" + (String) params, e);
+            }
+			super.init(p, null, ToolsLocator.getDynObjectManager()
+					.createDynObject(
+							MetadataLocator.getMetadataManager().getDefinition(
+									DataStore.METADATA_DEFINITION_NAME)));
+			init(p, null);
+		}
+	}
+
+	 /**
+     * Constructor. Abre el dataset.
+     * @param uri URI del fichero
+     * @throws NotSupportedExtensionException
+     */
+    public WMTSProvider(URI uri) throws NotSupportedExtensionException {
+        super(uri);
+        WMTSDataParameters p = new WMTSDataParametersImpl();
+        p.setURI(uri);
+        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 WMTSClient getOGCClient() throws WMTSException {
+		if(ogcClient == null) {
+			WMTSDataParameters p = (WMTSDataParameters)parameters;
+			ogcClient = p.getOGCClient();
+			if(ogcClient != null)
+				return ogcClient;
+
+			URL url = null;
+			try {
+				url = p.getURI().toURL();
+			} catch (Exception e) {
+				throw new WMTSException("Malformed URL",e);
+			}
+			try {
+				ogcClient = WMTSOGCLocator.getManager().createWMTSClient(url.toString());
+				ogcClient.connect(true, new ICancellable() {
+
+					public boolean isCanceled() {
+						return false;
+					}
+
+					public Object getID() {
+						return null;
+					}
+				});
+			} catch (ConnectException e) {
+				throw new WMTSException("Connect exception",e);
+			} catch (IOException e) {
+				throw new WMTSException("Connect exception",e);
+			}
+		}
+		return ogcClient;
+	}
+
+	/**
+	 * 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
+	 */
+	private boolean hasGridSubsets(WMTSDataParameters p) {
+		List<WMTSTileMatrixLimits> tileMatrixSetLimits = null;
+		List<WMTSTileMatrixSetLink> 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();
+			List<WMTSTileMatrixLimits> tmsl = tileMatrixSetLink.getTileMatrixLimits();
+			String srsTileSet = tms.getSupportedCRS();
+			if(areSrsEquals(srsTileSet, srs)) {
+				tileMatrixSetLimits = tmsl;
+			}
+		}
+
+		return (tileMatrixSetLimits == null || tileMatrixSetLimits.size() <= 0) ? false : true;
+	}
+
+	private boolean areSrsEquals(String sourceSrs, String appSrs) {
+		if(sourceSrs.compareTo(appSrs) == 0)
+			return true;
+		if(sourceSrs.contains("CRS:84") || sourceSrs.contains("CRS84")) {
+			if(appSrs.equals("EPSG:4326"))
+				return true;
+		}
+		return false;
+	}
+
+	/*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(getBandCount());
+
+			if(getBandCount() == 1)
+				colorInterpretation = DataStoreColorInterpretation.createGrayInterpretation();
+
+			if(getBandCount() == 3)
+				colorInterpretation = DataStoreColorInterpretation.createRGBInterpretation();
+
+			if(getBandCount() == 4)
+				colorInterpretation = DataStoreColorInterpretation.createRGBAInterpretation();
+
+			if(getBandCount() > 4 || getBandCount() == 2) {
+				for (int i = 0; i < getBandCount(); i++) {
+					colorInterpretation.setColorInterpValue(i, DataStoreColorInterpretation.UNDEF_BAND);
+				}
+			}
+			setColorInterpretation(colorInterpretation);
+		}
+		return super.getColorInterpretation();
+	}
+
+	public boolean isTiled() {
+		return true;
+	}
+
+	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;
+	}
+
+	/**
+	 * <p>
+	 * Gets the bounding box in world coordinates.
+	 * If the layer has defined the BoundingBox tag, we will take this bounding box as entire
+	 * extension of this layer, else we'll see if the tag WGS84BoundingBox is defined (it can be approximated).
+	 * In this case we'll take WGS84BoundingBox as entire extension.
+	 * </p>
+	 * <br>
+	 * Note:
+	 * <br>
+	 * <p>
+	 * 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.
+	 * </p>
+	 * @return Extent
+	 */
+	public Extent getExtent() {
+		WMTSDataParameters p = (WMTSDataParameters)parameters;
+		WMTSLayer layer = p.getLayer();
+
+		if(layer.getBBox() != null)
+			return new ExtentImpl(layer.getBBox().toRectangle2D());
+
+		if(layer.getWGS84BBox() != null) {
+			String crsCode = p.getSRSCode();
+			Rectangle2D r = layer.getWGS84BBoxTransformed(crsCode);
+			if(r != null)
+				return new ExtentImpl(r);
+		}
+
+		if(bbox == null)
+			getExtentByResolutionLevel();
+		return bbox;
+
+		/*if(gridSubsets) {
+			WMTSBoundingBox bbox = layer.getWGS84BBox();
+			return new ExtentImpl(bbox.toRectangle2D());
+		} else {
+			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;
+			List<WMTSTileMatrix> 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.getTileHeight() * 0.28) / (MTS_X_GRADO * 1000);
+		    	} else {
+		    		widthMtsTile = (tileMatrix.getScaleDenominator() * tileMatrix.getTileWidth() * 0.28) / 1000;
+		    		heightMtsTile = (tileMatrix.getScaleDenominator() * tileMatrix.getTileHeight() * 0.28) / 1000;
+		    	}
+
+		    	//TODO: Revisar!!! Creo que el top left sale al rev�s en el de la nasa
+
+		    	double h = Math.abs(tileMatrix.getTopLeftCorner()[1] - (tileMatrix.getTopLeftCorner()[1] - (tileMatrix.getMatrixHeight() * heightMtsTile)));
+		    	Rectangle2D r = new Rectangle2D.Double(
+		    			tileMatrix.getTopLeftCorner()[0],
+		    			tileMatrix.getTopLeftCorner()[1] - h,
+		    			Math.abs(tileMatrix.getTopLeftCorner()[0] - (tileMatrix.getTopLeftCorner()[0] + (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;
+	}
+
+	public Rectangle2D getLayerExtent(String layerName, String srs) throws RemoteServiceException {
+		return null;
+	}
+
+	public RasterProvider load() {
+		return this;
+	}
+
+	public boolean isOpen() {
+		return open;
+	}
+
+	public void close() {
+		open = false;
+	}
+
+	public Transparency getTransparency() {
+		if(lastFileTransparency == null) {
+			lastFileTransparency = new DataStoreTransparency(getColorInterpretation());
+			lastFileTransparency.setTransparencyBand(3);
+		}
+		return lastFileTransparency;
+	}
+
+	public NoData getNoDataValue() {
+		NoData nodata = super.getNoDataValue();
+		if(nodata != null)
+			nodata.setNoDataTransparent(false);
+		return noData;
+	}
+
+	public URI translateURI(URI uri) {
+		return uri;
+	}
+
+	public void setView(Extent e) {
+		viewRequest = e;
+	}
+
+	public Extent getView() {
+		return viewRequest;
+	}
+
+	public double getWidth() {
+		WMTSDataParameters p = (WMTSDataParameters)parameters;
+		if (lastWidthRequest <= 0)
+			return p.getWidth();
+		return lastWidthRequest;
+	}
+
+	public double getHeight() {
+		WMTSDataParameters p = (WMTSDataParameters)parameters;
+		if (lastHeightRequest <= 0)
+			return p.getHeight();
+		return lastHeightRequest;
+	}
+
+	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;
+	}
+
+	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
+	 */
+	private WMTSTileMatrix getTileMatrixByLevel(int level) {
+		level = adjustLevel(level);
+
+		WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+		WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		List<WMTSTileMatrixLimits> 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
+	 */
+	public int getZoomLevels() {
+		WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+		WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		if(hasGridSubsets()) {
+			List<WMTSTileMatrixLimits> tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits();
+			return Math.min(tileMatrixSet.getTileMatrix().size(), tileMatrixSetLimits.size());
+		}
+		return tileMatrixSet.getTileMatrix().size();
+
+	}
+
+	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);
+	}
+
+	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;
+	}
+
+	public org.gvsig.raster.cache.tile.Tile getTile(SpiRasterQuery 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();
+		List<WMTSTileMatrixLimits> 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 {
+			Extent adjBbox = q.getAdjustedRequestBoundingBox();
+			Rectangle2D r = adjBbox.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());
+			WMTSTile tile = WMTSOGCLocator.getManager().createTile(
+					size,
+					new int[]{q.getTileRow(), q.getTileCol()},
+					new double[]{adjBbox.getULX(), adjBbox.getULY(), adjBbox.getLRX(), adjBbox.getLRY()});
+
+			File file = getOGCClient().getTile(status, null);
+			tile.setFile(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().getPath(), i, getDataType()[i], getBandCount());
+					bandList.addBand(band);
+				} 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);
+		}
+	}
+
+	@Override
+	public void loadBuffer(SpiRasterQuery q)
+			throws ProcessInterruptedException, RasterDriverException {
+		Rectangle2D r = q.getAdjustedRequestBoundingBox().toRectangle2D();//new Rectangle2D.Double(Math.min(minX, maxX), Math.min(minY, maxY), Math.abs(maxX - minX), Math.abs(maxY - minY));
+		WMTSStatus status = buildWMTSStatus(r, q.getAdjustedWidth(), q.getAdjustedBufHeight());
+		request(status, q.getBandList(), q.getTileListener(), requestType);
+		org.gvsig.raster.cache.tile.Tile[] tileList = request(status, q.getBandList(), null, requestType);
+		MemoryTileMatrixBuffer matrixBuffer = new MemoryTileMatrixBuffer(tileList);
+		Buffer b = matrixBuffer.getWindow(q.getAdjustedRequestBoundingBox(), q.getBufWidth(), q.getBufHeight(), q.getBandList().getDrawableBandsCount());
+		q.setBufferResult(b);
+	}
+
+	/**
+	 * 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);
+
+		WMTSClient ogcClient = null;
+		try {
+			ogcClient = getOGCClient();
+			lastStatus.setTileRow((int)pointInfo.tile.getX());
+			lastStatus.setTileCol((int)pointInfo.tile.getY());
+
+			String fi = ogcClient.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);
+		}
+	}
+
+	/**
+	 * 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
+	 */
+	private void getTileInfo(PointInfo pointInfo) {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+
+		WMTSTileMatrixSetLink tileMatrixSetLink = getTileMatrixSetLink();
+		WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
+		List<WMTSTileMatrixLimits> 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();
+		}
+
+		List<WMTSTile> 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).getRow(), tiles.get(0).getCol());
+
+		//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
+	 */
+	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();
+		List<WMTSTileMatrixLimits> 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
+		List<WMTSTile> 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 = null;
+		try {
+			status = getOGCClient().createStatus();
+		} catch (WMTSException e) {
+			throw new RasterDriverException("Error creating WMTSStatus", e);
+		}
+		WMTSLayer wmtsLayer = p.getLayer();
+		status.setTileList(tiles);
+		status.setLayer(wmtsLayer.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);
+		status.setDimension(p.getDimension());
+		status.setValueForDimension(p.getDimensionSelectedValue());
+
+		wmtsLayer.buildResourceURLListFromTemplate(status);
+		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;
+		List<WMTSTileMatrixSetLink> 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
+	 */
+	private synchronized org.gvsig.raster.cache.tile.Tile[] request(
+			WMTSStatus status, BandList bandList, TileListener listener, int requestType) throws RasterDriverException, ProcessInterruptedException {
+		//WMTSDataParameters p = (WMTSDataParameters)param;
+		WMTSClient ogcClient = null;
+		try {
+			ogcClient = getOGCClient();
+		} catch (WMTSException e) {
+			throw new RasterDriverException("Error getting the connector object", e);
+		}
+
+		if(ogcClient == null)
+			throw new RasterDriverException("Error getting the connector object");
+
+		List<WMTSTile> 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++) {
+				WMTSTile tile = tiles.get(i);
+				WMTSStatus statusCopy = status.cloneStatus();
+				statusCopy.setTileRow(tile.getRow());
+				statusCopy.setTileCol(tile.getCol());
+				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()) {
+				WMTSTile tile = pipe.getTile();
+				tileList[nCollected] = drawTile(tile, listener, bandList);
+				nCollected ++;
+			}
+		}
+
+		if(requestType == SEQUENTIAL) {
+			for (int i = 0; i < tiles.size(); i++) {
+				WMTSTile tile = tiles.get(i);
+				status.setTileRow(tile.getRow());
+				status.setTileCol(tile.getCol());
+				//TODO:Cancelaci�n
+				try {
+					File file = ogcClient.getTile(status, null);
+					tile.setFile(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(WMTSTile tile, TileListener listener, BandList bandList) throws RasterDriverException {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		try {
+			AbstractRasterProvider driver = DefaultProviderServices.loadProvider(tile.getFile());
+			colorTable = driver.getColorTable();
+			bandCount = driver.getBandCount();
+			lastFileTransparency = (DataStoreTransparency)driver.getTransparency();
+
+			RasterQuery q = RasterLocator.getManager().createQuery();
+			q.setAreaOfInterest(new Rectangle(0, 0, tile.getWidthPx(), tile.getHeightPx()));
+			int[] drawableBands = bandList.getDrawableBands();
+			if(drawableBands.length > 3)
+				drawableBands = new int[]{drawableBands[0], drawableBands[1], drawableBands[2]};
+			q.setDrawableBands(bandList.getDrawableBands());
+			RasterDataStore store = new DefaultRasterStore();
+			store.setProvider(driver);
+			Buffer buf = store.query(q);
+
+			buf.setDataExtent(new Rectangle2D.Double(
+					Math.min(tile.getULX(), tile.getLRX()),
+					Math.min(tile.getULY(), tile.getLRY()),
+					Math.abs(tile.getULX() - tile.getLRX()),
+					Math.abs(tile.getULY() - tile.getLRY())));
+
+			Buffer alphaBand = null;
+			if(p.getAlphaBand() != -1 && listener != null && p.getAlphaBand() < bandCount) {
+				q = RasterLocator.getManager().createQuery();
+				q.setAreaOfInterest(new Rectangle(0, 0, tile.getWidthPx(), tile.getHeightPx()));
+				q.setDrawableBands(new int[]{p.getAlphaBand()});
+				alphaBand = store.query(q);
+			}
+
+			try {
+				store.close();
+			} catch (CloseException e) {
+				logger.info("I cannot close the DataStore", e);
+			}
+
+
+			TileCacheManager m = TileCacheLocator.getManager();
+			org.gvsig.raster.cache.tile.Tile t = m.createTile(-1, tile.getRow(), tile.getCol());
+			t.setData(new Object[]{buf, alphaBand});
+			t.setUl(new Point2D.Double(tile.getULX(), tile.getULY()));
+			t.setLr(new Point2D.Double(tile.getLRX(), tile.getLRY()));
+			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);
+		} catch (QueryException e) {
+			throw new RasterDriverException("Error throwing a tile", e);
+		}
+		return null;
+	}
+
+	public Image getImageLegend() {
+		try {
+			File file = getOGCClient().getLegendGraphic(
+					((WMTSDataParameters)param).getLayer(),
+					((WMTSDataParameters)param).getStyle(),
+					new ICancellable() {
+						public boolean isCanceled() {
+							return false;
+						}
+
+						public Object getID() {
+							return null;
+						}
+					});
+			Image img = null;
+			if ((file != null) && (file.length() > 0)) {
+				img = new ImageIcon(file.getAbsolutePath()).getImage();
+			}
+			return img;
+		} catch (Exception e) {
+			logger.info("Problems in GetLegendGraphic", e);
+		}
+		return null;
+	}
+
+	public int getBlockSize() {
+		return 0;
+	}
+
+	public void setAffineTransform(AffineTransform t){
+
+	}
+
+	public int getOverviewCount(int band) throws BandAccessException, RasterDriverException {
+		return 0;
+	}
+
+	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException {
+		return 0;
+	}
+
+	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException {
+		return 0;
+	}
+
+	public boolean isOverviewsSupported() {
+		return false;
+	}
+
+	public boolean isReproyectable() {
+		return false;
+	}
+
+	public String getProviderName() {
+		return NAME;
+	}
+
+        public String getName() {
+            return this.getParameters().getLayer().getTitle();
+        }
+
+        public WMTSDataParameters getParameters() {
+		return (WMTSDataParameters)this.param;
+	}
+
+	/**
+	 * 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;
+	}
+
+	public void setStatus(RasterProvider provider) {
+		if(provider instanceof WMTSProvider) {
+		}
+	}
+
+	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);
+		}
+	}
+
+	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;
+	}
+
+	public TileServer getTileServer() {
+		if(tileServer == null) {
+			DefaultRasterStore store = new DefaultRasterStore();
+			store.setProvider(this);
+			tileServer = new WMTSTileServer(store, getTileMatrixSetLink());
+		}
+		return tileServer;
+	}
+
+	public int[] getTileSize(int level) {
+		return getTileServer().getStruct().getTileSizeByLevel(level);
+	}
+
+	public boolean isRasterEnclosed() {
+		return true;
+	}
+
+	public Buffer getBufferLastRequest() throws ProcessInterruptedException, RasterDriverException {
+		return null;
+	}
+
+	/**
+	 * Gets the srs code
+	 * @return
+	 */
+	public String getSRSCode() {
+		WMTSDataParameters p = (WMTSDataParameters)param;
+		return p.getSRSCode();
+	}
+
+	public RasterProvider getInternalProvider() {
+		return this;
+	}
+
+	public HistogramComputer getHistogramComputer() {
+		if (histogram == null)
+			histogram = new RemoteStoreHistogram(this);
+		return histogram;
+	}
+
+    /* (non-Javadoc)
+     * @see org.gvsig.raster.impl.provider.RasterProvider#addFile(java.io.File)
+     */
+    @Override
+    public void addFile(File file) throws InvalidSourceException {
+        // Do nothing
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.gvsig.raster.impl.provider.RasterProvider#removeFile(java.io.File)
+     */
+    @Override
+    public void removeFile(File file) {
+        // Do nothing
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.gvsig.raster.impl.provider.AbstractRasterProvider#getProjection()
+     */
+    @Override
+    public IProjection getProjection() {
+        if(proj==null){
+            proj = ((WMTSDataParameters)param).getSRS();
+        }
+        return proj;
+    }
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorerParameters.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorerParameters.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSServerExplorerParameters.java	(revision 6892)
@@ -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.
+*
+*/
+
+/*
+* 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.raster.impl.store.AbstractRasterDataParameters;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DelegatedDynObject;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.PersistenceManager;
+
+/**
+ * Parameters for the WMTS provider
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSServerExplorerParameters extends AbstractDataParameters implements DataServerExplorerParameters {
+	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(
+						registerDynClass());
+	}
+	
+	public static DynStruct registerDynClass() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition("WMTSServerExplorerParameters_Persistent");
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					WMTSDataParametersImpl.class,
+					"WMTSServerExplorerParameters_Persistent",
+					"WMTS Explorer DataParameters Persistency",
+					null, 
+					null
+			);
+		}
+
+		AbstractRasterDataParameters.registerDynClass(definition);
+
+		definition.addDynFieldBoolean(AXIS_ORDER)
+		.setDescription("Longitude first in axis order")
+		.setMandatory(false);
+
+		definition.addDynFieldString(FIELD_HOST)
+		.setDescription("Uniform Resource Identifier (File name or URL)")
+		.setMandatory(false);		
+		return definition;
+	}
+	
+	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);
+	}
+
+	public void setHost(String host) {
+		this.setDynValue(FIELD_HOST, host);
+	}
+
+	public String getDataStoreName() {
+		return WMTSProvider.NAME;
+	}
+	
+	public String getDescription() {
+		return WMTSProvider.DESCRIPTION;
+	}
+	
+	public String getExplorerName() {
+		return WMTSServerExplorer.NAME;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParameters.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParameters.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParameters.java	(revision 6892)
@@ -0,0 +1,218 @@
+/* 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 java.net.URI;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters;
+import org.gvsig.raster.wmts.ogc.WMTSClient;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.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_IMAGE_FORMAT    = "imageformat";
+	public static final String      FIELD_INFO_FORMAT     = "infoformat";
+	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_WIDTH           = "width";
+	public static final String      FIELD_HEIGHT          = "height";
+	public static final String      FIELD_DELETECACHE     = "deletecache";
+	public static final String      FIELD_STYLE_NAME      = "style";
+	public static final String      FIELD_EXTENT          = "extent";
+	public static final String      FIELD_DIMENSION       = "dimension";
+	public static final String      FIELD_DIMENSION_VALUE = "selected_dimension_value";
+
+	/**
+	 * Gets the selected dimension
+	 * @return
+	 */
+	public String getDimension();
+
+	/**
+	 * Sets the selected dimension
+	 * @param dimension
+	 */
+	public void setDimension(String dimension);
+
+	/**
+	 * Gets the value for the selected dimension
+	 * @return
+	 */
+	public String getDimensionSelectedValue();
+
+	/**
+	 * Sets the value for the selected dimension
+	 * @param dimension
+	 */
+	public void setDimensionSelectedValue(String dimension);
+
+	/**
+	 * 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(URI uri);
+
+	public URI getURI();
+
+	public WMTSClient getOGCClient();
+
+	public void setOGCClient(WMTSClient ogcClient);
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParametersImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParametersImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSDataParametersImpl.java	(revision 6892)
@@ -0,0 +1,466 @@
+/* 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 java.util.List;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.coverage.store.RasterDataServerExplorer;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
+import org.gvsig.raster.wmts.ogc.WMTSClient;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSStyle;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DelegatedDynObject;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Parameters for the WMTS provider
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSDataParametersImpl extends AbstractRasterDataParameters implements WMTSDataParameters {
+	private DelegatedDynObject       delegatedDynObject    = null;
+	private WMTSClient               ogcClient             = null;
+	private ICancellable             cancel                = null;
+	private WMTSStyle                style                 = null;
+	private WMTSLayer                layer                 = null;
+	
+	public WMTSDataParametersImpl() {
+		super();
+		initialize();
+	}
+	
+	protected void initialize() {
+		this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
+				.getDynObjectManager().createDynObject(registerDynClass());
+	}
+	
+	public static DynStruct registerDynClass() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition("WMTSDataParameters_Persistent");
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					WMTSDataParametersImpl.class,
+					"WMTSDataParameters_Persistent",
+					"WMTS DataParameters Persistency",
+					null, 
+					null
+			);
+		}
+
+		AbstractRasterDataParameters.registerDynClass(definition);
+
+		definition.addDynFieldBoolean(FIELD_DELETECACHE)
+		.setDescription("Flag to delete cache the next request")
+		.setMandatory(false);
+
+		definition.addDynFieldInt(FIELD_WIDTH)
+		.setDescription("Width")
+		.setMandatory(false);
+
+		definition.addDynFieldInt(FIELD_HEIGHT)
+		.setDescription("Height")
+		.setMandatory(false);
+
+		definition.addDynFieldBoolean(FIELD_OVERRIDE)
+		.setDescription("Override a host capabilities")
+		.setMandatory(false);
+
+		definition.addDynFieldString(FIELD_SRSSTR)
+		.setDescription("String that represents the SRS")
+		.setMandatory(false);		
+
+		definition.addDynFieldString(FIELD_NAME)
+		.setDescription("Layer name")
+		.setMandatory(false);
+
+		definition.addDynFieldString(FIELD_INFO_FORMAT)
+		.setDescription("Info Format")
+		.setMandatory(false);
+
+		definition.addDynFieldString(FIELD_IMAGE_FORMAT)
+		.setDescription("Image Format")
+		.setMandatory(false);
+		
+		definition.addDynFieldString(FIELD_STYLE_NAME)
+		.setDescription("Style")
+		.setMandatory(false);
+		
+		definition.addDynFieldObject(FIELD_EXTENT)
+		.setClassOfValue(Rectangle2D.class)
+		.setDescription("Bounding box")
+		.setMandatory(false);
+		
+		definition.addDynFieldString(FIELD_DIMENSION)
+		.setDescription("Dimensions")
+		.setMandatory(false);
+		
+		definition.addDynFieldString(FIELD_DIMENSION_VALUE)
+		.setDescription("Value selected for the current dimension")
+		.setMandatory(false);
+		
+		return definition;
+	}
+	
+	/**
+	 * Gets the selected dimension
+	 * @return
+	 */
+	public String getDimension() {
+		return (String)getDynValue(FIELD_DIMENSION);
+	}
+	
+	/**
+	 * Sets the selected dimension
+	 * @param dimension
+	 */
+	public void setDimension(String dimension) {
+		setDynValue(FIELD_DIMENSION, dimension);
+	}
+	
+	/**
+	 * Gets the value for the selected dimension
+	 * @return
+	 */
+	public String getDimensionSelectedValue() {
+		return (String)getDynValue(FIELD_DIMENSION_VALUE);
+	}
+	
+	/**
+	 * Sets the value for the selected dimension
+	 * @param dimension
+	 */
+	public void setDimensionSelectedValue(String dimension) {
+		setDynValue(FIELD_DIMENSION_VALUE, dimension);
+	}
+	
+	/**
+	 * Gets the bounding box
+	 * @return
+	 */
+	public Rectangle2D getExtent() {
+		return (Rectangle2D)getDynValue(FIELD_EXTENT);
+	}
+	
+	/**
+	 * 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) {
+		setDynValue(FIELD_EXTENT, bBox);
+	}
+	
+	/**
+	 * Sets the style selected
+	 * @param layer
+	 */
+	public void setStyle(WMTSStyle style) {
+		setDynValue(FIELD_STYLE_NAME, style.getTitle());
+		this.style = style;
+	}
+	
+	/**
+	 * Gets the style
+	 * @return
+	 */
+	public WMTSStyle getStyle() {
+		return 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);
+	}
+	
+	public String getInfoFormat() {
+		return (String) this.getDynValue(FIELD_INFO_FORMAT);
+	}
+
+	public void setInfoFormat(String format) {
+		this.setDynValue(FIELD_INFO_FORMAT, format);
+	}
+	
+	/**
+	 * Devuelve el SRS.
+	 * @return SRS.
+	 */
+	public String getSRSCode() {
+		return (String) this.getDynValue(FIELD_SRSSTR);
+	}
+	
+	public void setSRS(String m_srs) {
+		m_srs = srsValidation(m_srs);
+		this.setDynValue(FIELD_SRSSTR, m_srs);
+		if(getEPSG(m_srs) != null)
+			setSRS(CRSFactory.getCRS(getEPSG(m_srs)));
+	}
+	
+	private String srsValidation(String srs) {
+		if(srs == null)
+			return null;
+		if(srs.contains("CRS:84") || srs.contains("CRS84")) {
+			return "EPSG:4326";
+		}
+		
+		if(srs.startsWith("EPSG") && !srs.startsWith("EPSG:")) {
+			return "EPSG:" + srs.substring(srs.lastIndexOf("EPSG") + 1);
+		}
+ 			
+		if(srs.contains("EPSG:") && !srs.startsWith("EPSG:")) {
+			return "EPSG:" + srs.substring(srs.lastIndexOf(":") + 1);
+		}
+		return srs;
+	}
+	
+	/**
+	 * Returns true if the layer is projected
+	 * @return
+	 */
+	public boolean isProjected() {
+		IProjection proj = getSRS();
+		if(proj == null)
+			return true;
+		else {
+			try {
+				return proj.isProjected();
+			} catch (Exception e) {
+				LoggerFactory.getLogger(WMTSDataParameters.class).debug("error in projection", e);
+				return true;
+			}
+		}
+	}
+	
+	/**
+	 * 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 boolean isOverridingHost() {
+		Boolean b = (Boolean)getDynValue(FIELD_OVERRIDE);
+		if(b != null)
+			return ((Boolean)b).booleanValue();
+		return false;
+	}
+	
+	public void setOverrideHost(boolean over) {
+		this.setDynValue(FIELD_OVERRIDE, new Boolean(over));;
+	}
+
+	/**
+	 * 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 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;
+	}
+	
+	public void deleteCache(boolean deleteCache) {
+		this.setDynValue(FIELD_DELETECACHE, new Boolean(deleteCache));
+	}
+	
+	public boolean isDeletingCache() {
+		return ((Boolean)getDynValue(FIELD_DELETECACHE)).booleanValue();
+	}
+
+	//**********************************************
+	
+	public String getDataStoreName() {
+		return WMTSProvider.NAME;
+	}
+	
+	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;
+	}
+
+	public boolean isSizeFixed() {
+		return true;
+	}
+
+	public WMTSClient getOGCClient() {
+		return ogcClient;
+	}
+	
+	public void setOGCClient(WMTSClient ogcClient) {
+		this.ogcClient = ogcClient;
+	}
+	
+	/**
+	 * Sets the layer selected
+	 * @param layer
+	 */
+	public void setLayer(WMTSLayer layer) {
+		setName(layer.getTitle());
+		this.layer = layer;
+	}
+	
+	/**
+	 * Gets the layer
+	 * @return
+	 */
+	public WMTSLayer getLayer() {
+		return layer;
+	}
+	
+	public void setCancellable(ICancellable cancel) {
+		this.cancel = cancel;
+	}
+	
+	public ICancellable getCancellable() {
+		return cancel;
+	}
+	
+	public void assignFields(RasterDataParameters par, RasterDataServerExplorer explorer) {
+		super.assignFields(par, explorer);
+		WMTSDataParameters p = null;
+		if(par instanceof WMTSDataParameters)
+			p = (WMTSDataParameters)par;
+		else
+			return;
+		
+		setWidth(p.getWidth());
+		setHeight(p.getHeight());
+		setImageFormat(p.getImageFormat());
+		setInfoFormat(p.getInfoFormat());
+		setName(p.getName());
+		setSRS(p.getSRSCode());
+		setOverrideHost(p.isOverridingHost());
+		setExtent(p.getExtent());
+		
+		if(explorer instanceof WMTSServerExplorer) {
+			WMTSLayer wmtsLayer = ((WMTSServerExplorer)explorer).getOGCClient().getLayer(p.getName());
+			setLayer(wmtsLayer);
+			List<WMTSStyle> wmtsStyles = wmtsLayer.getStyle();
+			for (int i = 0; i < wmtsStyles.size(); i++) {
+				WMTSStyle style = wmtsStyles.get(i);
+				if(style.getTitle() != null && style.getTitle().equals((String)getDynValue(FIELD_STYLE_NAME))) {
+					this.style = style;
+				}
+			}
+			if(this.style == null && wmtsStyles.size() > 0)
+				this.style = wmtsStyles.get(0);
+		}
+	}
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/TilePipe.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/TilePipe.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/TilePipe.java	(revision 6892)
@@ -0,0 +1,107 @@
+/* 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.raster.wmts.ogc.struct.WMTSTile;
+
+
+/**
+ * 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 WMTSTile             buffer[]       = new WMTSTile[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(WMTSTile 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 WMTSTile 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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/DefaultWMTSIOLibrary.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/DefaultWMTSIOLibrary.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/DefaultWMTSIOLibrary.java	(revision 6892)
@@ -0,0 +1,50 @@
+/* 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();
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/TemplateRasterProvider.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/TemplateRasterProvider.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/TemplateRasterProvider.java	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/TemplateRasterProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/README.txt
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/README.txt	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/README.txt	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/README.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/log4j.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/log4j.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/log4j.xml	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.io/src/test/resources/log4j.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain


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

target

.classpath

.project


Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLocator.java	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingLibrary.java	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/NextPrevPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/NextPrevPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/NextPrevPanel.java	(revision 6892)
@@ -0,0 +1,41 @@
+/* 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.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+/**
+ * Panel with the next and previous buttons
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class NextPrevPanel extends JPanel {
+	private static final long             serialVersionUID   = 1L;
+	
+	public abstract JButton getBtnNext();
+
+	public abstract JButton getBtnPrev();
+	
+	public abstract JLabel getJLabelServerTypeValue();
+	
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSSwingManager.java	(revision 6892)
@@ -0,0 +1,70 @@
+/* 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();
+    
+    public AddServerPanel createAddServerPanel();
+    
+    public NextPrevPanel createNextPrevPanel();
+    
+    public WmtsGUI createMainWizard(WMTSWizardListener listener);
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSWindowManager.java	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSParamsPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSParamsPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSParamsPanel.java	(revision 6892)
@@ -0,0 +1,8 @@
+package org.gvsig.raster.wmts.swing;
+
+import javax.swing.JPanel;
+
+public abstract class WMTSParamsPanel extends JPanel {
+	private static final long serialVersionUID = 1L;
+
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/AddServerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/AddServerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/AddServerPanel.java	(revision 6892)
@@ -0,0 +1,30 @@
+package org.gvsig.raster.wmts.swing;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+
+import org.gvsig.utils.swing.jcomboServer.JComboServer;
+
+public abstract class AddServerPanel extends JPanel {
+	private static final long serialVersionUID = 1L;
+	
+	/**
+	 * Sets the text in the information box
+	 * @param info
+	 */
+	public abstract void setTextInfo(String info);
+	
+	public abstract void setTitle(String title);
+	
+	public abstract JComboServer getTxtHost();
+	
+	public abstract JCheckBox getChkInvertAxisOrder();
+	
+	public abstract JCheckBox getChkCaching();
+	
+	public abstract JButton getBtnConnect();
+	
+	public abstract JButton getBtnCancel();
+	
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WmtsGUI.java	(revision 6892)
@@ -0,0 +1,75 @@
+package org.gvsig.raster.wmts.swing;
+
+import java.awt.event.MouseAdapter;
+import java.util.HashMap;
+
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.raster.wmts.io.WMTSServerExplorer;
+
+public abstract class WmtsGUI extends JPanel {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Gets the list of <code>RasterDataParameters</code> once the
+	 * dialog has been loaded
+	 * @return
+	 * @throws LoadLayerException
+	 */
+	public abstract RasterDataParameters[] getDataParameters(); // throws LoadLayerException;
+
+	/**
+	 * Returns the index of the current tab.
+	 * @return
+	 */
+	public abstract int currentPage();
+
+	/**
+	 * Returns the tab amount that the WMTSParamsPanel currently have
+	 * @return int
+	 */
+	public abstract int getNumTabs();
+
+	/**
+	 * Sets the focus to the tab previous to the current one.
+	 */
+	public abstract void setPreviousTab();
+
+	/**
+	 * Sets the focus to the tab next to the current one.
+	 */
+	public abstract void setNextTab();
+
+	/**
+	 * <p>
+	 * Returns the previous of the previous enabled tab.
+	 * </p>
+	 * @return The index, or -1 if there is no one.
+	 */
+	public abstract int nextEnabledPage();
+
+	/**
+	 * 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 abstract boolean isCorrectlyConfigured();
+
+	public abstract void setDeleteCache(boolean deleteCache);
+
+	/**
+	 * Sets the explorer
+	 * @param data
+	 */
+	public abstract void setWizardData(WMTSServerExplorer data);
+
+	public abstract boolean getDeleteCache();
+
+	public abstract void addChangeTabListener(MouseAdapter eventMouse);
+
+	public abstract void updateSelectedInfo(HashMap<String, Object> info);
+
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSWizardListener.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSWizardListener.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/java/org/gvsig/raster/wmts/swing/WMTSWizardListener.java	(revision 6892)
@@ -0,0 +1,9 @@
+package org.gvsig.raster.wmts.swing;
+
+public interface WMTSWizardListener {
+	public void correctlyConfiguredEvent(boolean finishable);
+	
+	public void addLayerEvent();
+	
+	public void removeLayerEvent();
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 6892)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.swing.WMTSSwingLibrary
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/pom.xml	(revision 6892)
@@ -0,0 +1,44 @@
+<?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.2.43</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.utils</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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.api
___________________________________________________________________
Added: svn:ignore
   + .settings

target

.classpath

.project


Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 6892)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.swing.impl.WMTSSwingImplLibrary
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/org/gvsig/raster/wmts/swing/impl/i18n/text.properties
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/org/gvsig/raster/wmts/swing/impl/i18n/text.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/org/gvsig/raster/wmts/swing/impl/i18n/text.properties	(revision 6892)
@@ -0,0 +1,23 @@
+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.
+view_type=Tipo de vista
+layerlist_view_selection=Ver como lista de capas
+themes_view_selection=Ver como temas 
+view_not_disposable=No hay themas definidos en este servidor
+theme_without_reference=Tema sin capa referenciada. \n Selecciona desde la lista de capas.
+host_unreachable=No se puede conectar con el servidor. Tal vez la red est� desconectada o el servidor apagado.
+ip_unknown=Direcci�n IP desconocida
+network_error=Error en la conexi�n a red
+dimension=Dimensi�n
+dimensions=Dimensiones
+value_list=Lista de valores posibles
+selected_value=Valor seleccionado
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/org/gvsig/raster/wmts/swing/impl/i18n/text.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/org/gvsig/raster/wmts/swing/impl/i18n/text_en.properties
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/org/gvsig/raster/wmts/swing/impl/i18n/text_en.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/org/gvsig/raster/wmts/swing/impl/i18n/text_en.properties	(revision 6892)
@@ -0,0 +1,23 @@
+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.
+view_type=View type
+layerlist_view_selection=View as layers list
+themes_view_selection=View as themes
+view_not_disposable=There are not themes defined in this server
+theme_without_reference=Theme without layer referenced.\n Select from the list of layers.
+host_unreachable=The host is unreachable. Maybe the network is not connected or the host off.
+ip_unknown=IP address unknown 
+network_error=Error with the network connection
+dimension=Dimension
+dimensions=Dimensions
+value_list=List of possible values
+selected_value=Selected value
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/resources/org/gvsig/raster/wmts/swing/impl/i18n/text_en.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/WMTSSwingImplLibrary.java	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/AddDelLayerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/AddDelLayerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/AddDelLayerPanel.java	(revision 6892)
@@ -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.swing.impl.panel.layer;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.gvsig.i18n.Messages;
+
+/**
+ * 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(Messages.getText("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(Messages.getText("remove"));
+		}
+		return btnRemove;
+	}
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayerTree.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayerTree.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayerTree.java	(revision 6892)
@@ -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.swing.impl.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.gui.beans.controls.MultiLineToolTip;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.wmts.ogc.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 =
+                    Messages.getText("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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayerTree.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/ILayerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/ILayerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/ILayerPanel.java	(revision 6892)
@@ -0,0 +1,260 @@
+/* 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.panel.layer;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.i18n.Messages;
+
+/**
+ * Layer panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ILayerPanel extends JPanel {
+	private static final long      serialVersionUID   = 1L;
+	private LayerTree              treeLayers                 = null;
+	private JPanel                 jPanelViewSelector            = null;
+	private JPanel                 jPanelSelectLayers         = null;
+	private JCheckBox              chkExtendedNames           = null;
+	private JScrollPane            jScrollTreeLayers          = null;
+	private LayersSelectedPanel    layersSelectedPanel        = null;
+	private AddDelLayerPanel       addDelLayerPanel           = null;
+	private JRadioButton           themesViewSelection        = null;
+	private JRadioButton           layerListViewSelection     = null;
+	
+	public ILayerPanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		
+		ButtonGroup group = new ButtonGroup();
+		group.add(getLayerListViewSelection());
+		group.add(getThemesViewSelection());
+		
+		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(getJPanelViewSelection(), gridBagConstraints1);
+		
+		gridBagConstraints1.fill = GridBagConstraints.BOTH;
+		gridBagConstraints1.gridy = 1;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.weighty = 1.0;
+		add(getJPanelSelectLayers(), gridBagConstraints1);
+	}
+	
+	public JRadioButton getLayerListViewSelection() {
+		if(layerListViewSelection == null) {
+			layerListViewSelection = new JRadioButton(Messages.getText("layerlist_view_selection"));
+			layerListViewSelection.setSelected(true);
+		}
+		return layerListViewSelection;
+	}
+	
+	public JRadioButton getThemesViewSelection() {
+		if(themesViewSelection == null) {
+			themesViewSelection = new JRadioButton(Messages.getText("themes_view_selection"));
+			themesViewSelection.setSelected(false);	
+		}
+		return themesViewSelection;
+	}
+	
+	/**
+	 * This method initializes jPanel4
+	 * @return Panel
+	 */
+	private JPanel getJPanelViewSelection() {
+		if (jPanelViewSelector == null) {
+			jPanelViewSelector = new JPanel();
+			jPanelViewSelector.setLayout(new GridBagLayout());
+			jPanelViewSelector.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, Messages.getText("view_type"),
+					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);
+			
+			jPanelViewSelector.add(getLayerListViewSelection(), gridBagConstraints1);
+			gridBagConstraints1.gridy = 1;
+			jPanelViewSelector.add(getThemesViewSelection(), gridBagConstraints1);
+		}
+
+		return jPanelViewSelector;
+	}
+	
+	/**
+	 * 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 jPanel2
+	 * @return Panel
+	 */
+	private JPanel getJPanelSelectLayers() {
+		if (jPanelSelectLayers == null) {
+			jPanelSelectLayers = new JPanel();
+			jPanelSelectLayers.setLayout(new GridBagLayout());
+			jPanelSelectLayers.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, Messages.getText("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(Messages.getText("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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/ILayerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayerList.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayerList.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayerList.java	(revision 6892)
@@ -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.swing.impl.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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayerList.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayersSelectedPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayersSelectedPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/layer/LayersSelectedPanel.java	(revision 6892)
@@ -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.swing.impl.panel.layer;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.gui.beans.controls.dnd.JDnDListModel;
+import org.gvsig.i18n.Messages;
+
+/**
+ * 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;
+	private String                 pathToImagesForTest        = "/src/main/resources/images/";
+	
+	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(Messages.getText("move_layer_up"));
+			btnUp.setIcon(loadIcon("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(Messages.getText("move_layer_down"));
+			btnDown.setIcon(loadIcon("aplication-preferences-downarrow"));
+		}
+		return btnDown;
+	}
+	
+	private ImageIcon loadIcon(String iconName) {
+		ImageIcon icon = null;
+		try {
+			icon = IconThemeHelper.getImageIcon(iconName);
+		} catch(NullPointerException e) {}
+		if(icon == null) 
+			icon = new ImageIcon(System.getProperty("user.dir") + pathToImagesForTest + iconName + ".png", "");
+		if(icon == null) 
+			icon = new ImageIcon(System.getProperty("user.dir") + pathToImagesForTest + iconName + ".gif", "");
+		return icon;
+	}
+
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/ConnectPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/ConnectPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/ConnectPanel.java	(revision 6892)
@@ -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.swing.impl.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.i18n.Messages;
+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, Messages.getText("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(Messages.getText("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(Messages.getText("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(Messages.getText("refresh_capabilities"));
+			chkCaching.setToolTipText(Messages.getText("refresh_capabilities_tooltip"));
+		}
+		return chkCaching;
+	}
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/NextPrevPanelImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/NextPrevPanelImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/NextPrevPanelImpl.java	(revision 6892)
@@ -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.swing.impl.panel.main;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.wmts.swing.NextPrevPanel;
+
+/**
+ * Panel with the next and previous buttons
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class NextPrevPanelImpl extends NextPrevPanel {
+	private static final long             serialVersionUID   = 1L;
+	private JButton                       btnSiguiente       = null;
+	private JButton                       btnAnterior        = null;
+	protected JLabel                      lblServerType      = null;
+	protected JLabel                      lblServerTypeValue = null;
+	
+	public NextPrevPanelImpl() {
+		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(Messages.getText("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(Messages.getText("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(Messages.getText("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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/NextPrevPanelImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/IServerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/IServerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/IServerPanel.java	(revision 6892)
@@ -0,0 +1,196 @@
+/* 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.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.i18n.Messages;
+import org.gvsig.raster.wmts.swing.AddServerPanel;
+import org.gvsig.utils.swing.jcomboServer.JComboServer;
+
+/**
+ * Connect panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class IServerPanel extends AddServerPanel 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(Messages.getText("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();
+	}
+	
+	public void setTitle(String title) {
+		getDescriptionPanel().getJLabelTitle().setText(title);
+	}
+	
+	public void setTextInfo(String info) {
+		getDescriptionPanel().getTxtAbstract().setText(info);
+	}
+	
+	/**
+	 * 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 = Messages.getText("accept");
+			Object[] options = {string};
+			JOptionPane.showOptionDialog((Component)/*PluginServices.getMainFrame()*/this,
+						"<html>" + Messages.getText("cache_refresh").replaceAll("\n", "<br>") + "</html>",
+						Messages.getText("confirmacion"),
+						JOptionPane.OK_OPTION,
+						JOptionPane.INFORMATION_MESSAGE,
+						null,
+						options,
+						string);
+		}
+	}
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/DescriptionPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/DescriptionPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/DescriptionPanel.java	(revision 6892)
@@ -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.swing.impl.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.i18n.Messages;
+
+/**
+ * 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, Messages.getText("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(Messages.getText("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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/main/DescriptionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/ValuesDimensionListPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/ValuesDimensionListPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/ValuesDimensionListPanel.java	(revision 6892)
@@ -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.swing.impl.panel.dimension;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.gvsig.i18n.Messages;
+
+/**
+ * Panel for possible values of one dimension
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ValuesDimensionListPanel extends JPanel {
+	private static final long             serialVersionUID   = 1L;
+	private JList                         listOfValues        = null;
+	private JScrollPane                   jScrollPane        = null;
+	private JPanel                        jPanelTxt          = null;
+	private JLabel                        lblTitle           = null;
+	
+	public ValuesDimensionListPanel() {
+		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);
+	}
+	
+	private javax.swing.JPanel getJPanelTxt() {
+		if (jPanelTxt == null) {
+			jPanelTxt = new javax.swing.JPanel();
+			jPanelTxt.setLayout(new GridBagLayout());
+			jPanelTxt.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, Messages.getText("value_list"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.gridx = 0;
+			gridBagConstraints1.gridy = 0;
+			gridBagConstraints1.insets = new java.awt.Insets(2,2,2,2);
+			gridBagConstraints1.fill = GridBagConstraints.BOTH;
+			gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.weighty = 1.0;
+			jPanelTxt.add(getJScrollPane(), gridBagConstraints1);
+		}
+
+		return jPanelTxt;
+	}
+	
+	public void addElement(String value) {
+		((DefaultListModel)getListOfValues().getModel()).addElement(value);
+	}
+	
+	public void clearList() {
+		for (int i = getListOfValues().getModel().getSize() - 1; i >= 0 ; i--) {
+			((DefaultListModel)getListOfValues().getModel()).remove(i);
+		}
+	}
+	
+	public JList getListOfValues() {
+		if (listOfValues == null) {
+			listOfValues = new JList(new DefaultListModel());
+		}
+		return listOfValues;
+	}
+	
+	private javax.swing.JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new javax.swing.JScrollPane();
+			jScrollPane.setViewportView(getListOfValues());
+		}
+
+		return jScrollPane;
+	}
+	
+	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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/ValuesDimensionListPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/DimensionComboPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/DimensionComboPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/DimensionComboPanel.java	(revision 6892)
@@ -0,0 +1,86 @@
+/* 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.panel.dimension;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.JPanel;
+
+import org.gvsig.i18n.Messages;
+
+/**
+ * Dimension panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DimensionComboPanel extends JPanel {
+	private static final long   serialVersionUID   = 1L;
+	private JComboBox           cmbHost            = null;
+	
+	public DimensionComboPanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		setBorder(javax.swing.BorderFactory.createTitledBorder(
+				null, Messages.getText("dimension"),
+				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(getDimensionList(), gridBagConstraints1);
+	}
+	
+	/**
+	 * This method initializes txtHost
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public JComboBox getDimensionList() {
+		if (cmbHost == null) {
+			cmbHost = new JComboBox();
+			cmbHost.setModel(new DefaultComboBoxModel());
+			cmbHost.setPreferredSize(new java.awt.Dimension(350, 20));
+			cmbHost.setEditable(false);
+		}
+
+		return cmbHost;
+	}
+	
+	public String getSelectedDimension() {
+		return (String)getDimensionList().getSelectedItem();
+	}
+	
+	public void clearDimensions() {
+		getDimensionList().removeAllItems();
+	}
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/DimensionPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/DimensionPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/DimensionPanel.java	(revision 6892)
@@ -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.swing.impl.panel.dimension;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.util.List;
+
+import javax.swing.JPanel;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSDimension;
+
+/**
+ * Dimension tab panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DimensionPanel extends JPanel {
+	private static final long          serialVersionUID          = 1L;
+	private DimensionComboPanel        dimensionPanel            = null;
+	private ValuesDimensionListPanel   valuesDimensionListPanel  = null;
+	private SelectedValuePanel         selectedValuePanel        = null;
+	private List<WMTSDimension>        dataModel                 = null;
+	
+	
+	public DimensionPanel() {
+		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(2,2,2,2);
+		add(getDimensionPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.fill = GridBagConstraints.BOTH;
+		gridBagConstraints1.anchor = GridBagConstraints.CENTER;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 1;
+		gridBagConstraints1.weightx = 1.0;
+		gridBagConstraints1.weighty = 1.0;
+		add(getValuesDimensionListPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.fill = GridBagConstraints.BOTH;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 2;
+		gridBagConstraints1.weighty = 0.0;
+		add(getSelectedValuePanel(), gridBagConstraints1);
+	}
+	
+	public void setDimensions(List<WMTSDimension> dimensions) {
+		this.dataModel = dimensions;
+		getDimensionPanel().clearDimensions();
+		
+		for (int i = 0; i < dimensions.size(); i++) {
+			WMTSDimension dim = dimensions.get(i);
+			getDimensionPanel().getDimensionList().addItem(dim.getIdentifier());
+		}
+		fillDefaultValuesOfSelectedDimension();
+	}
+	
+	private void fillDefaultValuesOfSelectedDimension() {
+		String selectedDimension = getDimensionPanel().getSelectedDimension();
+		getValuesDimensionListPanel().clearList();
+		getSelectedValuePanel().getSelectedValue().setText("");
+		
+		for (int i = 0; i < dataModel.size(); i++) {
+			WMTSDimension dim = dataModel.get(i);
+			if(dim.getIdentifier().equals(selectedDimension)) {
+				for (int j = 0; j < dim.getValueList().size(); j++) {
+					getValuesDimensionListPanel().addElement(dim.getValueList().get(j));
+				}		
+			}
+			getSelectedValuePanel().setValue(dim.getDefaultValue());
+		}
+	}
+	
+	public void clearGraphicComponents() {
+		getDimensionPanel().getDimensionList().removeAllItems();
+		getValuesDimensionListPanel().clearList();
+		getSelectedValuePanel().getSelectedValue().setText("");
+	}
+	
+	public DimensionComboPanel getDimensionPanel() {
+		if(dimensionPanel == null) {
+			dimensionPanel = new DimensionComboPanel();
+		}
+		return dimensionPanel;
+	}
+	
+	public ValuesDimensionListPanel getValuesDimensionListPanel() {
+		if(valuesDimensionListPanel == null) {
+			valuesDimensionListPanel = new ValuesDimensionListPanel();
+		}
+		return valuesDimensionListPanel;
+	}
+	
+	public SelectedValuePanel getSelectedValuePanel() {
+		if (selectedValuePanel == null) {
+			selectedValuePanel = new SelectedValuePanel();
+		}
+		return selectedValuePanel;
+	}
+
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/SelectedValuePanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/SelectedValuePanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/SelectedValuePanel.java	(revision 6892)
@@ -0,0 +1,79 @@
+/* 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.panel.dimension;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.i18n.Messages;
+
+/**
+ * Dimension panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SelectedValuePanel extends JPanel {
+	private static final long   serialVersionUID   = 1L;
+	private JTextField          value              = null;
+	
+	public SelectedValuePanel() {
+		init();
+	}
+	
+	public void init() {
+		setLayout(new GridBagLayout());
+		setBorder(javax.swing.BorderFactory.createTitledBorder(
+				null, Messages.getText("selected_value"),
+				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(getSelectedValue(), gridBagConstraints1);
+	}
+	
+	/**
+	 * This method initializes txtHost
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public JTextField getSelectedValue() {
+		if (value == null) {
+			value = new JTextField();
+			value.setPreferredSize(new java.awt.Dimension(350, 20));
+		}
+
+		return value;
+	}
+	
+	public void setValue(String value) {
+		getSelectedValue().setText(value);
+	}
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/format/IFormatsPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/format/IFormatsPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/panel/format/IFormatsPanel.java	(revision 6892)
@@ -0,0 +1,242 @@
+/* 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.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.i18n.Messages;
+import org.gvsig.raster.wmts.swing.impl.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, Messages.getText("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, Messages.getText("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, Messages.getText("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(Messages.getText("wms_transparency"));
+			chkTransparency.setSelected(true);
+		}
+		return chkTransparency;
+	}
+	
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/InfoPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/InfoPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/InfoPanel.java	(revision 6892)
@@ -0,0 +1,221 @@
+/* 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.wizard;
+
+import java.awt.BorderLayout;
+import java.util.Vector;
+
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.wmts.io.WMTSServerExplorer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSServiceIdentification;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTheme;
+import org.gvsig.raster.wmts.swing.impl.wizard.WMTSParamsPanel.LayerUI;
+
+
+/**
+ * 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       = Messages.getText("service_info");
+    private final String server              = Messages.getText("server");
+    private final String server_type         = Messages.getText("server_type");
+    private final String server_abstract     = Messages.getText("server_abstract");
+    private final String server_title        = Messages.getText("server_title");
+    private final String layers_title        = Messages.getText("selected_layers");
+    private final String layer_title         = Messages.getText("layer_title");
+    private final String layer_abstract      = Messages.getText("layer_abstract");
+    private final String selected_dimensions = Messages.getText("selected_dimensions");
+    private final String style               = Messages.getText("style");
+    private final String format_title        = Messages.getText("format");
+    private final String srs_title           = "SRS";
+    private final String properties			 = Messages.getText("properties");
+    private final String layer_name			 = Messages.getText("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
+     */
+	public void refresh(WMTSServerExplorer explorer, Vector layers, Vector styles, String format, String srs) {
+
+    	WMTSServiceIdentification id = explorer.getOGCClient().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 = Messages.getText("none_selected");
+        if (srs == null)
+            srs = Messages.getText("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) ? Messages.getText("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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/InfoPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/WMTSParametersListModel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/WMTSParametersListModel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/WMTSParametersListModel.java	(revision 6892)
@@ -0,0 +1,80 @@
+/* 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.wizard;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+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(List<String> obj) {
+		for (int i = 0; i < obj.size(); i++) 
+			srs.add(obj.get(i));
+	}
+	
+	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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/WMTSParametersListModel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/LayerTreeModel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/LayerTreeModel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/LayerTreeModel.java	(revision 6892)
@@ -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.swing.impl.wizard;
+
+import java.util.List;
+
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSStyle;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTheme;
+import org.gvsig.raster.wmts.ogc.struct.WMTSThemes;
+
+/**
+ * Model for the layer three 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+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 List<WMTSStyle> 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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/LayerTreeModel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/WMTSParamsPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/WMTSParamsPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/WMTSParamsPanel.java	(revision 6892)
@@ -0,0 +1,1087 @@
+/* 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.wizard;
+
+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.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Vector;
+import java.util.prefs.Preferences;
+
+import javax.swing.JComponent;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.gui.beans.Messages;
+import org.gvsig.gui.beans.controls.dnd.JDnDListModel;
+import org.gvsig.gui.beans.listeners.BeanListener;
+import org.gvsig.raster.wmts.io.WMTSDataParameters;
+import org.gvsig.raster.wmts.io.WMTSServerExplorer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSDimension;
+import org.gvsig.raster.wmts.ogc.struct.WMTSStyle;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTheme;
+import org.gvsig.raster.wmts.swing.WMTSWizardListener;
+import org.gvsig.raster.wmts.swing.WmtsGUI;
+import org.gvsig.raster.wmts.swing.impl.panel.dimension.DimensionPanel;
+import org.gvsig.raster.wmts.swing.impl.panel.format.IFormatsPanel;
+import org.gvsig.raster.wmts.swing.impl.panel.layer.ILayerPanel;
+import org.gvsig.raster.wmts.swing.impl.panel.layer.LayerList;
+import org.gvsig.raster.wmts.swing.impl.panel.layer.LayerTree;
+
+
+/**
+ * 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)
+ */
+public class WMTSParamsPanel extends WmtsGUI implements 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 DimensionPanel           dimensionPanel             = null;
+
+	private ArrayList<TreePath>      selectedPaths              = new ArrayList<TreePath>();
+	private WMTSWizardListener       listenerSupport            = null;
+	private JTabbedPane              jTabbedPane                = null;
+	protected WMTSServerExplorer     explorer                   = null;
+	public static Preferences        fPrefs                     = Preferences.userRoot().node("gvsig.wmts-wizard");
+	private boolean                  deleteCache                = false;
+	private HashMap<Object, Integer> tabsIndexes                = new HashMap<Object, Integer>();
+	private static final Logger         logger                    = LoggerFactory.getLogger(WMTSParamsPanel.class);
+
+
+	/**
+	 * 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();
+		}
+	}
+
+	public JComponent getComponent() {
+		return this;
+	}
+
+	public WMTSParamsPanel() {
+		super();
+		initialize();
+	}
+
+	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);
+
+			jTabbedPane.addTab(Messages.getText("capas"), null, getLayerPanel(), null);
+			jTabbedPane.addTab(Messages.getText("estilos"), null, getTabStyle(), null);
+			jTabbedPane.addTab(Messages.getText("dimensions"), null, getJPanelDimension(), null);
+			jTabbedPane.addTab(Messages.getText("formatos"), null, getJPanelFormatsAndSrs(), null);
+
+			tabsIndexes.put(getLayerPanel(), 0);
+			tabsIndexes.put(getTabStyle(), 1);
+			tabsIndexes.put(getJPanelDimension(), 2);
+			tabsIndexes.put(getJPanelFormatsAndSrs(), 3);
+		}
+		this.add(jTabbedPane, null);
+
+		jTabbedPane.setEnabledAt(1, false);
+		jTabbedPane.setEnabledAt(2, false);
+		jTabbedPane.setEnabledAt(3, false);
+	}
+
+	/**
+	 * 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) {
+					refreshInfoPanel();
+				}
+
+				public void focusLost(FocusEvent e) {
+				}
+			});
+
+			jTabbedPane.addTab(Messages.getText("info"), null, ip, null);
+			jTabbedPane.addTab(Messages.getText("capas"), null, getLayerPanel(), null);
+			jTabbedPane.addTab(Messages.getText("estilos"), null, getTabStyle(), null);
+			jTabbedPane.addTab(Messages.getText("dimensions"), null, getJPanelDimension(), null);
+			jTabbedPane.addTab(Messages.getText("formatos"), null, getJPanelFormatsAndSrs(), null);
+
+			tabsIndexes.clear();
+			tabsIndexes.put(ip, 0);
+			tabsIndexes.put(getLayerPanel(), 1);
+			tabsIndexes.put(getTabStyle(), 2);
+			tabsIndexes.put(getJPanelDimension(), 3);
+			tabsIndexes.put(getJPanelFormatsAndSrs(), 4);
+
+			jTabbedPane.setEnabledAt(2, false);
+			jTabbedPane.setEnabledAt(3, false);
+			jTabbedPane.setEnabledAt(4, false);
+		}
+		return jTabbedPane;
+	}
+
+	/**
+	 * 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.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);
+			layerPanel.getLayerListViewSelection().addActionListener(this);
+			layerPanel.getThemesViewSelection().addActionListener(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();
+				};
+			});
+			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;
+	}
+
+	/**
+	 * This method initializes the panel with the formats and SRSs
+	 * @return Panel
+	 */
+	private DimensionPanel getJPanelDimension() {
+		if (dimensionPanel == null) {
+			dimensionPanel = new DimensionPanel();
+		}
+		return dimensionPanel;
+	}
+
+	/**
+	 * Fires a notification to this wizard listeners telling them if the
+	 * configuration is fair enough to send a GetMap request.
+	 *
+	 * @param b
+	 */
+	private void fireWizardComplete() {
+		listenerSupport.correctlyConfiguredEvent(isCorrectlyConfigured());
+	}
+
+	public void setListenerSupport(WMTSWizardListener support) {
+		listenerSupport = support;
+	}
+
+	/**
+	 * Returns the index of the CRS within the CRS list.
+	 *
+	 * @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;
+	}
+
+	public void updateSelectedInfo(HashMap<String, Object> info) {
+		setVisible(true);
+
+		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);
+		}
+
+		refreshInfoPanel();
+	}
+
+	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
+	 */
+	@SuppressWarnings("rawtypes")
+	public Vector getStyleTitles() {
+		return getTabStyle().getStyleTree().getStyleSelectionTitles();
+	}
+
+	/**
+	 * Gets the list of the selected layers
+	 * @return
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	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
+	 */
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	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;
+	}
+
+	/**
+	 * 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();
+			selectedPaths.clear();
+		} catch (ArrayIndexOutOfBoundsException ex) {
+			ex.printStackTrace();
+		}
+		//**************
+
+		for (int i = 0; i < selecciones.length && i < 1 /*Se a�ade solo uno: quitar para lista*/; i++) {
+			if(!(selecciones[i].getLastPathComponent() instanceof WMTSTheme))
+				continue;
+			selectedPaths.add(selecciones[i]);
+			WMTSTheme nodo = (WMTSTheme) selecciones[i].getLastPathComponent();
+
+			if (nodo.getTitle() == null || nodo.getTitle().equals("")) {
+				continue;
+			}
+
+			JDnDListModel modelo = (JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel();
+			if(getLayerPanel().getThemesViewSelection().isSelected() && nodo.getLayerRef().size() == 0) {
+				JOptionPane.showOptionDialog(this,
+						Messages.getText("theme_without_reference"),
+						Messages.getText("confirmacion"),
+						JOptionPane.OK_OPTION,
+						JOptionPane.INFORMATION_MESSAGE,
+						null,
+						new Object[]{Messages.getText("accept")},
+						Messages.getText("accept"));
+				return;
+			}
+
+			if (modelo.addElement(0, new LayerUI(nodo))) {
+				alguno = true;
+			}
+			getLayerPanel().getLstSelectedLayers().setSelectedIndex(0);
+		}
+
+		if (alguno) {
+			refreshSelectedLayerData();
+		}
+		refreshInfoPanel();
+		fireWizardComplete();
+		listenerSupport.addLayerEvent();
+	}
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	private void delLayer() {
+		int[] indices = getLayerPanel().getLstSelectedLayers().getSelectedIndices();
+
+		ArrayList removeList = new ArrayList();
+		LayerUI[] infos = selectedLayersToArray();
+		JDnDListModel modelo = ((JDnDListModel) getLayerPanel().getLstSelectedLayers().getModel());
+		for (int i = 0; i < indices.length; i++) {
+			removeList.add(infos[indices[i]]);
+		}
+		modelo.delIndices(indices);
+		layerPanel.getLstSelectedLayers().clearSelection();
+
+		// delete from selectedPaths as well
+		WMTSTheme elemento = null;
+		WMTSTheme last = null;
+		TreePath path = null;
+		for (int i = removeList.size() - 1; i >= 0; i--) {
+			elemento = ((LayerUI)removeList.get(i)).theme;
+			for (int j = 0; j < selectedPaths.size(); j++) {
+				path = (TreePath) selectedPaths.get(j);
+				last = (WMTSTheme) path.getLastPathComponent();
+				if (last.getTitle().compareTo(elemento.getTitle()) == 0) {
+					selectedPaths.remove(path);
+				}
+			}
+		}
+
+		refreshSelectedLayerData();
+		refreshInfoPanel();
+		fireWizardComplete();
+		listenerSupport.removeLayerEvent();
+	}
+
+	/**
+	 * 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();
+		refreshDimension();
+	}
+
+	/**
+	 * Refreshes the info tab
+	 */
+	public void refreshInfoPanel() {
+		getTabInfo().refresh(explorer, getSelectedLayersVector(),
+				getStyleTitles(), getSelectedImageFormat(), getSelectedSRS());
+	}
+
+	/**
+	 * Refreshes the style tab
+	 */
+	private void refreshStyleTree() {
+		StyleTreeModel model = new StyleTreeModel(Messages.getText("selected_layers"));
+		int tabIndex = tabsIndexes.get(getTabStyle());
+		jTabbedPane.setEnabledAt(tabIndex, false);
+
+		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+		if(selectedValues != null && selectedValues.length == 1) {
+			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(tabIndex, true);
+			}
+		}
+
+		getStyleTree().setModel(model);
+		getStyleTree().expandAll();
+		getStyleTree().repaint();
+	}
+
+	/**
+	 * Refreshes the Image formats list
+	 */
+	private void refreshImageFormats() {
+		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+
+		int tabIndex = tabsIndexes.get(getJPanelFormatsAndSrs());
+		jTabbedPane.setEnabledAt(tabIndex, false);
+
+		if( (selectedValues == null || selectedValues.length == 0) &&
+				getImageFormats().getModel() != null &&
+				getImageFormats().getModel() instanceof WMTSParametersListModel) {
+			((WMTSParametersListModel)getImageFormats().getModel()).removeAllItems();
+		}
+		if(selectedValues != null && selectedValues.length >= 1) {
+			List<String> formats = ((LayerUI)selectedValues[0]).theme.getLayer().getFormat();
+			WMTSParametersListModel model = new WMTSParametersListModel(formats);
+			getImageFormats().setModel(model);
+			getImageFormats().setSelectedIndex(((LayerUI)selectedValues[0]).imageFormatSelected);
+			jTabbedPane.setEnabledAt(tabIndex, true);
+		}
+	}
+
+	/**
+	 * 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) {
+			List<String> 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) {
+			List<String> formats = ((LayerUI)selectedValues[0]).theme.getLayer().getSrsList();
+			WMTSParametersListModel model = new WMTSParametersListModel(formats);
+			getLstSRSs().setModel(model);
+			getLstSRSs().setSelectedIndex(((LayerUI)selectedValues[0]).srsFormatSelected);
+		}
+	}
+
+	private void refreshDimension() {
+		Object[] selectedValues = getLayerPanel().getLstSelectedLayers().getSelectedValues();
+		int tabIndex = tabsIndexes.get(getJPanelDimension());
+		jTabbedPane.setEnabledAt(tabIndex, false);
+
+		if(selectedValues != null && selectedValues.length >= 1) {
+			List<WMTSDimension> dimensions = ((LayerUI)selectedValues[0]).theme.getLayer().getDimensions();
+			if(dimensions == null || dimensions.size() == 0) {
+				return;
+			}
+			jTabbedPane.setEnabledAt(tabIndex, true);
+			getJPanelDimension().setDimensions(dimensions);
+		}
+	}
+
+	/**
+	 * 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.getOGCClient().getLayerListAsThemes()));
+		refreshInfoPanel();
+	}
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	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;
+	}
+
+	/**
+	 * Sets the focus to the tab next to the current one.
+	 */
+	public void setNextTab() {
+		int currentPage = currentPage();
+		int nPages = getNumTabs();
+		if (nPages - 1 > currentPage) {
+			getJTabbedPane().setSelectedIndex(nextEnabledPage());
+		}
+	}
+
+	/**
+	 * Sets the focus to the tab previous to the current one.
+	 */
+	public void setPreviousTab() {
+		this.getJTabbedPane().setSelectedIndex(previousEnabledPage());
+
+	}
+
+	/**
+	 * Returns the index of the current tab.
+	 * @return
+	 */
+	public int currentPage() {
+		return getJTabbedPane().getSelectedIndex();
+	}
+
+	/**
+	 * Returns the tab amount that the WMTSParamsPanel currently have
+	 * @return int
+	 */
+	public int getNumTabs() {
+		return getJTabbedPane().getTabCount();
+	}
+
+	/**
+	 * <p>
+	 * Returns the index of the previous enabled tab.
+	 * </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>
+	 * @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 RasterDataParameters[] getDataParameters() { // throws LoadLayerException {
+		ListModel model = getLayerPanel().getLstSelectedLayers().getModel();
+		RasterDataParameters[] paramList = new RasterDataParameters[model.getSize()];
+
+		for (int i = 0; i < model.getSize(); i++) {
+			WMTSTheme theme = ((LayerUI)model.getElementAt(i)).theme;
+			DataStoreParameters parameters = explorer.getStoredParameters();
+			WMTSDataParameters par = null;
+			if(parameters instanceof WMTSDataParameters) {
+				par = (WMTSDataParameters) parameters;
+			}
+			if(parameters instanceof TileDataParameters) {
+				DataParameters p = ((TileDataParameters) parameters).getDataParameters();
+				if(p instanceof WMTSDataParameters)
+					par = (WMTSDataParameters) p;
+			}
+			String host = explorer.getHost();
+            try {
+                par.setURI(new URI(host));
+            } catch (URISyntaxException e) {
+                logger.warn("Can't create URI from "+host, e);
+            }
+			par.setImageFormat(getSelectedImageFormat());
+			par.setInfoFormat(getSelectedInfoFormat());
+			par.setSRS(getSelectedSRS());
+			par.setLayer(theme.getLayer());
+			par.setDimension(getSelectedDimension());
+			par.setDimensionSelectedValue(getSelectedValueForDimension());
+			WMTSStyle style = getSelectedStyle(theme.getLayer().getTitle());
+			if(style != null)
+				par.setStyle(style);
+
+			paramList[i] = (RasterDataParameters)parameters;
+		}
+		return paramList;
+	}
+
+	private String getSelectedValueForDimension() {
+		return getJPanelDimension().getSelectedValuePanel().getSelectedValue().getText();
+	}
+
+	private String getSelectedDimension() {
+		return getJPanelDimension().getDimensionPanel().getSelectedDimension();
+	}
+
+	/**
+	 * 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 List<TreePath> getSelectedPaths() {
+		return selectedPaths;
+	}
+
+	public LayerTree getJustTreeLayer() {
+		return getLayerPanel().getTreeLayers();
+	}
+
+	public DataStoreParameters[] getParameters() {
+		return null;
+	}
+
+	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());
+		}
+
+		if(e.getSource() == getLayerPanel().getLayerListViewSelection()) {
+			((JDnDListModel)getLayerPanel().getLstSelectedLayers().getModel()).clear();
+			layerPanel.getLstSelectedLayers().repaint();
+
+			getLayerPanel().getTreeLayers().setModel(new LayerTreeModel(explorer.getOGCClient().getLayerListAsThemes()));
+			refreshInfoPanel();
+		}
+
+		if(e.getSource() == getLayerPanel().getThemesViewSelection()) {
+			if(explorer.getOGCClient().getThemes().hasThemes()) {
+				((JDnDListModel)getLayerPanel().getLstSelectedLayers().getModel()).clear();
+				layerPanel.getLstSelectedLayers().repaint();
+
+				getLayerPanel().getTreeLayers().setModel(new LayerTreeModel(explorer.getOGCClient().getThemes()));
+				refreshInfoPanel();
+			} else {
+				getLayerPanel().getLayerListViewSelection().setSelected(true);
+				JOptionPane.showOptionDialog(this,
+						Messages.getText("view_not_disposable"),
+						Messages.getText("confirmacion"),
+						JOptionPane.OK_OPTION,
+						JOptionPane.INFORMATION_MESSAGE,
+						null,
+						new Object[]{Messages.getText("accept")},
+						Messages.getText("accept"));
+			}
+		}
+	}
+
+	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();
+		}
+	}
+
+	public void keyTyped(KeyEvent e) {
+	}
+
+	public void keyPressed(KeyEvent e) {
+	}
+
+	public void keyReleased(KeyEvent e) {
+	}
+
+	public void valueChanged(ListSelectionEvent e) {
+		fireWizardComplete();
+	}
+
+	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();
+		}
+	}
+
+	public void setDeleteCache(boolean deleteCache) {
+		this.deleteCache = deleteCache;
+	}
+
+	public boolean getDeleteCache() {
+		return this.deleteCache;
+	}
+
+	public void addChangeTabListener(MouseAdapter eventMouse) {
+		getJTabbedPane().addMouseListener(eventMouse);
+	}
+
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/StyleTree.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/StyleTree.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/StyleTree.java	(revision 6892)
@@ -0,0 +1,339 @@
+/* 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.wizard;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.List;
+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.ogc.struct.WMTSStyle;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTheme;
+import org.gvsig.raster.wmts.swing.impl.wizard.WMTSParamsPanel.LayerUI;
+
+
+/**
+ * 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.
+	 */
+	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. 
+     */
+	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. 
+	 */
+	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.
+	 */
+	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) {
+				List<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;
+					}
+				}
+			}
+		}
+	}
+
+	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();
+    }
+
+	public boolean isLeaf(Object node) {
+		return (node instanceof WMTSStyle);
+	}
+
+	public void addTreeModelListener(TreeModelListener l) {
+	}
+
+	public void removeTreeModelListener(TreeModelListener l) {
+	}
+
+	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);
+	}
+
+	public int getIndexOfChild(Object parent, Object child) {
+		if (parent instanceof LayerUI && child instanceof WMTSStyle) {
+			List<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;
+	}
+
+	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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/StyleTree.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/StylesPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/StylesPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/StylesPanel.java	(revision 6892)
@@ -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.swing.impl.wizard;
+
+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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/wizard/StylesPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/main/java/org/gvsig/raster/wmts/swing/impl/DefaultWMTSSwingManager.java	(revision 6892)
@@ -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.swing.impl;
+
+import org.gvsig.raster.wmts.swing.AddServerPanel;
+import org.gvsig.raster.wmts.swing.NextPrevPanel;
+import org.gvsig.raster.wmts.swing.WMTSSwingManager;
+import org.gvsig.raster.wmts.swing.WMTSWindowManager;
+import org.gvsig.raster.wmts.swing.WMTSWizardListener;
+import org.gvsig.raster.wmts.swing.WmtsGUI;
+import org.gvsig.raster.wmts.swing.impl.panel.main.IServerPanel;
+import org.gvsig.raster.wmts.swing.impl.panel.main.NextPrevPanelImpl;
+import org.gvsig.raster.wmts.swing.impl.wizard.WMTSParamsPanel;
+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;
+
+    public DefaultWMTSSwingManager() {
+        this.i18nmanager = ToolsLocator.getI18nManager();       
+    }
+
+    public String getTranslation(String key) {
+        return this.i18nmanager.getTranslation(key);
+    }
+
+    public WMTSWindowManager getWindowManager() {
+        return wmtsWindowManager;
+    }
+
+    public void registerWindowManager(WMTSWindowManager windowManager) {
+        this.wmtsWindowManager = windowManager;        
+    }
+
+    public AddServerPanel createAddServerPanel() {
+    	return new IServerPanel();
+    }
+    
+    public NextPrevPanel createNextPrevPanel() {
+    	return new NextPrevPanelImpl();
+    }
+    
+    public WmtsGUI createMainWizard(WMTSWizardListener listener) {
+    	WMTSParamsPanel panel = new WMTSParamsPanel();
+    	panel.setListenerSupport(listener);
+    	return panel;
+    }
+
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/resources/org/gvsig/raster/wmts/swing/impl/i18n/text.properties
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/resources/org/gvsig/raster/wmts/swing/impl/i18n/text.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/resources/org/gvsig/raster/wmts/swing/impl/i18n/text.properties	(revision 6892)
@@ -0,0 +1,21 @@
+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.
+view_type=Tipo de vista
+layerlist_view_selection=Ver como lista de capas
+themes_view_selection=Ver como temas 
+view_not_disposable=No hay themas definidos en este servidor
+theme_without_reference=Tema sin capa referenciada. \n Selecciona desde la lista de capas.
+host_unreachable=No se puede conectar con el servidor. Tal vez la red est� desconectada o el servidor apagado.
+ip_unknown=Direcci�n IP desconocida
+network_error=Error en la conexi�n a red
+value_list=Lista de valores
+selected_value=Valor seleccionado
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/resources/org/gvsig/raster/wmts/swing/impl/i18n/text.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/resources/org/gvsig/raster/wmts/swing/impl/i18n/text_en.properties
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/resources/org/gvsig/raster/wmts/swing/impl/i18n/text_en.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/resources/org/gvsig/raster/wmts/swing/impl/i18n/text_en.properties	(revision 6892)
@@ -0,0 +1,21 @@
+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.
+view_type=View type
+layerlist_view_selection=View as layers list
+themes_view_selection=View as themes
+view_not_disposable=There are not themes defined in this server
+theme_without_reference=Theme without layer referenced.\n Select from the list of layers.
+host_unreachable=The host is unreachable. Maybe the network is not connected or the host off.
+ip_unknown=IP address unknown 
+network_error=Error with the network connection
+value_list=List of values
+selected_value=Selected value
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/resources/org/gvsig/raster/wmts/swing/impl/i18n/text_en.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestConnectPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestConnectPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestConnectPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.main;
+
+import javax.swing.JFrame;
+
+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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestConnectPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestNextPrevPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestNextPrevPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestNextPrevPanel.java	(revision 6892)
@@ -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.wmts.swing.impl.panel.main;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.wmts.swing.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 NextPrevPanelImpl();
+		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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestNextPrevPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestDescriptionPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestDescriptionPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestDescriptionPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.main;
+
+import javax.swing.JFrame;
+
+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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestDescriptionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestServerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestServerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestServerPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.main;
+
+import javax.swing.JFrame;
+
+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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/main/TestServerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestDimensionPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestDimensionPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestDimensionPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.dimension;
+
+import javax.swing.JFrame;
+
+public class TestDimensionPanel {
+	private int               w        = 510;
+	private int               h        = 90;
+	private JFrame            frame    = new JFrame();
+	private DimensionComboPanel      connect  = null;
+
+	public TestDimensionPanel() {
+		connect = new DimensionComboPanel();
+		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 TestDimensionPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestDimensionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestSelectedValuePanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestSelectedValuePanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestSelectedValuePanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.dimension;
+
+import javax.swing.JFrame;
+
+public class TestSelectedValuePanel {
+	private int                w        = 510;
+	private int                h        = 90;
+	private JFrame             frame    = new JFrame();
+	private SelectedValuePanel connect  = null;
+
+	public TestSelectedValuePanel() {
+		connect = new SelectedValuePanel();
+		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 TestSelectedValuePanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestSelectedValuePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestDimensionTabPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestDimensionTabPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestDimensionTabPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.dimension;
+
+import javax.swing.JFrame;
+
+public class TestDimensionTabPanel {
+	private int               w        = 510;
+	private int               h        = 610;
+	private JFrame            frame    = new JFrame();
+	private DimensionPanel       desc     = null;
+
+	public TestDimensionTabPanel() {
+		desc = new DimensionPanel();
+		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 TestDimensionTabPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestDimensionTabPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestValueListOfDimensionPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestValueListOfDimensionPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestValueListOfDimensionPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.dimension;
+
+import javax.swing.JFrame;
+
+public class TestValueListOfDimensionPanel {
+	private int                       w        = 510;
+	private int                       h        = 510;
+	private JFrame                    frame    = new JFrame();
+	private ValuesDimensionListPanel  desc     = null;
+
+	public TestValueListOfDimensionPanel() {
+		desc = new ValuesDimensionListPanel();
+		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 TestValueListOfDimensionPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/dimension/TestValueListOfDimensionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/format/TestFormatsPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/format/TestFormatsPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/format/TestFormatsPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.format;
+
+import javax.swing.JFrame;
+
+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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/format/TestFormatsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestILayerPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestILayerPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestILayerPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.layer;
+
+import javax.swing.JFrame;
+
+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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestILayerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestLayerListPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestLayerListPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestLayerListPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.layer;
+
+import javax.swing.JFrame;
+
+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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestLayerListPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestAddDelPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestAddDelPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestAddDelPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.panel.layer;
+
+import javax.swing.JFrame;
+
+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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/panel/layer/TestAddDelPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/wizard/TestStylesPanel.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/wizard/TestStylesPanel.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/wizard/TestStylesPanel.java	(revision 6892)
@@ -0,0 +1,40 @@
+/* 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.wmts.swing.impl.wizard;
+
+import javax.swing.JFrame;
+
+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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/src/test/java/org/gvsig/raster/wmts/swing/impl/wizard/TestStylesPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl/pom.xml	(revision 6892)
@@ -0,0 +1,65 @@
+<?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.2.43</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>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.wmts.ogc.api</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.wmts.ogc.impl</artifactId>
+			<scope>runtime</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.impl</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    <!--
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
+            <scope>runtime</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>
+		</dependency>
+	</dependencies>
+</project>

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


Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/org.gvsig.raster.wmts.swing.impl
___________________________________________________________________
Added: svn:ignore
   + target

.settings

.classpath

.project


Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/pom.xml	(revision 6892)
@@ -0,0 +1,40 @@
+<?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.2.43</version>
+	</parent>
+	<dependencies>
+	    <dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.wmts.io</artifactId>
+			<scope>compile</scope>
+		</dependency> 
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.andami</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.impl</artifactId>
+            <scope>runtime</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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.swing
___________________________________________________________________
Added: svn:ignore
   + .project
.settings


Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/pom.xml	(revision 6892)
@@ -0,0 +1,191 @@
+<?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</artifactId>
+		<version>2.2.43</version>
+	</parent>
+	
+	<dependencies>
+		<dependency>
+             <groupId>org.gvsig</groupId>
+             <artifactId>org.gvsig.raster.wmts.swing.api</artifactId>
+             <scope>compile</scope>
+        </dependency>
+        <dependency>
+             <groupId>org.gvsig</groupId>
+             <artifactId>org.gvsig.raster.wmts.swing.impl</artifactId>
+             <scope>runtime</scope>
+        </dependency>
+	   	<dependency>
+             <groupId>org.gvsig</groupId>
+             <artifactId>org.gvsig.about.api</artifactId>
+             <scope>compile</scope>
+        </dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.wmts.io</artifactId>
+        </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.app.mainplugin</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.lib.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.swing.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.fmap</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.lib.impl</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.metadata.lib.basic.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.wmts.ogc.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.wmts.ogc.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        
+        
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.operation</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.projection.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.projection.cresques.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.compat.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.compat.se</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.impl</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.file.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    <!--
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.operation</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+    -->
+	</dependencies>
+	
+	<properties>
+		<gvsig.package.info.state>final</gvsig.package.info.state>
+        <gvsig.package.info.dependencies>required: org.gvsig.raster.tilecache.app -ge 2, required: org.gvsig.raster.mainplugin -ge 2</gvsig.package.info.dependencies>
+        <gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/Raster/pool</gvsig.package.info.poolURL>
+        <gvsig.package.info.categories>OGC,Remote Services,Raster</gvsig.package.info.categories>
+        <gvsig.package.info.official>true</gvsig.package.info.official>
+	</properties>
+</project>

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/buildNumber.properties
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/buildNumber.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/buildNumber.properties	(revision 6892)
@@ -0,0 +1,2 @@
+#Fri May 05 20:04:22 CEST 2017
+buildNumber=95

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/buildNumber.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/dialog/TestPropsDialog.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/app/extension/wmtsclient/gui/dialog/TestPropsDialog.java	(revision 6892)
@@ -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.wizard.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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/wmts/io/TestWMTSDriver.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/wmts/io/TestWMTSDriver.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/test/java/org/gvsig/raster/wmts/io/TestWMTSDriver.java	(revision 6892)
@@ -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.coverage.exception.ConnectException;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.raster.wmts.ogc.struct.WMTSServiceIdentification;
+import org.gvsig.raster.wmts.ogc.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://v2.suite.opengeo.org/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.getOGCClient().getServiceIdentification();
+			String title = id.getTitle();
+			String version = id.getServiceTypeVersion();
+			String type = id.getServiceType();
+			
+			WMTSServiceProvider prov = explorer.getOGCClient().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 (ConnectException e) {
+			e.printStackTrace();
+		}
+		
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/assembly/gvsig-plugin-package.xml	(revision 6892)
@@ -0,0 +1,41 @@
+<assembly>
+  <id>gvsig-plugin-package</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <baseDirectory>${project.artifactId}</baseDirectory>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <files>
+    <file>
+      <source>target/${project.artifactId}-${project.version}.jar</source>
+      <outputDirectory>lib</outputDirectory>
+    </file>
+    <file>
+      <source>target/package.info</source>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>src/main/resources-plugin</directory>
+      <outputDirectory>.</outputDirectory>
+    </fileSet>
+  </fileSets>
+
+
+  <dependencySets>
+    <dependencySet>
+      <useProjectArtifact>false</useProjectArtifact>
+	  <useTransitiveDependencies>false</useTransitiveDependencies>
+      <outputDirectory>lib</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.raster.wmts.ogc.api:jar</include>
+				<include>org.gvsig:org.gvsig.raster.wmts.ogc.impl:jar</include>
+				<include>org.gvsig:org.gvsig.raster.wmts.swing.api:jar</include>
+				<include>org.gvsig:org.gvsig.raster.wmts.swing.impl:jar</include>
+	  </includes>
+	</dependencySet>
+  </dependencySets>
+</assembly>

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/assembly/gvsig-plugin-package.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSPropsTocMenuEntry.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSPropsTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSPropsTocMenuEntry.java	(revision 6892)
@@ -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;
+
+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.wizard.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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSPropsTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectIteratorWMTSInfo.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectIteratorWMTSInfo.java	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectSetWMTSInfo.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/DynObjectSetWMTSInfo.java	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java	(revision 6892)
@@ -0,0 +1,690 @@
+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.net.URI;
+import java.net.URISyntaxException;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+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.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+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.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+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.ColorInterpretation;
+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.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+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.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.fmap.legend.ImageLegend;
+import org.gvsig.raster.util.CancelTaskImpl;
+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.persistence.exception.PersistenceRuntimeException;
+import org.gvsig.tools.task.Cancellable;
+import org.gvsig.tools.task.SimpleTaskStatus;
+import org.gvsig.tools.task.TaskStatusManager;
+
+/**
+ * WMTS Layer class.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FLyrWMTS extends DefaultFLyrRaster implements IHasImageLegend {
+	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           wmtsExplorer              = null;
+	private boolean                      deleteCache               = false;
+
+	/**
+	 * Register the persistence
+	 */
+	public static void registerPersistent() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition("FLyrWMTS_Persistent");
+		if( definition == null ) {
+			if (manager.getDefinition(DefaultFLyrRaster.class) == null) {
+				DefaultFLyrRaster.registerPersistence();
+			}
+
+			definition = manager.addDefinition(
+					FLyrWMTS.class,
+					"FLyrWMTS_Persistent",
+					"FLyrWMTS Persistent Definition",
+					null,
+					null
+			);
+
+			definition.extend(PersistenceManager.PERSISTENCE_NAMESPACE, DefaultFLyrRaster.PERSISTENT_NAME);
+		}
+
+		DefaultFLyrRaster.registerPersistence(definition);
+	}
+
+	/**
+	 * Constructor
+	 */
+	public FLyrWMTS() {
+		super();
+		this.updateDrawVersion();
+		try {
+			enableAwake();
+		} catch (NotAvailableStateException e) {
+			logger.error("Fallo el estado de open. Closed=" + isClosed() + " Awake=" + isAwake(), this, e);
+		}
+	}
+
+	/**
+	 * @param host
+	 * @param srs
+	 * @return the data store
+	 * @throws InitializeException
+	 */
+	public static DataStore createDataStore(String host, IProjection srs) throws InitializeException {
+		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
+		RasterDataParameters params = null;
+		try {
+			params = (RasterDataParameters)dataman.createServerExplorerParameters(WMTSServerExplorer.NAME);
+		} catch (InitializeException e) {
+			return null;
+		} catch (ProviderNotRegisteredException e) {
+			return null;
+		}
+		URI hostURI;
+        try {
+            hostURI = new URI(host);
+        } catch (URISyntaxException e1) {
+            logger.warn("Can't create URI from "+host, e1);
+            throw new InitializeException(e1);
+        }
+		params.setURI(hostURI);
+		params.setSRS(srs);
+
+		try {
+			return dataman.openStore(params.getDataStoreName(), params);
+		} catch (ValidateDataParametersException e) {
+			throw new InitializeException(e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new InitializeException(e);
+		}
+	}
+
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		try {
+			super.loadFromState(state);
+
+			/*
+			 * Needs to initialize variables using methods on setDataStore method of this class
+			 */
+			this.setDataStore(getDataStore());
+			//this.setParameters(getDataStore().getParameters());
+		}catch (PersistenceRuntimeException e) {
+			logger.debug("Unable to load store from persistence in layer: " + this.getName(), e);
+			this.setAvailable(false);
+			return;
+		} catch (LoadLayerException e) {
+			logger.debug("Unable to load store to layer: " + this.getName(), e);
+			this.setAvailable(false);
+			return;
+//		} catch (InitializeException e) {
+//			logger.debug("Unable to load store parameters to layer: " + this.getName(), e);
+//			this.setAvailable(false);
+//			return;
+		}
+
+	}
+
+	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);
+		}
+        if (this.dataStore != null) {
+            setProjection(this.dataStore.getProjection());
+            setFullExtent(this.dataStore.getExtent().toRectangle2D());
+        }
+	}
+
+	@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();
+				try {
+					if(!isOpen())
+						enableOpen();
+				} catch (NotAvailableStateException e) {
+					throw new ReadException("Fallo el estado de open. Closed=" + isClosed() + " Awake=" + isAwake(), e);
+				}
+			} catch (FilePaletteException e) {
+				throw new ReadException(e.getMessage(), e);
+			}
+			firstLoad = true;
+		}
+
+		enableStopped();
+
+		if (isWithinScale(scale)) {
+		    Envelope adjustedExtent = viewPort.getAdjustedEnvelope();
+			if (!adjustedExtent.intersects(getFullEnvelope())) {
+				return;
+			}
+			Extent ext = rManager.getDataStructFactory().createExtent(
+					adjustedExtent.getLowerCorner().getX(),
+					adjustedExtent.getUpperCorner().getY(),
+					adjustedExtent.getUpperCorner().getX(),
+					adjustedExtent.getLowerCorner().getY());
+			Dimension imgSz = viewPort.getImageSize();
+			ViewPortData vp2 = rManager.getDataStructFactory().createViewPortData(viewPort.getProjection(), ext, imgSz );
+			vp2.setMat(viewPort.getAffineTransform());
+			vp2.setDPI((int)viewPort.getDPI());
+
+			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 (ProcessInterruptedException e) {
+				throw new ReadException("Problems drawing this layer: " + e.getMessage(), e);
+			} catch (QueryException e) {
+				throw new ReadException("Problems drawing this layer: " + e.getMessage(), e);
+			} finally {
+				taskStatus.terminate();
+			}
+		}
+		disableStopped();
+	}
+
+
+	/**
+	 * @param g
+	 * @param viewPort
+	 * @param cancel
+	 * @param scale
+	 * @param properties
+	 * @throws ReadException
+	 * @see com.iver.cit.gvsig.fmap.layers.FLayer#print(java.awt.Graphics2D,
+	 * 		com.iver.cit.gvsig.fmap.ViewPort,
+	 * 		com.iver.cit.gvsig.fmap.operations.Cancellable)
+	 */
+	public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties)
+	throws ReadException {
+
+
+	}
+
+	/**
+	 * @param g
+	 * @param viewPort
+	 * @param cancel
+	 * @param scale
+	 * @throws ReadException
+	 */
+	public void _print(Graphics2D g, ViewPort viewPort, Cancellable cancel,	double scale) throws ReadException {
+		draw(null, g, viewPort, cancel,scale);
+	}
+
+	/**
+	 * 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 envelope
+	 *
+	 */
+	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();
+	}
+
+	/**
+	 * @return the properties.
+	 */
+	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";
+	}
+
+	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);
+	}
+
+	public ILegend getLegend() {
+		if(getDataStore() != null)
+			return new ImageLegend(getDataStore().getImageLegend());
+		return null;
+	}
+
+	public boolean isRemote() {
+		return true;
+	}
+
+	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;
+	}
+
+	@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;
+
+	}
+
+	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 {
+
+        org.gvsig.fmap.geom.primitive.Point pReal = getMapContext().getViewPort().convertToMapPoint(p);
+    	String fInfo = null;
+    	try {
+    		fInfo = getDataStore().getInfoByPoint(pReal.getX(), pReal.getY(), new CancelTaskImpl(cancel));
+    	} 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().getPath());
+			}
+
+			if(params instanceof TileDataParameters) {
+				DataParameters p = ((TileDataParameters) params).getDataParameters();
+				if(p instanceof WMTSDataParameters) {
+					this.setName(((WMTSDataParameters) p).getURI().getPath());
+				}
+			}
+
+		} 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);
+		}
+    }
+
+    /**
+     * @return the data store parameters
+     */
+    @SuppressWarnings("deprecation")
+	public DataStoreParameters getParameters() {
+    	if(params == null) {
+    		DataManager datamanager = DALLocator.getDataManager();
+			WMTSServerExplorerParameters explorerParams = null;
+			try {
+				explorerParams = (WMTSServerExplorerParameters) datamanager.createServerExplorerParameters(WMTSServerExplorer.NAME);
+				explorerParams.setHost("");
+				wmtsExplorer = (WMTSServerExplorer) datamanager.createServerExplorer(explorerParams);
+				params = wmtsExplorer.getStoredParameters();
+			} 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.wmtsExplorer = explorer;
+    }
+
+    /**
+     * Gets the explorer
+     * @return the server explorer
+     */
+    public WMTSServerExplorer getExplorer() {
+    	return this.wmtsExplorer;
+    }
+
+	public Image getImageLegend() {
+		return dataStore.getImageLegend();
+	}
+
+	public String getPathImage() {
+		return null;
+	}
+
+	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.wmtsExplorer = wmtsExplorer;
+
+		List<RasterFilter> filters = getRender().getFilterList().getStatusCloned();
+
+		//Hacemos una copia de las bandas a renderizar
+		ColorInterpretation ci = getRender().getRenderColorInterpretation();
+		if(ci != null) {
+			newLayer.getRender().setRenderColorInterpretation(ci.cloneColorInterpretation());
+		}
+
+		//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
+		NoData nd = (NoData)getNoDataValue().clone();
+		newLayer.setNoDataValue(nd);
+		newLayer.enableOpen();
+
+		return newLayer;
+	}
+
+	/**
+	 * Assigns the flag to delete this layer from the cache
+	 * @param deleteCache
+	 */
+	public void deleteCache(boolean deleteCache) {
+		this.deleteCache = deleteCache;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSWizard.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSWizard.java	(revision 6892)
@@ -0,0 +1,535 @@
+/* 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.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.prefs.Preferences;
+
+import javax.swing.JOptionPane;
+
+import org.apache.commons.io.IOUtils;
+import org.cresques.cts.IProjection;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.PluginsLocator;
+import org.gvsig.andami.PluginsManager;
+import org.gvsig.andami.persistence.serverData.ServerDataPersistence;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.gui.WizardPanel;
+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.exception.ConnectException;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+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.util.CancelTaskImpl;
+import org.gvsig.raster.wmts.app.wmtsclient.WMTSClientExtension;
+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.raster.wmts.ogc.struct.WMTSServiceIdentification;
+import org.gvsig.raster.wmts.swing.AddServerPanel;
+import org.gvsig.raster.wmts.swing.NextPrevPanel;
+import org.gvsig.raster.wmts.swing.WMTSSwingLocator;
+import org.gvsig.raster.wmts.swing.WMTSWizardListener;
+import org.gvsig.raster.wmts.swing.WmtsGUI;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.utils.swing.jcomboServer.ServerData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 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                 = LoggerFactory.getLogger(WMTSWizard.class);
+	private String                        pluginName             = "org.gvsig.raster.wmts.app.wmtsclient";
+	private File                          pluginPersistenceFile  = null;
+	private File                          serverPropertiesFile   = null;
+	private ServerDataPersistence         serverDataPersistence  = null;
+	private String                        serversPropsFilename       = "servers.properties";
+
+	protected int                         page                   = 0;
+	protected boolean                     connected              = false;
+	private AddServerPanel                serverPanel            = null;
+	private NextPrevPanel                 nextPrevPanel          = null;
+	protected WmtsGUI                     wmtsParamsPanel        = null;
+
+	private WMTSWizardListenerImpl        listenerSupport        = 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;
+
+    private PluginServices plugin = null;
+
+	public class WMTSWizardListenerImpl implements WMTSWizardListener {
+
+		public void correctlyConfiguredEvent(boolean finishable) {
+			callStateChanged(finishable);
+		}
+
+		public void addLayerEvent() {
+			activarVisualizarBotones();
+		}
+
+		public void removeLayerEvent() {
+			activarVisualizarBotones();
+		}
+	}
+
+	/**
+	 * 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() {
+        PluginsManager pluginsManager = PluginsLocator.getManager();
+        this.plugin = pluginsManager.getPlugin(WMTSClientExtension.class);
+
+		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();
+		getIserverPanel().getTxtHost().setServerList(getServerDataPersistence().getArrayOfServerData());
+	}
+
+	/**
+	 * 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 getPanelPage2().isCorrectlyConfigured();
+	}
+
+	private WMTSWizardListenerImpl getWizardListenerSupport() {
+		if(listenerSupport == null) {
+			listenerSupport = new WMTSWizardListenerImpl();
+		}
+		return listenerSupport;
+	}
+
+	/**
+	 * 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() {
+	    	if(!checkHostAndNetwork())
+	    		return;
+
+	    	try {
+	    		explorer.connect(cancel);
+	    		saveServerListFromComboBox();
+			} catch (ConnectException e) {
+				getIserverPanel().setTextInfo("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.getStoredParameters();
+			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();
+	    }
+	}
+
+	/**
+	 * Checks if the network and host are reachable
+	 * @return true if both are reachable and false if they are not
+	 */
+	private boolean checkHostAndNetwork() {
+		if(!explorer.isHostReachable()) {
+			JOptionPane.showMessageDialog(null, Messages.getText("host_unreachable"), Messages.getText("Error"), JOptionPane.ERROR_MESSAGE);
+			getIserverPanel().setTextInfo("Connection closed... \n");
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	private void rellenarControles() {
+		try {
+			String host = getIserverPanel().getTxtHost().getModel().getSelectedItem().toString();
+			WMTSServiceIdentification id = explorer.getOGCClient().getServiceIdentification();
+
+			getIserverPanel().setTitle(id.getTitle());
+			getNextPrevPanel().getJLabelServerTypeValue().setText(id.getServiceType());
+			getIserverPanel().setTextInfo(id.getAbstract());
+
+			getPanelPage2().setWizardData(explorer);
+			connected = true;
+			activarVisualizarBotones();
+		} catch (Exception e) {
+			if (e.getMessage() == null) {
+				getIserverPanel().setTextInfo(Messages.getText("error"));
+			} else {
+				getIserverPanel().setTextInfo(e.getMessage());
+			}
+			getNextPrevPanel().getBtnNext().setEnabled(false);
+			getNextPrevPanel().getBtnPrev().setEnabled(true);
+		} finally {
+			getIserverPanel().getBtnCancel().setEnabled(false);
+		}
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == getIserverPanel().getBtnConnect()) {
+			getIserverPanel().getBtnCancel().setEnabled(true);
+			getIserverPanel().setTextInfo("Trying to connect...");
+
+			String host = getIserverPanel().getTxtHost().getModel().getSelectedItem().toString();
+			try {
+				DataManager datamanager = DALLocator.getDataManager();
+				WMTSServerExplorerParameters explorerParams = (WMTSServerExplorerParameters) datamanager.createServerExplorerParameters(WMTSServerExplorer.NAME);
+				explorerParams.setHost(host);
+				explorerParams.setLongitudeFirst(getIserverPanel().getChkInvertAxisOrder().isSelected());
+
+				explorer = (WMTSServerExplorer) datamanager.createServerExplorer(explorerParams);
+
+				((CancelTaskImpl)cancel).setCanceled(false);
+				new ConnectThread(cancel, explorer, this).start();
+
+			} catch (InitializeException e1) {
+				getIserverPanel().setTextInfo("Error creating WMTS layer");
+			} catch (ProviderNotRegisteredException e1) {
+				getIserverPanel().setTextInfo("Provider not registered. I cannot connect.");
+			} catch (ValidateDataParametersException e1) {
+				getIserverPanel().setTextInfo("Parameters not valid. I cannot connect.");
+			}
+		}
+
+		if(e.getSource() == getIserverPanel().getBtnCancel()) {
+			getIserverPanel().setTextInfo("Cancelled...");
+			((CancelTaskImpl)cancel).setCanceled(true);
+			getIserverPanel().getBtnCancel().setEnabled(false);
+		}
+
+		if(e.getSource() == getNextPrevPanel().getBtnPrev()) {
+			page --;
+			if (page > firstPage) {
+				getPanelPage2().setPreviousTab();
+				page = getPanelPage2().currentPage() + 1;
+				activarVisualizarBotones();
+			} else if (page == firstPage){
+				activarVisualizarBotones();
+				page = firstPage +1;
+				getIserverPanel().setTitle("-");
+				getIserverPanel().setTextInfo("");
+				getPanelPage2().setPreviousTab();
+				getIserverPanel().setVisible(true);
+				getPanelPage2().setVisible(false);
+				getNextPrevPanel().getBtnNext().setEnabled(false);
+				connected = false;
+			}
+			//getWizardListenerSupport().callStateChanged(getPanelPage2().isCorrectlyConfigured());
+		}
+
+		if(e.getSource() == getNextPrevPanel().getBtnNext()) {
+			if (page > firstPage) {
+				// si page es mayor que cero, vamos enfocando las
+				// sucesivas SOLAPAS del WMTSParamsPanel
+				getPanelPage2().setNextTab();
+				page = getPanelPage2().currentPage();
+			}
+			page++;
+			getIserverPanel().setVisible(false);
+			getPanelPage2().setVisible(true);
+			activarVisualizarBotones();
+		}
+	}
+
+	private AddServerPanel getIserverPanel() {
+		if (serverPanel == null) {
+			serverPanel = WMTSSwingLocator.getSwingManager().createAddServerPanel();
+			serverPanel.getBtnCancel().addActionListener(this);
+			serverPanel.getBtnConnect().addActionListener(this);
+		}
+		return serverPanel;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public NextPrevPanel getNextPrevPanel() {
+		if (nextPrevPanel == null) {
+			nextPrevPanel = WMTSSwingLocator.getSwingManager().createNextPrevPanel();
+			nextPrevPanel.getBtnNext().addActionListener(this);
+			nextPrevPanel.getBtnPrev().addActionListener(this);
+		}
+		return nextPrevPanel;
+	}
+
+
+	protected WmtsGUI getPanelPage2() {
+		if (wmtsParamsPanel == null){
+			wmtsParamsPanel = WMTSSwingLocator.getSwingManager().createMainWizard(getWizardListenerSupport());
+			wmtsParamsPanel.addChangeTabListener(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) {
+			getNextPrevPanel().getBtnPrev().setEnabled(false);
+
+			if (connected) {
+				getNextPrevPanel().getBtnNext().setEnabled(true);
+			} else {
+				getNextPrevPanel().getBtnNext().setEnabled(false);
+			}
+		} else if (page < getPanelPage2().getNumTabs()) {
+			getNextPrevPanel().getBtnNext().setEnabled(true);
+			getNextPrevPanel().getBtnPrev().setEnabled(true);
+			if (getPanelPage2().nextEnabledPage() == -1) {
+				getNextPrevPanel().getBtnNext().setEnabled(false);
+			}
+			//getWizardListenerSupport().callStateChanged(getPanelPage2().isCorrectlyConfigured());
+		} else if (page == getPanelPage2().getNumTabs()) {
+			getNextPrevPanel().getBtnNext().setEnabled(false);
+			//getWizardListenerSupport().callStateChanged(getPanelPage2().isCorrectlyConfigured());
+		}
+	}
+
+	/**
+	 * Gets the list of servers that have been persisted or added in the properties file
+	 * @return
+	 */
+	private ServerDataPersistence getServerDataPersistence() {
+        DynObject pluginProperties = this.plugin.getPluginProperties();
+        ServerDataPersistence servers =  (ServerDataPersistence) pluginProperties.getDynValue("servers");
+
+        if( servers == null || servers.isEmpty() ) {
+            if( servers == null ) {
+                servers = new ServerDataPersistence(ServerData.SERVER_TYPE_WMTS);
+                pluginProperties.setDynValue("servers", servers);
+            }
+            //Lee los servidores del properties y los mezcla con los que hay en la persistencia
+            Properties prop = new Properties();
+            File propFile = new File(this.plugin.getPluginDirectory(),serversPropsFilename);
+            FileInputStream fis = null;
+            try {
+                    fis = new FileInputStream(propFile);
+                    prop.load(fis);
+            } catch (FileNotFoundException e) {
+                    logger.info("Properties file '"+propFile.getAbsolutePath()+"' not found", e);
+            } catch (IOException e) {
+                    logger.info("Error reading properties file '"+propFile.getAbsolutePath()+"'.", e);
+            } finally {
+                IOUtils.closeQuietly(fis);
+            }
+
+            for (int i = 0; i < prop.size(); i++) {
+                Object value = prop.get("server[" + i + "]");
+                servers.addServerData(new ServerData(value.toString(), ServerData.SERVER_TYPE_WMTS));
+            }
+
+        }
+        return servers;
+
+
+	}
+
+	/**
+	 * Saves the list of server reading from the <code>ComboBox</code>
+	 */
+	private void saveServerListFromComboBox() {
+        ServerDataPersistence persistence = getServerDataPersistence();
+		String urlSelected = getIserverPanel().getTxtHost().getModel().getSelectedItem().toString();
+
+		boolean isSelectedInModel = false;
+		for (int i = 0; i < getIserverPanel().getTxtHost().getItemCount(); i++) {
+			String url = getIserverPanel().getTxtHost().getItemAt(i).toString();
+			persistence.addServerData(new ServerData(url, ServerData.SERVER_TYPE_WMTS));
+			if(url.equals(urlSelected)) {
+				isSelectedInModel = true;
+			}
+		}
+
+		if(!isSelectedInModel)
+			persistence.addServerData(new ServerData(urlSelected, ServerData.SERVER_TYPE_WMTS));
+
+	}
+
+	/**
+	 * 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 ((getIserverPanel().getTxtHost() == null)|| (getIserverPanel().getTxtHost().getModel().getSelectedItem() == null)) {
+				return new URL(explorer.getHost());
+			} else {
+				return new URL(getIserverPanel().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 {
+			getPanelPage2().setDeleteCache(getIserverPanel().getChkCaching().isSelected());
+			RasterDataParameters[] paramsList = getPanelPage2().getDataParameters();
+			List<FLyrWMTS> lyrList = getLayerList(paramsList);
+			for (int i = 0; i < lyrList.size(); i++) {
+				getMapCtrl().getMapContext().getLayers().addLayer(lyrList.get(i));
+			}
+		} catch (LoadLayerException e) {
+			logger.info("Persistence file not found for WMS plugin", e);
+		}
+	}
+
+	public List<FLyrWMTS> getLayerList(RasterDataParameters[] paramsList) throws LoadLayerException {
+		List<FLyrWMTS> layerList = new ArrayList<FLyrWMTS>();
+		for (int i = 0; i < paramsList.length; i++) {
+			FLyrWMTS layer = new FLyrWMTS();
+			layer.deleteCache(getPanelPage2().getDeleteCache());
+			try {
+				layer.setParameters(paramsList[i]);
+				String title = null;
+				if(paramsList[i] instanceof WMTSDataParameters) {
+					title = ((WMTSDataParameters) paramsList[i]).getLayer().getTitle();
+				} else if(paramsList[i] instanceof TileDataParameters) {
+					DataParameters p = ((TileDataParameters) paramsList[i]).getDataParameters();
+					if(p instanceof WMTSDataParameters)
+						title = ((WMTSDataParameters) p).getLayer().getTitle();
+				}
+
+				layer.setName(title);
+				layer.setExplorer(explorer);
+				//Ojo! Pruebas!
+				//layer.setTileServer(FileTileServer.class);
+				layerList.add(layer);
+			} catch (InitializeException e) {
+				throw new LoadLayerException("Error initializating layer", e);
+			}
+		}
+		return layerList;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSPropsDialog.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSPropsDialog.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/gui/wizard/WMTSPropsDialog.java	(revision 6892)
@@ -0,0 +1,312 @@
+/* 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.BorderLayout;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+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.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.coverage.exception.ConnectException;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+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.swing.RasterSwingLibrary;
+import org.gvsig.raster.util.CancelTaskImpl;
+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.swing.WMTSSwingLocator;
+import org.gvsig.raster.wmts.swing.WMTSWizardListener;
+import org.gvsig.raster.wmts.swing.WmtsGUI;
+
+
+/**
+ * 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 WmtsGUI                   wmtsGUIInterface      = null;
+    private WMTSServerExplorer        explorer              = null;
+    
+    public class WizardListenerImpl implements WMTSWizardListener {
+		public void correctlyConfiguredEvent(boolean finishable) {
+			getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(finishable);
+			getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(finishable);
+		}
+
+		public void addLayerEvent() {
+		}
+
+		public void removeLayerEvent() {
+		}
+	}
+
+
+    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);
+		setLayout(new BorderLayout());
+        this.add(wmtsGUIInterface, 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 WmtsGUI getParamsPanel(HashMap<String, Object> info) {
+		if (info == null) {
+			WmtsGUI toc = WMTSSwingLocator.getSwingManager().createMainWizard(new WizardListenerImpl());
+			return toc;
+		}
+
+		try {
+			if(explorer == null) {
+				explorer = ((FLyrWMTS)fLayer).getExplorer();
+
+				try {
+					explorer.connect(new CancelTaskImpl());
+				} catch (ConnectException e) {
+					RasterSwingLibrary.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 {
+			WmtsGUI toc = WMTSSwingLocator.getSwingManager().createMainWizard(new WizardListenerImpl());
+			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 {
+//
+//        public CommandListener(WMTSPropsDialog tp) {
+//        }
+//
+//        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 List<FLyrWMTS> getLayerList(RasterDataParameters[] paramsList) throws LoadLayerException {
+		List<FLyrWMTS> layerList = new ArrayList<FLyrWMTS>();
+		for (int i = 0; i < paramsList.length; i++) {
+			FLyrWMTS layer = new FLyrWMTS();
+			layer.deleteCache(wmtsGUIInterface.getDeleteCache());
+			try {
+				layer.setParameters(paramsList[i]);
+				String title = null;
+				if(paramsList[i] instanceof WMTSDataParameters) {
+					title = ((WMTSDataParameters) paramsList[i]).getLayer().getTitle();
+				} else if(paramsList[i] instanceof TileDataParameters) {
+					DataParameters p = ((TileDataParameters) paramsList[i]).getDataParameters();
+					if(p instanceof WMTSDataParameters)
+						title = ((WMTSDataParameters) p).getLayer().getTitle();
+				}
+				
+				layer.setName(title);
+				layer.setExplorer(explorer);
+				layerList.add(layer);
+			} catch (InitializeException e) {
+				throw new LoadLayerException("Error initializating layer", e);
+			}
+		}
+		return layerList;
+	}
+
+	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 {
+    			List<FLyrWMTS> layerList = getLayerList(wmtsGUIInterface.getDataParameters());
+    			if(layerList.size() > 0 && layerList.get(0) != null) {
+    				for (int i = 0; i < layerList.size(); i++) {
+    					if(layerList.get(i) instanceof FLyrWMTS) {
+    						mapCtrl.getMapContext().getLayers().removeLayer(fLayer);
+    						mapCtrl.getMapContext().getLayers().addLayer(layerList.get(i));
+    						fLayer = (FLyrWMTS)layerList.get(i);
+    					}
+    				}
+    			}
+    			//removeDuplicate(layerList, mapCtrl);
+    			mapCtrl.getMapContext().invalidate();
+    		} catch (LoadLayerException exc) {
+    			exc.printStackTrace();
+    		}
+		}
+		
+		if(	e.getButton() == ButtonsPanel.BUTTON_CLOSE ||
+			e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			close();
+		}
+	}
+
+} 

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSClientExtension.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSClientExtension.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/WMTSClientExtension.java	(revision 6892)
@@ -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;
+
+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.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 {
+	
+    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();
+    }
+    
+	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);
+		IconThemeHelper.registerIcon(null, "aplication-preferences-downarrow", this);
+		IconThemeHelper.registerIcon(null, "aplication-preferences-uparrow", this);
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/about/logo.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/about/wmts-about.html
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/about/wmts-about.html	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/about/wmts-about.html	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/about/wmts-about.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/about/Thumbs.db
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/plugin-persistence.def
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/plugin-persistence.def	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/plugin-persistence.def	(revision 6892)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!--
+Definitions of plugin persistence org.gvsig.raster.wmts.app.wmstclient.
+ -->
+<definitions>
+  <version>1.0.0</version>
+  <classes>
+    <class name="org.gvsig.raster.wmts.app.wmtsclient">
+      <description>Persistence definition for the WMTS client plugin</description>
+      <fields>
+        <field name="servers" type="object" classOfValue="org.gvsig.andami.persistence.serverData.ServerDataPersistence" mandatory="false">
+          <description>List of WMTS servers</description>
+        </field>
+      </fields>
+    </class>
+  </classes>
+</definitions>
Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/text.properties
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/text.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/text.properties	(revision 6892)
@@ -0,0 +1,19 @@
+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.
+view_type=Tipo de vista
+layerlist_view_selection=Ver como lista de capas
+themes_view_selection=Ver como temas 
+view_not_disposable=No hay themas definidos en este servidor
+theme_without_reference=Tema sin capa referenciada. \n Selecciona desde la lista de capas.
+host_unreachable=No se puede conectar con el servidor. Tal vez la red est� desconectada o el servidor apagado.
+ip_unknown=Direcci�n IP desconocida
+network_error=Error en la conexi�n a red
\ No newline at end of file

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/text_en.properties
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/text_en.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/text_en.properties	(revision 6892)
@@ -0,0 +1,19 @@
+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.
+view_type=View type
+layerlist_view_selection=View as layers list
+themes_view_selection=View as themes
+view_not_disposable=There are not themes defined in this server
+theme_without_reference=Theme without layer referenced.\n Select from the list of layers.
+host_unreachable=The host is unreachable. Maybe the network is not connected or the host off.
+ip_unknown=IP address unknown 
+network_error=Error with the network connection
\ No newline at end of file

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/config.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/config.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/config.xml	(revision 6892)
@@ -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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/config.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/servers.properties
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/servers.properties	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/servers.properties	(revision 6892)
@@ -0,0 +1,2 @@
+server[0]=http://v2.suite.opengeo.org/geoserver/gwc/service/wmts/
+server[1]=http://maps.opengeo.org/geowebcache/service/wmts
\ No newline at end of file

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/images/aplication-preferences-downarrow.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/images/aplication-preferences-downarrow.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/images/level-plus.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/images/icon-layer-wmts.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/images/level-less.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/images/aplication-preferences-uparrow.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient/src/main/resources-plugin/images/aplication-preferences-uparrow.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream


Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.app.wmtsclient
___________________________________________________________________
Added: svn:ignore
   + .settings

target

.classpath

.project


Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/pom.xml	(revision 6892)
@@ -0,0 +1,25 @@
+<?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.2.43</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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSResourceURL.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSResourceURL.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSResourceURL.java	(revision 6892)
@@ -0,0 +1,42 @@
+/* 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.ogc.struct;
+
+import java.io.IOException;
+
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface WMTSResourceURL {
+
+	public void parse(KXmlParser parser) throws IOException, XmlPullParserException;
+	
+	public String getTemplate();
+	
+	public String getFormat();
+	
+	public String getResourceType();
+
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSResourceURL.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSServiceIdentification.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSServiceIdentification.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSServiceIdentification.java	(revision 6892)
@@ -0,0 +1,23 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+import java.util.List;
+
+
+public interface WMTSServiceIdentification {
+	
+	public String getServiceType();
+	
+	public String getServiceTypeVersion();
+
+	public String getProfile();
+
+	public String getFees();
+
+	public String getAccessConstraints();
+	
+	public String getTitle();
+	
+	public String getAbstract();
+	
+	public List<String> getKeywords();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSServiceIdentification.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSServiceProvider.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSServiceProvider.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSServiceProvider.java	(revision 6892)
@@ -0,0 +1,10 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+public interface WMTSServiceProvider {
+	
+	public String getProviderName();
+	
+	public String getProviderSite();
+
+	public String getServiceContact();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSServiceProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSLayer.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSLayer.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSLayer.java	(revision 6892)
@@ -0,0 +1,72 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+import java.awt.geom.Rectangle2D;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.WMTSStatus;
+
+
+public interface WMTSLayer {
+	public WMTSBoundingBox getWGS84BBox();
+	
+	public Rectangle2D getWGS84BBoxTransformed(String epsg);
+	
+	public String getMetadata();
+	
+	public List<String> getFormat();
+	
+	public List<String> getInfoFormat();
+	
+	public List<String> getKeywords();
+	
+	public abstract WMTSBoundingBox getBBox();
+
+	public List<WMTSStyle> getStyle();
+
+	public List<WMTSTileMatrixSetLink> getTileMatrixSetLink();
+	
+	/**
+	 * Returns the initial level of this layer inside the matrix set. 
+	 * @return
+	 */
+	public int getInitialLevel(String tileMatrixSetId);
+
+	/**
+	 * Gets the list of srs's supported
+	 * @return
+	 */
+	public List<String> getSrsList();
+
+	public String getIdentifier();
+
+	public String getTitle();
+
+	public String getAbstract();
+	
+	public List<WMTSResourceURL> getResourceURL();
+	
+	/**
+	 * Gets dimensions
+	 * @return
+	 */
+	public List<WMTSDimension> getDimensions();
+	
+	/**
+	 * If the layer has a template to build the URL, this method checks whether
+	 * the format requested needs a template. If the template is needed the entire 
+	 * URL will be returned.
+	 * @param defaultDimension. If this parameter is null, the default dimension will be used
+	 * Parameters needed
+	 * <UL>
+	 * <LI> Image format: Format to check if supports templates</LI>
+	 * <LI> Style identifier: Format to check if supports templates</LI>
+	 * <LI> Dimension: Parameter to build the URL replacing the dimension label</LI>
+	 * <LI> Tilematrixset: Parameter to build the URL replacing {TileMatrixSet}</LI>
+	 * <LI> tilematrix: Parameter to build the URL replacing {TileMatrix}</LI>
+	 * <LI> Tilerow: Parameter to build the URL replacing {TileRow}</LI>
+	 * <LI> Tilecol: Parameter to build the URL replacing {TileCol}</LI>
+	 * </UL>
+	 * @return
+	 */
+	public void buildResourceURLListFromTemplate(WMTSStatus status);
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSLayer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixSetLink.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixSetLink.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixSetLink.java	(revision 6892)
@@ -0,0 +1,20 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+import java.util.List;
+
+
+public interface WMTSTileMatrixSetLink {
+	/**
+	 * Gets the <code>WMTSTileMatrixSet</code>
+	 * @return
+	 */
+	public WMTSTileMatrixSet getTileMatrixSet();
+	
+	/**
+	 * Gets the list of limits of this <code>WMTSTileMatrixSetLink</code>
+	 * @return
+	 */
+	public List<WMTSTileMatrixLimits> getTileMatrixLimits();
+	
+	public String getTileMatrixSetId();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixSetLink.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSBoundingBox.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSBoundingBox.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSBoundingBox.java	(revision 6892)
@@ -0,0 +1,18 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+import java.awt.geom.Rectangle2D;
+
+public interface WMTSBoundingBox {
+	
+	public Rectangle2D toRectangle2D();
+	
+	public double[] getLowerCorner();
+	
+	public double[] getUpperCorner();
+	
+	public String getCrs();
+	
+	public int getDimensions();
+	
+	public boolean isValid();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSBoundingBox.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSLegendURL.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSLegendURL.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSLegendURL.java	(revision 6892)
@@ -0,0 +1,16 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+public interface WMTSLegendURL {
+	
+	public int getWidth();
+	
+	public int getHeight();
+	
+	public double getMinScaleDenominator();
+	
+	public double getMaxScaleDenominator();
+	
+	public String getFormat();
+	
+	public String getHref();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSLegendURL.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrix.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrix.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrix.java	(revision 6892)
@@ -0,0 +1,67 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.List;
+
+public interface WMTSTileMatrix {
+	/**
+	 * Sets longitude first in the axis order read from the capabilities file
+	 * @param force
+	 */
+	//public void setForceLongitudeFirstAxisOrder(boolean force);
+	
+	public Rectangle2D getBBoxTileMatrixSet();
+  
+	public double getScaleDenominator();
+
+	public int getTileWidth();
+
+	public int getTileHeight();
+
+	public long getMatrixWidth();
+	
+	public long getMatrixHeight();
+
+	public double[] getTopLeftCorner();
+	
+	public String getIdentifier();
+    
+    /**
+     * Gets the width in world coordinates of a tile
+     * @return
+     */
+    public double getWidthWCTile(boolean projected);
+    
+    /**
+     * Gets the height in world coordinates of a tile
+     * @return
+     */
+    public double getHeightWCTile(boolean projected);
+    
+    /**
+     * This function will check if the request coordinates intersects with the tiles in the matrix. If a tile
+     * intersects then this will be added to the list.
+     * @deprecated this method was for grid subsets.   
+     */
+	public List<WMTSTile> intersects(boolean projected, WMTSTileMatrixLimits tileMatrixLimits, Rectangle2D request, Rectangle2D extentLayer);
+    
+    /**
+     * This function will check if the request coordinates intersects with the tiles in the matrix. If a tile
+     * intersects then this will be added to the list.  
+     */
+	public List<WMTSTile> intersects(boolean projected, Rectangle2D request, Rectangle2D extentLayer);
+	
+    
+    /**
+     * This function will check if the request coordinates intersects with the tiles in the matrix. If a tile
+     * intersects then this will be added to the list.  
+     */
+	public List<WMTSTile> contains(boolean projected, Point2D point, Rectangle2D extentLayer);
+    
+    /**
+     * This function will check if the request coordinates intersects with the tiles in the matrix. If a tile
+     * intersects then this will be added to the list.  
+     */
+	public List<WMTSTile> contains(boolean projected, WMTSTileMatrixLimits tileMatrixLimits, Point2D point, Rectangle2D extentLayer);
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrix.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSOperationsMetadata.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSOperationsMetadata.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSOperationsMetadata.java	(revision 6892)
@@ -0,0 +1,32 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+import java.util.Hashtable;
+
+public interface WMTSOperationsMetadata {
+	/**
+	 * Gets the online resource for a concrete operation.
+	 * The default protocol is GET
+	 * @param operation
+	 * The operation
+	 * @return The online resource
+	 */
+	public String getOnlineResource(String operation);
+	
+	/**
+	 * Gets the online resource for the protocols GET and POST
+	 * @param operation
+	 * The operation
+	 * @param protocol
+	 * @return The online resource
+	 */
+	public String getOnlineResource(String operation, int protocol);
+
+	/**
+	 * Get a hash map with the supported operations
+	 * @return
+	 */
+	public Hashtable<String, String> getSupportedOperationsByName();
+
+	public boolean isOperationSupported(String operationName);
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSOperationsMetadata.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSDimension.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSDimension.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSDimension.java	(revision 6892)
@@ -0,0 +1,45 @@
+/* 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.ogc.struct;
+
+import java.util.List;
+
+
+/**
+ * Dimension of a WMTS layer
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface WMTSDimension {
+	
+	public String getIdentifier();
+	
+	public String getUnitSymbol();
+	
+	public String getDefaultValue();
+	
+	public boolean isCurrent();
+	
+	public List<String> getValueList() ;
+	
+	public String getUOM();
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSDimension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSThemes.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSThemes.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSThemes.java	(revision 6892)
@@ -0,0 +1,42 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+
+public interface WMTSThemes {
+	
+	/**
+	 * Returns true if this server has themes
+	 * @return
+	 */
+	public boolean hasThemes();
+	
+	/**
+	 * Gets a node by its name
+	 * @param name
+	 * @return
+	 */
+	public WMTSTheme getNodeByName(String name);
+	
+	/**
+	 * Gets the number of nodes
+	 * @param parent
+	 * @return
+	 */
+	public int getChildCount();
+	
+	/**
+	 * Gets the children of the index position
+	 * @param index
+	 * @return
+	 */
+	public WMTSTheme getChildren(int index);
+	
+	/**
+	 * Gets the index of a children
+	 * @param parent
+	 * @param child
+	 * @return
+	 */
+	public int getIndexOfChild(WMTSTheme child);
+	
+	public String toString();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSThemes.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTile.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTile.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTile.java	(revision 6892)
@@ -0,0 +1,31 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+import java.awt.geom.Point2D;
+import java.io.File;
+
+public interface WMTSTile {
+	
+	public Point2D worldToRaster(Point2D pt);
+	
+	public void setFile(File file);
+	
+	public File getFile();
+	
+	public double getULX();
+	
+	public double getULY();
+	
+	public double getLRX();
+	
+	public double getLRY();
+	
+	public int getWidthPx();
+	
+	public int getHeightPx();
+	
+	public int getRow();
+	
+	public int getCol();
+	
+	public WMTSTile cloneTile();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTile.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixSet.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixSet.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixSet.java	(revision 6892)
@@ -0,0 +1,16 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+import java.util.List;
+
+public interface WMTSTileMatrixSet {
+	
+	public WMTSBoundingBox getBoundingBox();
+    
+	public String getWellKnownScaleSet();
+	
+	public List<WMTSTileMatrix> getTileMatrix();
+
+	public String getSupportedCRS();
+	
+	public String getIdentifier();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixSet.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSStyle.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSStyle.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSStyle.java	(revision 6892)
@@ -0,0 +1,14 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+
+public interface WMTSStyle {
+	public WMTSLegendURL getLegendURL();
+
+	public boolean isDefault();
+	
+	public String getTitle();
+	
+	public String getIdentifier();
+	
+	public String toString();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSStyle.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTheme.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTheme.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTheme.java	(revision 6892)
@@ -0,0 +1,48 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+import java.util.List;
+
+public interface WMTSTheme {
+	public WMTSLayer getLayer();
+	
+	public List<WMTSTheme> getThemeList();
+	
+	public List<String> getLayerRef();
+	
+	/**
+	 * Gets a node by its name
+	 * @param name
+	 * @return
+	 */
+	public WMTSTheme getNodeByName(String name);
+	
+	/**
+	 * Gets the number of nodes
+	 * @param parent
+	 * @return
+	 */
+	public int getChildCount();
+	
+	/**
+	 * Gets the children of the index position
+	 * @param index
+	 * @return
+	 */
+	public WMTSTheme getChildren(int index);
+	
+	/**
+	 * Gets the index of a children
+	 * @param parent
+	 * @param child
+	 * @return
+	 */
+	public int getIndexOfChild(WMTSTheme child);
+	
+	public String getTitle();
+	
+	public String getIdentifier();
+	
+	public String getAbstract();
+	
+	public String toString();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTheme.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixLimits.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixLimits.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixLimits.java	(revision 6892)
@@ -0,0 +1,16 @@
+package org.gvsig.raster.wmts.ogc.struct;
+
+
+public interface WMTSTileMatrixLimits {
+	public WMTSTileMatrix getTileMatrix();
+	
+	public String getRefToTileMatrix();
+	
+	public int getMinTileRow();
+	
+	public int getMaxTileRow();
+	
+	public int getMinTileCol();
+	
+	public int getMaxTileCol();
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/struct/WMTSTileMatrixLimits.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSOGCLocator.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSOGCLocator.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSOGCLocator.java	(revision 6892)
@@ -0,0 +1,84 @@
+/* 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.ogc;
+
+import org.gvsig.tools.locator.BaseLocator;
+import org.gvsig.tools.locator.Locator;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * This locator is the entry point for the Raster library, providing
+ * access to all Raster services through the {@link WMTSOGCManager}
+ * .
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class WMTSOGCLocator extends BaseLocator {
+    public static final String               MANAGER_NAME            = "WMTSOGC.manager";
+    public static final String               MANAGER_DESCRIPTION     = "WMTSOGC Manager";
+    private static final String              LOCATOR_NAME            = "WMTSOGC.locator";
+    private static final WMTSOGCLocator      INSTANCE                = new WMTSOGCLocator();
+
+    /**
+     * Return the singleton instance.
+     * 
+     * @return the singleton instance
+     */
+    public static WMTSOGCLocator getInstance() {
+        return INSTANCE;
+    }
+
+    /**
+     * Return the Locator's name.
+     * 
+     * @return a String with the Locator's name
+     */
+    public final String getLocatorName() {
+        return LOCATOR_NAME;
+    }
+
+    /**
+     * Return a reference to the RasterManager.
+     * 
+     * @return a reference to the RasterManager
+     * @throws LocatorException
+     *             if there is no access to the class or the class cannot be
+     *             instantiated
+     * @see Locator#get(String)
+     */
+    public static WMTSOGCManager getManager() throws LocatorException {
+        return (WMTSOGCManager) getInstance().get(MANAGER_NAME);
+    }
+
+    /**
+     * Registers the Class implementing the RasterManager interface.
+     * 
+     * @param clazz
+     *            implementing the RasterManager interface
+     */
+    public static void registerManager(
+        Class<? extends WMTSOGCManager> clazz) {
+        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
+    }
+
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSOGCLibrary.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSOGCLibrary.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSOGCLibrary.java	(revision 6892)
@@ -0,0 +1,31 @@
+package org.gvsig.raster.wmts.ogc;
+
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSOGCLibrary extends AbstractLibrary {
+	
+	public WMTSOGCLibrary() {
+        registerAsAPI(WMTSOGCLibrary.class);
+	}
+	
+	@Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        WMTSOGCManager manager = WMTSOGCLocator.getManager();
+        if (manager == null) {
+            throw new ReferenceNotRegisteredException(
+                WMTSOGCLocator.MANAGER_NAME, WMTSOGCLocator
+                    .getInstance());
+        }
+    }
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSClient.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSClient.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSClient.java	(revision 6892)
@@ -0,0 +1,124 @@
+package org.gvsig.raster.wmts.ogc;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.raster.wmts.ogc.exception.DownloadException;
+import org.gvsig.raster.wmts.ogc.exception.ServerErrorException;
+import org.gvsig.raster.wmts.ogc.exception.WMTSException;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSServiceIdentification;
+import org.gvsig.raster.wmts.ogc.struct.WMTSServiceProvider;
+import org.gvsig.raster.wmts.ogc.struct.WMTSStyle;
+import org.gvsig.raster.wmts.ogc.struct.WMTSThemes;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSet;
+
+public interface WMTSClient {
+	
+	/**
+	 * Creates a <code>WMTSStatus</code> structure to make a request 
+	 * @return
+	 */
+	public WMTSStatus createStatus();
+	
+	/**
+	 * Connects to a server
+	 * @param override
+	 * @param cancel
+	 * @return
+	 */
+	public boolean connect(boolean override, ICancellable cancel);
+	
+	/**
+	 * Change axis order
+	 * @param force
+	 */
+	public void setForceChangeAxisOrder(boolean force);
+	
+	/**
+	 * Gets the list of themes
+	 * @return
+	 */
+	public WMTSThemes getThemes();
+	
+	/**
+	 * Gets the list of layers as <code>WMTSThemes</code>. When the server
+	 * does not offer themes it is useful to have the same structure as list
+	 * of layers.
+	 * @return
+	 */
+	public WMTSThemes getLayerListAsThemes();
+	
+    /**
+     * Gets the set of tiles definition
+     * @return
+     */
+    public List<WMTSTileMatrixSet> getTileMatrixSet();
+    
+    /**
+     * Gets a layer 
+     * @param layerName
+     * @return
+     */
+    public WMTSLayer getLayer(String layerName);
+    
+	/**
+	 * Gets the host description
+	 * @return
+	 */
+	public WMTSServiceIdentification getServiceIdentification();
+	
+	/**
+	 * Gets the host description
+	 * @return
+	 */
+	public WMTSServiceProvider getServiceProvider();
+	
+	/**
+     * <p>Gets a tile downloading using a specific URL, path and file. This is useful for URL builds from templates</p> 
+     * @throws ServerErrorException 
+     */
+    public File getTile(String url, ICancellable cancel, File file) throws WMTSException, ServerErrorException;
+	
+    
+	/**
+     * <p>Gets a tile downloading using a specific path and file.</p> 
+     * @throws ServerErrorException 
+     */
+    public File getTile(WMTSStatus status, ICancellable cancel, File file) throws WMTSException, ServerErrorException;
+	
+	 /**
+     * <p>One of the three interfaces that OGC WMS defines. Request a map.</p> 
+     * @throws ServerErrorException 
+     */
+    public File getTile(WMTSStatus status, ICancellable cancel) throws WMTSException, ServerErrorException;
+    
+    /**
+     * Builds the URL to get a tile using a WMTSStatus object 
+     * @throws ServerErrorException 
+     */
+    public URL getTileURL(WMTSStatus status) throws MalformedURLException;
+    
+    /**
+     * Downloads a file
+     * @throws DownloadException 
+     * @throws ServerErrorException 
+     */
+    public File downloadFile(URL url, ICancellable cancel) throws DownloadException;
+    
+    /**
+     * <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);
+    
+    /**
+     * Gets the legend graphic of one layer
+     */
+    public File getLegendGraphic(WMTSLayer layer, WMTSStyle style, ICancellable cancel) throws WMTSException;
+	
+	public String getHost();
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSOGCManager.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSOGCManager.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSOGCManager.java	(revision 6892)
@@ -0,0 +1,37 @@
+package org.gvsig.raster.wmts.ogc;
+
+import java.io.IOException;
+import java.net.ConnectException;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
+
+
+/**
+ * This class is responsible of the management of the library's business logic.
+ * It is the library's main entry point, and provides all the services to manage
+ * {@link BufferCacheService}s.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @version $Id$
+ */
+public interface WMTSOGCManager {
+	
+	/**
+	 * Creates a new client to connect to a WMTS server
+	 * @param url
+	 * @return
+	 * @throws ConnectException
+	 * @throws IOException
+	 */
+	public WMTSClient createWMTSClient(String url) throws ConnectException, IOException;
+	
+	/**
+	 * Creates a tile structure
+	 * @param size
+	 * @param position
+	 * @param coords
+	 * @return
+	 */
+	public WMTSTile createTile(int[] size, int[] position, double[] coords);
+	
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSStatus.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSStatus.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/WMTSStatus.java	(revision 6892)
@@ -0,0 +1,75 @@
+package org.gvsig.raster.wmts.ogc;
+
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
+
+public interface WMTSStatus {
+	public int getWidth();
+    
+    public void setWidth(int _width);
+
+    public int getHeight();
+    
+    public void setHeight(int _height);
+
+    public String getFormat();
+    
+    public void setFormat(String _format);
+    
+    public String getSrs();
+
+    public void setSrs(String _srs);
+    
+	public int getProtocol();
+
+	public void setProtocol(int protocol);
+
+	public String getLayer();
+
+	public String getStyle();
+
+	public String getTileMatrixSet();
+
+	public String getTileMatrix();
+
+	public int getTileRow();
+
+	public int getTileCol();
+
+	public void setLayer(String layer);
+
+	public void setStyle(String style);
+
+	public void setTileCol(int tileCol);
+
+	public void setTileRow(int tileRow);
+
+	public List<WMTSTile> getTileList();
+	
+	public void setTileList(List<WMTSTile> tileList);
+	
+    public String getInfoFormat();
+    
+    public void setInfoFormat(String format);
+    
+    public int getLevel();
+
+	public void setLevel(int level);
+	
+	public void setTileMatrixSet(String id);
+	
+	public void setTileMatrix(String id);
+	
+	public String getResourceURL(String key);
+	
+	public String getDimension();
+	
+	public void setDimension(String dimension);
+	
+	public String getValueForDimension();
+	
+	public void setValueForDimension(String dimension);
+    
+    public WMTSStatus cloneStatus();
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/DownloadException.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/DownloadException.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/DownloadException.java	(revision 6892)
@@ -0,0 +1,73 @@
+/* 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.ogc.exception;
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DownloadException extends Exception {
+    private static final long serialVersionUID = 1476084093500156070L;
+    private String            wmtsCode         = null;
+    protected String          formatString     = null;
+    protected String          messageKey       = null;
+    protected long            code             = 0;
+
+    public DownloadException() {		
+        init();			
+    }	
+
+    public DownloadException(Throwable cause) {		
+        init();	
+        initCause(cause);
+    }
+    
+    public DownloadException(String msg, Throwable cause) {		
+        init();	
+        initCause(cause);
+        this.formatString = msg;
+    }
+
+    public DownloadException(String wfsCode,String message) {		
+        init();	
+        formatString = message;
+        this.wmtsCode = wfsCode;
+    }	
+
+    public DownloadException(String message) {        
+        init(); 
+        formatString = message;       
+    }   
+
+    public void init() {
+        messageKey = "wmts_exception";
+        formatString = "WMTS Exception";
+        code = serialVersionUID;
+    }
+
+    /**
+     * @return Returns the wfsCode.
+     */
+    public String getWfsCode() {
+        return wmtsCode;
+    }	
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/DownloadException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/WMTSException.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/WMTSException.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/WMTSException.java	(revision 6892)
@@ -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.ogc.exception;
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSException extends Exception {
+    private static final long serialVersionUID = 1476084093500156070L;
+    private String            wmtsCode         = null;
+    protected String          formatString     = null;
+    protected String          messageKey       = null;
+    protected long            code             = 0;
+
+    public WMTSException() {		
+        init();			
+    }	
+
+    public WMTSException(Throwable cause) {	
+    	super(cause);
+        init();	
+        initCause(cause);
+    }
+    
+    public WMTSException(String msg, Throwable cause) {	
+    	super(msg, cause);
+        init();	
+        this.formatString = msg;
+    }
+
+    public WMTSException(String wfsCode,String message) {		
+        init();	
+        formatString = message;
+        this.wmtsCode = wfsCode;
+    }	
+
+    public WMTSException(String message) {        
+        init(); 
+        formatString = message;       
+    }   
+
+    public void init() {
+        messageKey = "wmts_exception";
+        formatString = "WMTS Exception";
+        code = serialVersionUID;
+    }
+
+    /**
+     * @return Returns the wfsCode.
+     */
+    public String getWfsCode() {
+        return wmtsCode;
+    }
+    
+    public void setWMTSMessage(String message) {
+    	this.formatString = message;
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/WMTSException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/ServerErrorException.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/ServerErrorException.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/ServerErrorException.java	(revision 6892)
@@ -0,0 +1,84 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 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.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+/* CVS MESSAGES:
+*
+* $Id: ServerErrorException.java 38992 2012-10-03 10:38:37Z nbrodin $
+* $Log$
+* Revision 1.1  2005-12-27 17:28:15  jaume
+* *** empty log message ***
+*
+*
+*/
+/**
+ * 
+ */
+package org.gvsig.raster.wmts.ogc.exception;
+
+/**
+ * <p>
+ * Exception thrown when an unexpected response to a request was obtained
+ * from a server. It denotes that the server could not process the request
+ * by a critical error and it could not answer a service-specific defined
+ * exception.
+ * </p>
+ * <p>
+ * Use it to distinguish a server exception that is not part of a service
+ * exception definition.
+ * </p>
+ * @author jaume
+ *
+ */
+public class ServerErrorException extends Exception {
+	private static final long serialVersionUID = 1L;
+
+	public ServerErrorException(){
+        super();
+    }
+    
+    public ServerErrorException(String message){
+        super(message);
+    }
+    
+    public ServerErrorException(String message, Throwable e){
+        super(message, e);
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/java/org/gvsig/raster/wmts/ogc/exception/ServerErrorException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 6892)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.ogc.WMTSOGCLibrary
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/pom.xml	(revision 6892)
@@ -0,0 +1,59 @@
+<?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.2.43</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.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.operation</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.compat.api</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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.api
___________________________________________________________________
Added: svn:ignore
   + target

.settings

.classpath

.project


Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetFeatureInfoRequest.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetFeatureInfoRequest.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetFeatureInfoRequest.java	(revision 6892)
@@ -0,0 +1,73 @@
+/* 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.ogc.impl.request;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSProtocolHandler;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSStatusImpl;
+
+/**
+ * Base class for WMTS GetFeatureInfo
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSGetFeatureInfoRequest extends WMTSRequest {
+	protected int x;
+	protected int y;
+	
+	public WMTSGetFeatureInfoRequest(WMTSStatusImpl status, WMTSProtocolHandler protocolHandler, int x, int y) {
+		super(status, protocolHandler);	
+		this.x = x;
+		this.y = y;
+	}
+
+	public String getHttpPostRequest(String onlineResource) {
+		return null;
+	}
+
+	public String getOperationName() {
+		return Tags.GETFEATUREINFO;
+	}
+
+	public String getTempFilePrefix() {
+		return "wms_getFeatureInfo.xml";
+	}
+	
+	/**
+	 * @return the URL used in the HTTP get operation
+	 * @throws MalformedURLException
+	 */
+	public URL getURL() throws MalformedURLException {
+		String onlineResource = protocolHandler.getBaseURL(Tags.GETFEATUREINFO);
+		return new URL(getHttpGetRequest(onlineResource));
+	}
+}
+
+

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetFeatureInfoRequest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetCapabilitiesRequest.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetCapabilitiesRequest.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetCapabilitiesRequest.java	(revision 6892)
@@ -0,0 +1,63 @@
+/* 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.ogc.impl.request;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSProtocolHandler;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSServerDescription;
+
+/**
+ * Base class for a GetCapabilities WMTS request
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSGetCapabilitiesRequest extends WMTSRequest {
+	protected WMTSServerDescription   serverDescription  = null;
+	
+	/**
+	 * @param status
+	 * @param protocolHandler
+	 */
+	public WMTSGetCapabilitiesRequest(WMTSServerDescription serverDescription,
+			WMTSProtocolHandler protocolHandler) {
+		super(null, protocolHandler);
+		this.serverDescription = serverDescription;
+	}
+
+	protected String getHttpPostRequest(String onlineResource) {
+		return null;
+	}
+
+	protected String getOperationName() {
+		return Tags.GETCAPABILITIES;
+	}
+
+	protected String getTempFilePrefix() {
+		return "wmts_getCapabilities.xml";
+	}
+}
+

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetCapabilitiesRequest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetTileRequest.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetTileRequest.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetTileRequest.java	(revision 6892)
@@ -0,0 +1,81 @@
+/* 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.ogc.impl.request;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSProtocolHandler;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSStatusImpl;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public abstract class WMTSGetTileRequest extends WMTSRequest {
+		
+	public WMTSGetTileRequest(WMTSStatusImpl status, WMTSProtocolHandler protocolHandler) {
+		super(status, protocolHandler);		
+	}
+
+	public String getHttpPostRequest(String onlineResource) {
+		return null;
+	}
+
+	public String getOperationName() {
+		return Tags.GETTILE;
+	}
+
+	public String getTempFilePrefix() {
+		String format = status.getFormat();
+		if (format == null){
+			return "wmts_getMap.xml";
+		}
+		if (format.indexOf("png") >= 0){
+	        return "wmts_getMap.png";
+		}	
+	    if (format.indexOf("xml") >= 0){
+	        return "wmts_getMap.xml";
+	    }	
+	    if (format.indexOf("gif") >= 0){
+	        return "wmts_getMap.gif";
+	    }
+	    if (format.indexOf("tif") >= 0){
+	        return "wmts_getMap.tif";
+	    }
+	    if (format.indexOf("bmp") >= 0){
+	        return "wmts_getMap.bmp";
+	    }
+	    if (format.indexOf("jpg") >= 0
+	        || format.indexOf("jpeg") >= 0){
+	        return "wmts_getMap.jpg";			 
+	    }
+		return "wms_getMap.xml";
+	}
+}
+
+

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSGetTileRequest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSRequest.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSRequest.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSRequest.java	(revision 6892)
@@ -0,0 +1,335 @@
+/* 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}}
+ */
+
+/**
+ * This class sends a WMS request and returns the
+ * reply in a local File. It tries if the server
+ * supports both HTTP Get and Post requests.
+ * @author Jorge Piera LLodr? (jorge.piera@iver.es)
+ */
+package org.gvsig.raster.wmts.ogc.impl.request;
+
+import java.io.BufferedOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.SocketTimeoutException;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.util.prefs.Preferences;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import org.gvsig.compat.CompatLocator;
+import org.gvsig.compat.lang.StringUtils;
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.Utilities;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSProtocolHandler;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSStatusImpl;
+
+/**
+ * Base class for a WMTS request
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSRequest {
+	protected static final StringUtils stringUtils = CompatLocator.getStringUtils();
+	protected WMTSStatusImpl status = null;
+	protected WMTSProtocolHandler protocolHandler = null;
+	protected boolean isDeleted = false;
+	protected static final String XMLTAG_STARTCHARACTER = "<";
+	protected static final String XMLTAG_FINISHCHARACTER = "</";
+	protected static final String XMLTAG_ENDCHARACTER = ">";
+	
+	public WMTSRequest(WMTSStatusImpl status,
+			WMTSProtocolHandler protocolHandler) {
+		this.status = status;
+		this.protocolHandler = protocolHandler;
+	}
+	
+	protected abstract String getHttpGetRequest(String onlineResource);
+
+	protected abstract String getHttpPostRequest(String onlineResource);
+
+	protected abstract String getTempFilePrefix();
+
+	protected abstract String getOperationName();
+	
+	/**
+	 * @return the URL used in the HTTP get operation
+	 * @throws MalformedURLException
+	 */
+	public URL getURL() throws MalformedURLException {
+		String onlineResource = protocolHandler.getBaseURL(getOperationName());
+		return new URL(getHttpGetRequest(onlineResource));
+	}
+
+	protected String getSchemaLocation() {
+		return null;
+	}
+	
+	/**
+     * Gets the part of the OGC request that share GetMap and GetFeatureInfo
+     * @return String request
+     */
+	protected String getPartialQuery(WMTSStatusImpl status) {
+		String parametersForDimension = getParametersForDimension(); 
+        StringBuffer req = new StringBuffer();
+        req.append("Layer=" + status.getLayer())
+        .append("&Style=" + status.getStyle())
+        .append("&Format=" + status.getFormat())
+        .append(parametersForDimension != null ? parametersForDimension : "")
+        .append("&TileMatrixSet=" + status.getTileMatrixSet())
+        .append("&TileMatrix=" + status.getTileMatrix())
+        .append("&TileRow=" + status. getTileRow())
+        .append("&TileCol=" + status.getTileCol());
+        return req.toString();
+    }
+	
+	private String getParametersForDimension() {
+		String dimension = status.getDimension();
+		String valueForDimension = status.getValueForDimension();
+		if(dimension != null && valueForDimension != null)
+			return ("&" + dimension + "=" + valueForDimension);
+		return null;
+	}
+	
+	/**
+	 * Send a request to the server.
+	 * @return
+	 * The server reply
+	 * @throws IOException 
+	 * @throws UnknownHostException 
+	 * @throws ConnectException 
+	 */
+	public void sendRequest(ICancellable cancel, File file) throws ConnectException, UnknownHostException, IOException {
+		String onlineResource = protocolHandler.getBaseURL(getOperationName());
+		URL url = new URL(stringUtils.replaceAll(getHttpGetRequest(onlineResource), " ", "%20"));
+		//System.out.println(url.toString());
+		downloadFile(url, file, cancel);	
+		
+		//downloadFile(new URL(protocolHandler.getHost()), getHttpGetRequest(onlineResource), file, cancel);	
+	}
+	
+	/**
+	 * Send a request to the server.
+	 * @return
+	 * The server reply
+	 * @throws IOException 
+	 * @throws UnknownHostException 
+	 * @throws ConnectException 
+	 */
+	public File sendRequest(ICancellable cancel) throws ConnectException, UnknownHostException, IOException{
+		//if the status is null is because is a GetCapabilities operation
+		if (status != null) {
+			if (status.getProtocol() != Tags.PROTOCOL_UNDEFINED){
+				if (status.getProtocol() == Tags.PROTOCOL_GET){
+					String onlineResource = protocolHandler.getHost();
+					String symbol = protocolHandler.getSymbol(onlineResource);
+					onlineResource = onlineResource + symbol;
+					return sendHttpGetRequest(onlineResource, cancel);
+				}else{
+					String onlineResource = protocolHandler.getHost();
+					return sendHttpPostRequest(onlineResource);
+				}
+			}
+		}
+
+		String onlineResource = protocolHandler.getBaseURL(getOperationName(), Tags.PROTOCOL_GET);
+		if (onlineResource != null)
+			return sendHttpGetRequest(onlineResource, cancel);
+		
+		onlineResource = protocolHandler.getBaseURL(getOperationName(), Tags.PROTOCOL_POST);
+		if (onlineResource != null)
+			return sendHttpPostRequest(onlineResource);
+
+		return sendHttpGetRequest(protocolHandler.getBaseURL(getOperationName()), cancel);
+	}
+	
+	/**
+	 * Send a Http request using the get protocol
+	 * @param onlineResource
+	 * @return
+	 * @throws ConnectException
+	 * @throws UnknownHostException
+	 * @throws IOException
+	 */
+	private File sendHttpGetRequest(String onlineResource, ICancellable cancel) throws ConnectException, UnknownHostException, IOException{
+		URL url = new URL(stringUtils.replaceAll(getHttpGetRequest(onlineResource), " ", "%20"));
+		if (isDeleted()){
+			Utilities.removeURL(url);
+		}
+		return Utilities.downloadFile(url, getTempFilePrefix(), cancel);		
+	}
+
+	/**
+	 * Send a Http request using the post protocol
+	 * @param onlineResource
+	 * @return
+	 * @throws ConnectException
+	 * @throws UnknownHostException
+	 * @throws IOException
+	 */
+	private File sendHttpPostRequest(String onlineResource) throws ConnectException, UnknownHostException, IOException{
+		URL url = new URL(onlineResource);
+		String data = getHttpPostRequest(onlineResource);
+		if (isDeleted()){
+			Utilities.removeURL(url+data);
+		}
+		return Utilities.downloadFile(url, data, getTempFilePrefix(), null);		
+	}
+	
+	
+	public void cancelDownload() {
+		if(connection != null) {
+			connection.disconnect();
+			connection = null;	
+		}
+		if(is != null) {
+			try {
+				is.close();
+			} catch (IOException e) {
+			}
+		}
+		if(dos != null) {
+			try {
+				dos.close();
+			} catch (IOException e) {
+			}
+		}
+	}
+
+	HttpURLConnection connection = null;
+	DataOutputStream dos = null;
+	DataInputStream is = null;
+	
+	public void downloadFile(URL url, File dstFile, ICancellable cancel) throws IOException {
+		if(cancel != null && cancel.isCanceled())
+			throw new IOException();
+		
+		Preferences prefs = Preferences.userRoot().node( "gvsig.downloader" );
+		// by default 1 minute (60000 milliseconds.
+		int timeout = prefs.getInt("timeout", 20000);
+
+		//If the used protocol is HTTPS
+		if (url.getProtocol().equals("https")) {
+			try {
+				disableHttsValidation();
+			} catch (KeyManagementException e) {
+				throw new IOException();
+			} catch (NoSuchAlgorithmException e) {
+				throw new IOException();
+			}
+		}
+		
+		try {
+			connection = (HttpURLConnection)url.openConnection();
+			connection.setConnectTimeout(timeout);
+			connection.setReadTimeout(timeout);
+			is = new DataInputStream(connection.getInputStream());
+
+			dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(dstFile)));
+			byte[] buffer = new byte[4096];
+
+			int i = -1;
+
+			if(cancel != null && cancel.isCanceled()) {
+				throw new IOException();
+			}
+
+			while((i = is.read(buffer)) > 0) {
+				if(cancel != null && cancel.isCanceled()) {
+					throw new IOException();
+				}
+				dos.write(buffer, 0, i);
+			}
+		} catch (SocketTimeoutException e) {
+			throw new IOException();
+		} finally {
+			if(is != null)
+				is.close();
+			if(dos != null)
+				dos.close();
+			if(connection != null)
+				connection.disconnect();
+		}
+	}
+
+	/**
+	 * This method disables the Https certificate validation.
+	 * @throws KeyManagementException
+	 * @throws NoSuchAlgorithmException
+	 */
+	private void disableHttsValidation() throws KeyManagementException, NoSuchAlgorithmException{
+		// Create a trust manager that does not validate certificate chains
+		TrustManager[] trustAllCerts = new TrustManager[] {
+				new X509TrustManager() {
+					public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+						return null;
+					}
+					public void checkClientTrusted(
+							java.security.cert.X509Certificate[] certs, String authType) {
+					}
+					public void checkServerTrusted(
+							java.security.cert.X509Certificate[] certs, String authType) {
+					}
+				}
+		};
+
+		// Install the all-trusting trust manager
+		SSLContext sc = SSLContext.getInstance("SSL");
+		sc.init(null, trustAllCerts, new java.security.SecureRandom());
+		HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+	}
+
+	public boolean isDeleted() {
+		return isDeleted;
+	}
+
+	public void setDeleted(boolean isDeleted) {
+		this.isDeleted = isDeleted;
+	}
+	
+	protected String createXMLStartTag(String tagName){
+	    return XMLTAG_STARTCHARACTER + tagName + XMLTAG_ENDCHARACTER;
+	}
+	
+   protected String createXMLEndtTag(String tagName){
+        return XMLTAG_FINISHCHARACTER + tagName + XMLTAG_ENDCHARACTER;
+    }
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/request/WMTSRequest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTheme_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTheme_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTheme_1_0_0.java	(revision 6892)
@@ -0,0 +1,81 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSThemeImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Layer hierarchy using the protocol version 1.0.0
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSTheme_1_0_0 extends WMTSThemeImpl {
+	
+	/**
+     * Parses a theme
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+	public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_IDENTIFIER)) {
+						setIdentifier(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_TITLE)) {
+						setTitle(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_ABSTRACT)) {
+						setAbstract(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_KEYWORDS)) {
+						parser.skipSubTree();
+					} else if (compareName(parser, Tags.WMTS_THEME)) {
+						WMTSThemeImpl newTheme = new WMTSTheme_1_0_0();
+						newTheme.parse(parser);
+						getThemeList().add(newTheme);
+					} else if (compareName(parser, Tags.WMTS_LAYERREF)) {
+						getLayerRef().add(nextText(parser));
+					} 			
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_THEME))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTheme_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixLimits_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixLimits_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixLimits_1_0_0.java	(revision 6892)
@@ -0,0 +1,104 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSBaseStruct;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileMatrixLimitsImpl;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixLimits;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Describes the attributes of a layer in a WMTS server using the protocol version 1.0.0
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSTileMatrixLimits_1_0_0 extends WMTSTileMatrixLimitsImpl {
+	
+	public void parse(KXmlParser parser, List<WMTSTileMatrixLimits> list) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_TILEMATRIX)) {
+						setRefToTileMatrix(parser.nextText());
+					} else if (compareName(parser, Tags.WMTS_MINTILEROW)) {
+						int n = 0;
+						try {
+							n = Integer.parseInt(parser.nextText());
+						} catch(NumberFormatException e) {}
+						setMinTileRow(n);
+					} else if (compareName(parser, Tags.WMTS_MAXTILEROW)) {
+						int n = 0;
+						try {
+							n = Integer.parseInt(parser.nextText());
+						} catch(NumberFormatException e) {}
+						setMaxTileRow(n);
+					} else if (compareName(parser, Tags.WMTS_MINTILECOL)) {
+						int n = 0;
+						try {
+							n = Integer.parseInt(parser.nextText());
+						} catch(NumberFormatException e) {}
+						setMinTileCol(n);
+					} else if (compareName(parser, Tags.WMTS_MAXTILECOL)) {
+						int n = 0;
+						try {
+							n = Integer.parseInt(parser.nextText());
+						} catch(NumberFormatException e) {}
+						setMaxTileCol(n);
+					}
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_TILEMATRIXLIMITS))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    	list.add(this);
+    }
+	
+    /**
+     * Compares the next name in the selected parser with the string passed
+     * by value.
+     * @param parser
+     * @param name
+     * @return
+     */
+    public boolean compareName(KXmlParser parser, String name) {
+    	String s = parser.getName();
+    	if(s.compareTo(name) == 0 || s.compareTo(WMTSBaseStruct.gmlTag + name) == 0)
+    		return true;
+    	return false;
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixLimits_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSKeywords_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSKeywords_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSKeywords_1_0_0.java	(revision 6892)
@@ -0,0 +1,82 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSBaseStruct;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * <p>Keywords for a WMTS Layer</p>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSKeywords_1_0_0 extends WMTSBaseStruct {
+	private List<String>    keywords            = null;
+	
+	public List<String> getKeywords() {
+		return keywords;
+	}
+
+	public void addKeyword(String k) {
+		if(keywords == null)
+			keywords = new ArrayList<String>();
+		keywords.add(k);
+	}
+	
+	/**
+     * Parses the layer's style
+     * @param parser
+     * @param style
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_KEYWORD)) {
+						addKeyword(nextText(parser));
+					}
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_KEYWORDS))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSKeywords_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSResourceURL_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSResourceURL_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSResourceURL_1_0_0.java	(revision 6892)
@@ -0,0 +1,105 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.struct.WMTSResourceURL;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSResourceURL_1_0_0 implements WMTSResourceURL {
+	private String format       = null;
+	private String resourceType = null;
+	private String template     = null;
+	
+	public void parse(KXmlParser parser, int currentTag) throws IOException, XmlPullParserException {
+		//parser.skipSubTree();
+		boolean end = false;
+
+		//currentTag = parser.next();
+
+		while (!end) {
+			switch(currentTag) {
+			case KXmlParser.START_TAG:
+				for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+					String attr = parser.getAttributeName(i);
+					String value = parser.getAttributeValue(i);
+					if(attr.compareToIgnoreCase(Tags.WMTS_FORMAT) == 0) {
+						format = value;				
+					}
+					if(attr.compareToIgnoreCase(Tags.WMTS_RESOURCETYPE) == 0) {
+						resourceType = value;				
+					} 
+					if(attr.compareToIgnoreCase(Tags.WMTS_TEMPLATE) == 0) {
+						template = value;				
+					} 
+				}
+				break;
+			case KXmlParser.END_TAG:
+				if (compareName(parser, Tags.WMTS_RESOURCEURL))
+					end = true;
+				break;
+			case KXmlParser.TEXT:					
+				break;
+			}
+			if (!end)
+				currentTag = parser.next();
+		}
+	}
+	
+    /**
+     * Compares the next name in the selected parser with the string passed
+     * by value.
+     * @param parser
+     * @param name
+     * @return
+     */
+    public boolean compareName(KXmlParser parser, String name) {
+    	String s = parser.getName();
+    	if(s.compareTo(name) == 0 || s.compareTo(Tags.WMTS_GMLTAG + name) == 0)
+    		return true;
+    	return false;
+    }
+
+	public String getTemplate() {
+		return template;
+	}
+
+	public String getFormat() {
+		return format;
+	}
+
+	public String getResourceType() {
+		return resourceType;
+	}
+
+	public void parse(KXmlParser parser) throws IOException,
+			XmlPullParserException {
+		// TODO Auto-generated method stub
+		
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSResourceURL_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSServiceIdentification_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSServiceIdentification_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSServiceIdentification_1_0_0.java	(revision 6892)
@@ -0,0 +1,86 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSServiceIdentificationImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * General information about this server
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSServiceIdentification_1_0_0 extends WMTSServiceIdentificationImpl {
+	/**
+     * Parses a theme
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_IDENTIFIER)) {
+						setIdentifier(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_TITLE)) {
+						setTitle(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_ABSTRACT)) {
+						setAbstract(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_KEYWORDS)) {
+						WMTSKeywords_1_0_0 keywords = new WMTSKeywords_1_0_0();
+						keywords.parse(parser);
+						setKeywords(keywords.getKeywords());
+					} else if (compareName(parser, Tags.WMTS_SERVICETYPE)) {
+						setServiceType(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_SERVICETYPEVERSION)) {
+						setServiceTypeVersion(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_PROFILE)) {
+						setProfile(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_FEES)) {
+						setFees(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_ACCESSCONSTRAINTS)) {
+						setAccessConstraints(nextText(parser));
+					} 
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_SERVICEID))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSServiceIdentification_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSServiceProvider_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSServiceProvider_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSServiceProvider_1_0_0.java	(revision 6892)
@@ -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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSServiceProviderImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * General information about this server
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSServiceProvider_1_0_0 extends WMTSServiceProviderImpl {
+	/**
+     * Parses a theme
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_PROVIDERNAME)) {
+						setProviderName(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_PROVIDERSITE)) {
+						setProviderSite(parser.getAttributeValue(0));
+					} /*else if (compareName(parser, CapabilitiesTags.WMTS_SERVICECONTACT)) {
+						setServiceContact(nextText(parser));
+					} */
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_SERVICEPROV))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSServiceProvider_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSLayer_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSLayer_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSLayer_1_0_0.java	(revision 6892)
@@ -0,0 +1,118 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSServerDescription;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSLayerImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileMatrixSetLinkImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Describes the attributes of a layer in a WMTS server using the protocol version 1.0.0
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSLayer_1_0_0 extends WMTSLayerImpl {
+	
+	public WMTSLayer_1_0_0(WMTSServerDescription status) {
+		super(status);
+	}
+	
+	/**
+     * Parses a WMTS layer
+     * @param parser
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+	public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_TITLE)) {
+						setTitle(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_WGS84BOUNDINGBOX)) {
+						WMTSBoundingBox_1_0_0 bbox = new WMTSBoundingBox_1_0_0();
+						//bbox.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder);
+						bbox.parse(parser);  
+						setWGS84BBox(bbox);
+					} else if (compareName(parser, Tags.WMTS_IDENTIFIER)) {
+						setIdentifier(nextText(parser)); 
+					} else if (compareName(parser, Tags.WMTS_ABSTRACT)) {
+						setAbstract(nextText(parser)); 
+					} else if (compareName(parser, Tags.WMTS_KEYWORDS)) {
+						WMTSKeywords_1_0_0 keywords = new WMTSKeywords_1_0_0();
+						keywords.parse(parser);
+						setKeywords(keywords.getKeywords());
+					} else if (compareName(parser, Tags.WMTS_BOUNDINGBOX)) {
+						WMTSBoundingBox_1_0_0 bbox = new WMTSBoundingBox_1_0_0();
+						//bbox.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder);
+						bbox.parse(parser);  
+						setBBox(bbox);
+					} else if (compareName(parser, Tags.WMTS_STYLE)) {
+						WMTSStyle_1_0_0 style = new WMTSStyle_1_0_0();
+						style.parse(parser); 
+						getStyle().add(style);
+					} else if (compareName(parser, Tags.WMTS_FORMAT)) {
+						getFormat().add(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_INFOFORMAT)) {
+						getInfoFormat().add(nextText(parser)); 
+					} else if (compareName(parser, Tags.WMTS_DIMENSION)) {
+						WMTSDimension_1_0_0 dimension = new WMTSDimension_1_0_0();
+						dimension.parse(parser);  
+						getDimensions().add(dimension);
+					} else if (compareName(parser, Tags.WMTS_METADATA)) {
+						setMetadata(nextText(parser)); 
+					} else if (compareName(parser, Tags.WMTS_TILEMATRIXSETLINK)) {
+						WMTSTileMatrixSetLinkImpl tileMatrixSetLink = new WMTSTileMatrixSetLink_1_0_0();
+						tileMatrixSetLink.setForceChangeAxisOrder(forceChangeAxisOrder);
+						tileMatrixSetLink.parse(parser);
+						getTileMatrixSetLink().add(tileMatrixSetLink); 
+					} else if (compareName(parser, Tags.WMTS_RESOURCEURL)) {
+						WMTSResourceURL_1_0_0 resourceURL = new WMTSResourceURL_1_0_0();
+						resourceURL.parse(parser, currentTag); 
+						getResourceURL().add(resourceURL);
+					} 
+					
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_LAYER))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    	
+   		status.getLayerList().add(this);
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSLayer_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixSetLink_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixSetLink_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixSetLink_1_0_0.java	(revision 6892)
@@ -0,0 +1,81 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSBaseStruct;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileMatrixLimitsImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileMatrixSetLinkImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Set of tiles using the protocol version 1.0.0
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSTileMatrixSetLink_1_0_0 extends WMTSTileMatrixSetLinkImpl {
+	
+	public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_TILEMATRIXSET)) {
+						setTileMatrixSetId(parser.nextText());
+					} else if (compareName(parser, Tags.WMTS_TILEMATRIXLIMITS)) {
+						WMTSTileMatrixLimitsImpl limits = new WMTSTileMatrixLimits_1_0_0();
+						limits.parse(parser, getTileMatrixLimits()); 
+					}				
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_TILEMATRIXSETLINK))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+	
+    /**
+     * Compares the next name in the selected parser with the string passed
+     * by value.
+     * @param parser
+     * @param name
+     * @return
+     */
+    public boolean compareName(KXmlParser parser, String name) {
+    	String s = parser.getName();
+    	if(s.compareTo(name) == 0 || s.compareTo(WMTSBaseStruct.gmlTag + name) == 0)
+    		return true;
+    	return false;
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixSetLink_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSBoundingBox_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSBoundingBox_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSBoundingBox_1_0_0.java	(revision 6892)
@@ -0,0 +1,123 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.compat.CompatLocator;
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSBaseStruct;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSBoundingBoxImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Describes the bounding box of a layer in a WMTS server
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSBoundingBox_1_0_0 extends WMTSBoundingBoxImpl {
+	
+	/**
+	 * Parses a WGS84BoundingBox object
+	 * @param parser
+	 * @throws IOException
+	 * @throws XmlPullParserException
+	 */
+	public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+		int currentTag;
+		boolean end = false;
+
+		currentTag = parser.next();
+
+		while (!end) {
+			switch(currentTag) {
+			case KXmlParser.START_TAG:
+				if (compareName(parser, Tags.WMTS_LOWERCORNER)) {
+					String v = parser.nextText();
+					if(v != null) {
+						String[] list = CompatLocator.getStringUtils().split(v, " ");
+						if(list.length == 2) {
+							try {
+								//if(!forceLongitudeFirstAxisOrder) {
+									getLowerCorner()[0] = Double.parseDouble(list[0]);
+									getLowerCorner()[1] = Double.parseDouble(list[1]);
+								/*} else {
+									getLowerCorner()[1] = Double.parseDouble(list[0]);
+									getLowerCorner()[0] = Double.parseDouble(list[1]);
+								}*/
+							} catch (NumberFormatException e) {
+							}
+						}
+					}
+				} else if (compareName(parser, Tags.WMTS_UPPERCORNER)) {
+					String v = parser.nextText();
+					if(v != null) {
+						String[] list = CompatLocator.getStringUtils().split(v, " ");
+						if(list.length == 2) {
+							try {
+								//if(!forceLongitudeFirstAxisOrder) {
+									getUpperCorner()[0] = Double.parseDouble(list[0]);
+									getUpperCorner()[1] = Double.parseDouble(list[1]);
+								/*} else {
+									getUpperCorner()[1] = Double.parseDouble(list[0]);
+									getUpperCorner()[0] = Double.parseDouble(list[1]);
+								}*/
+							} catch (NumberFormatException e) {
+							}
+						}
+					}
+				} else if (compareName(parser, Tags.WMTS_CRS)) {
+					setCrs(parser.nextText()); 
+				} else if (compareName(parser, Tags.WMTS_DIMENSIONS)) {
+					try {
+						setDimensions(Integer.parseInt(parser.nextText()));
+					} catch (NumberFormatException e) {
+					}
+				}			
+				break;
+			case KXmlParser.END_TAG:
+				if (compareName(parser, Tags.WMTS_WGS84BOUNDINGBOX) || compareName(parser, Tags.WMTS_BOUNDINGBOX))
+					end = true;
+				break;
+			case KXmlParser.TEXT:					
+				break;
+			}
+			if (!end)
+				currentTag = parser.next();
+		}
+	}
+
+	/**
+	 * Compares the next name in the selected parser with the string passed
+	 * by value.
+	 * @param parser
+	 * @param name
+	 * @return
+	 */
+	public boolean compareName(KXmlParser parser, String name) {
+		String s = parser.getName();
+		if(s.compareTo(name) == 0 || s.compareTo(WMTSBaseStruct.gmlTag + name) == 0)
+			return true;
+		return false;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSBoundingBox_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSLegendURL_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSLegendURL_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSLegendURL_1_0_0.java	(revision 6892)
@@ -0,0 +1,124 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSBaseStruct;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSLegendURLImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Describes the attributes of a layer in a WMTS server using the protocol version 1.0.0
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSLegendURL_1_0_0 extends WMTSLegendURLImpl {
+
+	public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	boolean end = false;
+    	
+    	int currentTag = parser.getEventType();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+                     for (int i=0 ;i < parser.getAttributeCount() ;i++) {
+                    	 String attr = parser.getAttributeName(i);
+                         if (attr.compareTo(Tags.WMTS_HREF) == 0 || attr.compareTo("xlink:" + Tags.WMTS_HREF) == 0) {
+                        	 setHref(parser.getAttributeValue(i));
+                         }
+                         if (attr.compareTo(Tags.FORMAT) == 0) {
+                    		 setFormat(parser.getAttributeValue(i));
+                    	 }
+                         try {
+                        	 if (attr.compareTo(Tags.WMTS_WIDTH) == 0) {
+                        		 setWidth(Integer.parseInt(parser.getAttributeValue(i)));
+                        	 }
+                        	 if (attr.compareTo(Tags.WMTS_HEIGHT) == 0) {
+                        		 setHeight(Integer.parseInt(parser.getAttributeValue(i)));
+                        	 }
+                        	 if (attr.compareTo(Tags.WMTS_MINSCALEDEN) == 0) {
+                        		 setMinScaleDenominator(Double.parseDouble(parser.getAttributeValue(i)));
+                        	 }
+                        	 if (attr.compareTo(Tags.WMTS_MAXSCALEDEN) == 0) {
+                        		 setMaxScaleDenominator(Double.parseDouble(parser.getAttributeValue(i)));
+                        	 }
+                         }catch(NumberFormatException e) {
+                         }
+                     } 
+                     
+					if (compareName(parser, Tags.WMTS_FORMAT)) {
+						parser.skipSubTree();
+					} else if (compareName(parser, Tags.WMTS_MINSCALEDEN)) {
+						try {
+							setMinScaleDenominator(Double.parseDouble(parser.nextText()));
+						} catch (NumberFormatException e) {
+						}
+					} else if (compareName(parser, Tags.WMTS_MAXSCALEDEN)) {
+						try {
+							setMaxScaleDenominator(Double.parseDouble(parser.nextText()));
+						} catch (NumberFormatException e) {
+						}
+					} else if (compareName(parser, Tags.WMTS_HREF)) {
+						setHref(parser.nextText());
+					} else if (compareName(parser, Tags.WMTS_WIDTH)) {
+						try {
+							setWidth(Integer.parseInt(parser.nextText()));
+						} catch (NumberFormatException e) {
+						}
+					} else if (compareName(parser, Tags.WMTS_HEIGHT)) {
+						try {
+							setHeight(Integer.parseInt(parser.nextText()));
+						} catch (NumberFormatException e) {
+						}
+					}			
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_LEGENDURL))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+	
+	/**
+     * Compares the next name in the selected parser with the string passed
+     * by value.
+     * @param parser
+     * @param name
+     * @return
+     */
+    public boolean compareName(KXmlParser parser, String name) {
+    	String s = parser.getName();
+    	if(s.compareTo(name) == 0 || s.compareTo(WMTSBaseStruct.gmlTag + name) == 0)
+    		return true;
+    	return false;
+    }
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSLegendURL_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrix_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrix_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrix_1_0_0.java	(revision 6892)
@@ -0,0 +1,138 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.gvsig.compat.CompatLocator;
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSBaseStruct;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileMatrixImpl;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrix;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Describes the attributes of a layer in a WMTS server using the protocol version 1.0.0
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSTileMatrix_1_0_0 extends WMTSTileMatrixImpl {
+	
+	/**
+     * Parses the tile matrix
+     * @param parser
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+	public void parse(KXmlParser parser, List<WMTSTileMatrix> tileMatrixList) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_IDENTIFIER)) {
+						setIdentifier(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_TITLE)) {
+						setTitle(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_ABSTRACT)) {
+						setAbstract(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_KEYWORDS)) {
+						parser.skipSubTree();
+						//setKeywords(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_SCALEDENOMINATOR)) {
+						try {
+							setScaleDenominator(Double.parseDouble(nextText(parser)));
+						} catch (NumberFormatException e) {
+						}
+					} else if (compareName(parser, Tags.WMTS_TOPLEFTCORNER)) {
+						String v = nextText(parser);
+						if(v != null) {
+							String[] list = CompatLocator.getStringUtils().split(v, " ");
+							if(list.length == 2) {
+								try {
+									getTopLeftCorner()[0] = Double.parseDouble(list[0]);
+									getTopLeftCorner()[1] = Double.parseDouble(list[1]);
+									/*if(!forceLongitudeFirstAxisOrder) {
+										getTopLeftCorner()[0] = Double.parseDouble(list[0]);
+										getTopLeftCorner()[1] = Double.parseDouble(list[1]);
+									} else {
+										getTopLeftCorner()[1] = Double.parseDouble(list[0]);
+										getTopLeftCorner()[0] = Double.parseDouble(list[1]);
+									}*/
+								} catch (NumberFormatException e) {
+								}
+							}
+						}
+					} else if (compareName(parser, Tags.WMTS_TILEWIDTH)) {
+						try {
+							setTileWidth(Integer.parseInt(nextText(parser)));
+						} catch (NumberFormatException e) {
+						}
+					} else if (compareName(parser, Tags.WMTS_TILEHEIGHT)) {
+						try {
+							setTileHeight(Integer.parseInt(nextText(parser)));
+						} catch (NumberFormatException e) {
+						}
+					} else if (compareName(parser, Tags.WMTS_MATRIXWIDTH)) {
+						try {
+							setMatrixWidth(Long.parseLong(nextText(parser)));
+						} catch (NumberFormatException e) {
+						}
+					} else if (compareName(parser, Tags.WMTS_MATRIXHEIGHT)) {
+						try {
+							setMatrixHeight(Long.parseLong(nextText(parser)));
+						} catch (NumberFormatException e) {
+						}
+					}
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_TILEMATRIX))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    	tileMatrixList.add(this);
+    }
+	
+    /**
+     * Compares the next name in the selected parser with the string passed
+     * by value.
+     * @param parser
+     * @param name
+     * @return
+     */
+    public boolean compareName(KXmlParser parser, String name) {
+    	String s = parser.getName();
+    	if(s.compareTo(name) == 0 || s.compareTo(WMTSBaseStruct.gmlTag + name) == 0)
+    		return true;
+    	return false;
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrix_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSOperationsMetadata_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSOperationsMetadata_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSOperationsMetadata_1_0_0.java	(revision 6892)
@@ -0,0 +1,225 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSOperationsMetadataImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Metadata related to WMTS operations in this server
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSOperationsMetadata_1_0_0 extends WMTSOperationsMetadataImpl {
+	/**
+     * Parses a theme
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if(compareName(parser, Tags.OPERATION)) {
+	                    parseOperation(parser);				
+	                }  				
+	                break;
+				case KXmlParser.END_TAG:
+					if(compareName(parser, Tags.OPERATIONS_METADATA))
+	                    end = true;
+	                break;
+				case KXmlParser.TEXT:					
+					break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+    
+    private void parseOperation(KXmlParser parser) throws IOException, XmlPullParserException {
+        int currentTag;
+        boolean end = false;    
+
+        currentTag = parser.getEventType();
+
+        while (!end) {
+            switch(currentTag) {
+            case KXmlParser.START_TAG:
+                if (compareName(parser, Tags.OPERATION)) {
+                    String operation = null;
+                    for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+                        if (parser.getAttributeName(i).compareTo(Tags.OPERATION_NAME) == 0) {
+                            operation = parser.getAttributeValue(i);
+                        }
+                    }               
+                    currentTag = parser.nextTag();
+                    if (compareName(parser, Tags.DCP)) {          
+                        currentTag = parser.nextTag();
+                        if(compareName(parser, Tags.HTTP)) {
+                            currentTag = parser.nextTag();
+                            if(compareName(parser, Tags.GET)) {
+                                String value = null;
+                                for (int i=0 ;i < parser.getAttributeCount() ;i++) {
+                                    if (parser.getAttributeName(i).compareTo(Tags.HREF) == 0) {
+                                        value = parser.getAttributeValue(i);
+                                    }
+                                }   
+                                if (operation != null) {
+                                    if (value == null) {
+                                        addOperation(operation, Tags.PROTOCOL_GET);
+                                    } else {
+                                        addOperation(operation, Tags.PROTOCOL_GET, value);
+                                    }   
+                                }
+                            }
+                        }
+                    }
+                }               
+                break;
+            case KXmlParser.END_TAG:
+                if (compareName(parser, Tags.OPERATION))
+                    end = true;
+                break;
+            case KXmlParser.TEXT:                   
+                break;
+            }
+            if (!end) {
+                currentTag = parser.next();
+            }
+        }
+    }   
+    
+    /**
+     * Parse an operation into a DcpType tag
+     * @param parser
+     * The KXMLParser
+     * @param operation
+     * The WFS operation to parse
+     * @throws IOException 
+     * @throws XmlPullParserException 
+     */
+    protected void parserDcpType(KXmlParser parser, String operation) throws XmlPullParserException, IOException {        
+        int currentTag;
+        boolean end = false;
+
+        currentTag = parser.next();
+
+        while (!end) {
+            switch(currentTag) {
+            case KXmlParser.START_TAG:
+                if(compareName(parser, Tags.HTTP)) {
+                    parseHTTPTag(parser, operation);
+                }	         
+                break;
+            case KXmlParser.END_TAG:
+                if (compareName(parser, Tags.DCPTYPE))
+                    end = true;
+                break;
+            case KXmlParser.TEXT:                   
+                break;
+            }
+            if (!end) {
+                currentTag = parser.next();
+            }
+        }     
+    }
+    
+    /**
+     * Parse an operation into a HTTP tag
+     * @param parser
+     * The KXMLParser
+     * @param operation
+     * The WFS operation to parse
+     * @throws IOException 
+     * @throws XmlPullParserException 
+     */
+    protected void parseHTTPTag(KXmlParser parser, String operation) throws XmlPullParserException, IOException {        
+        int currentTag;
+        boolean end = false;
+
+        currentTag = parser.next();
+        int protocol = -1;
+
+        while (!end) {
+            switch(currentTag) {
+            case KXmlParser.START_TAG:
+                if(compareName(parser, Tags.GET)) {
+                    protocol = Tags.PROTOCOL_GET;
+                    addOperationByAttribute(parser, operation, protocol);
+                } else if(compareName(parser, Tags.POST)) {
+                    protocol = Tags.PROTOCOL_POST;
+                    addOperationByAttribute(parser, operation, protocol);
+                } else if(compareName(parser, Tags.ONLINERESOURCE)) {
+                    addOperationByAttribute(parser, operation, protocol);
+                }				
+                break;
+            case KXmlParser.END_TAG:
+                if (compareName(parser, Tags.HTTP))
+                    end = true;
+                break;
+            case KXmlParser.TEXT:                   
+                break;
+            }
+            if (!end) {
+                currentTag = parser.next();
+            }
+        }     
+    }
+
+    /**
+     * Add an operation and the online resource 
+     * @param parser
+     * The parser
+     * @param operation
+     * The operation to add
+     * @param protocol
+     * The parser to add
+     */
+    protected void addOperationByAttribute(KXmlParser parser, String operation, int protocol) {
+        String value = null;
+        if (protocol > -1) {
+            for (int i = 0 ;i < parser.getAttributeCount(); i++) {
+                if ((parser.getAttributeName(i).toUpperCase().compareTo(Tags.ONLINERESOURCE.toUpperCase()) == 0) ||
+                    (parser.getAttributeName(i).equals(Tags.XLINK_HREF))){					
+                    value = parser.getAttributeValue(i);
+                }
+            }								
+            if (value == null) {
+                addOperation(operation, protocol);
+            } else {
+                addOperation(operation, protocol, value);
+            }
+        }  
+    }
+
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSOperationsMetadata_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSDimension_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSDimension_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSDimension_1_0_0.java	(revision 6892)
@@ -0,0 +1,85 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSDimensionImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Description of an image that represents the legend of the map
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSDimension_1_0_0 extends WMTSDimensionImpl {
+	/**
+     * Parses the dimension section
+     * @param parser
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	//parser.require(KXmlParser.START_TAG, null, Tags.WMTS_DIMENSIONS);
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_IDENTIFIER)) {
+						setIdentifier(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_TITLE)) {
+						setTitle(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_ABSTRACT)) {
+						setAbstract(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_KEYWORDS)) {
+						parser.skipSubTree();
+					} else if (compareName(parser, Tags.WMTS_UNITSYMBOL)) {
+						setUnitSymbol(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_DEFAULTVALUE)) {
+						setDefaultValue(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_CURRENT)) {
+						Boolean b = new Boolean(nextText(parser));
+						setCurrent(b.booleanValue());
+					} else if (compareName(parser, Tags.WMTS_AVAILABLEVALUE)) {
+						addAvailableValue(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_UOM)) {
+						setUOM(nextText(parser));
+					}
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_DIMENSION))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSDimension_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSThemes_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSThemes_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSThemes_1_0_0.java	(revision 6892)
@@ -0,0 +1,88 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSBaseStruct;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSThemeImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSThemesImpl;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Layer hierarchy using the protocol version 1.0.0
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSThemes_1_0_0 extends WMTSThemesImpl {
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * Parses the list of themes
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+	public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_THEME)) {
+						WMTSThemeImpl newTheme = new WMTSTheme_1_0_0();
+						newTheme.parse(parser);
+						add(newTheme);
+					} 			
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_THEMES))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+    
+    /**
+     * Compares the next name in the selected parser with the string passed
+     * by value.
+     * @param parser
+     * @param name
+     * @return
+     */
+    public boolean compareName(KXmlParser parser, String name) {
+    	String s = parser.getName();
+    	if(s.compareTo(name) == 0 || s.compareTo(WMTSBaseStruct.gmlTag + name) == 0)
+    		return true;
+    	return false;
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSThemes_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixSet_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixSet_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixSet_1_0_0.java	(revision 6892)
@@ -0,0 +1,99 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSBoundingBoxImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileMatrixImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileMatrixSetImpl;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSet;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+
+/**
+ * <p>Defines a OGC style. Theme that describes the appeareance of certain layer.</p>
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSTileMatrixSet_1_0_0 extends WMTSTileMatrixSetImpl {
+	
+	public void parse(KXmlParser parser, List<WMTSTileMatrixSet> matrixSetList) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_IDENTIFIER)) {
+						setIdentifier(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_TITLE)) {
+						setTitle(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_ABSTRACT)) {
+						setAbstract(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_KEYWORDS)) {
+						parser.skipSubTree();
+					} else if (compareName(parser, Tags.WMTS_BOUNDINGBOX)) {
+						getBoundingBox().parse(parser);
+					} else if (compareName(parser, Tags.WMTS_SUPPORTEDCRS)) {
+						setSupportedCRS(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_WELLKNOWNSCALESET)) {
+						setWellKnownScaleSet(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_TILEMATRIX)) {
+						WMTSTileMatrixImpl tileMatrix = new WMTSTileMatrix_1_0_0();
+						tileMatrix.setForceChangeAxisOrder(forceChangeAxisOrder);
+						tileMatrix.parse(parser, getTileMatrix()); 
+					}
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_TILEMATRIXSET)) {
+						end = true;
+						matrixSetList.add(this);
+					}
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    	
+    	for (int i = 0; i < getTileMatrix().size(); i++) {
+    		if(bbox != null)
+    			((WMTSTileMatrixImpl)getTileMatrix().get(i)).setBBoxTileMatrixSet(bbox.toRectangle2D());
+			((WMTSTileMatrixImpl)getTileMatrix().get(i)).setSupportedCRS(getSupportedCRS());
+			((WMTSTileMatrixImpl)getTileMatrix().get(i)).checkChangeAxis();
+		}
+    }
+	
+	public WMTSBoundingBoxImpl getBoundingBox() {
+		if(bbox == null) {
+			bbox = new WMTSBoundingBox_1_0_0();
+			//bbox.setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder);
+		}
+		return bbox;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSTileMatrixSet_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSStyle_1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSStyle_1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSStyle_1_0_0.java	(revision 6892)
@@ -0,0 +1,88 @@
+/* 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.ogc.impl.wmts_1_0_0.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSLegendURLImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSStyleImpl;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLegendURL;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * <p>Defines a OGC style. Theme that describes the appeareance of certain layer.</p>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSStyle_1_0_0 extends WMTSStyleImpl {
+	
+	public WMTSLegendURL getLegendURL() {
+		if(legendURL == null)
+			legendURL = new WMTSLegendURL_1_0_0();
+		return legendURL;
+	}
+	
+	/**
+     * Parses the layer's style
+     * @param parser
+     * @param style
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_IDENTIFIER)) {
+						setIdentifier(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_TITLE)) {
+						setTitle(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_ABSTRACT)) {
+						setAbstract(nextText(parser));
+					} else if (compareName(parser, Tags.WMTS_KEYWORDS)) {
+						parser.skipSubTree();
+					} else if (compareName(parser, Tags.WMTS_LEGENDURL)) {
+						((WMTSLegendURLImpl)getLegendURL()).parse(parser);
+					} else if (compareName(parser, Tags.WMTS_ISDEFAULT)) {
+						Boolean b = new Boolean(nextText(parser));
+						setDefault(b.booleanValue());
+					}	
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_STYLE))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/struct/WMTSStyle_1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetFeatureInfoRequest1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetFeatureInfoRequest1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetFeatureInfoRequest1_0_0.java	(revision 6892)
@@ -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.
+* 
+*/
+
+/*
+* AUTHORS (In addition to CIT):
+* 2009 Iver T.I.  {{Task}}
+*/
+ 
+package org.gvsig.raster.wmts.ogc.impl.wmts_1_0_0.request;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSProtocolHandler;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSStatusImpl;
+import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetFeatureInfoRequest;
+
+/**
+ * GetFeatureInfo for WMTS version 1.1.0
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSGetFeatureInfoRequest1_0_0 extends WMTSGetFeatureInfoRequest {
+    
+    public WMTSGetFeatureInfoRequest1_0_0(WMTSStatusImpl status,
+			WMTSProtocolHandler protocolHandler, int x, int y) {
+		super(status, protocolHandler, x, y);		
+	}
+
+    public String getHttpGetRequest(String onlineResource) {
+		StringBuffer req = new StringBuffer();
+		WMTSStatusImpl stat = (WMTSStatusImpl)status;
+		req.append(onlineResource);
+		req.append("Request=GetFeatureInfo");
+		req.append("&Service=WMTS");
+		req.append("&Version=" + protocolHandler.getVersion());
+		req.append("&Layer=" + stat.getLayer());
+		req.append("&Format=" + stat.getFormat());
+		req.append("&Style=" + stat.getStyle());
+		req.append("&TileMatrixSet=" + stat.getTileMatrixSet());
+		req.append("&TileMatrix=" + stat.getTileMatrix());
+		req.append("&TileRow=" + stat.getTileRow());
+		req.append("&TileCol=" + stat.getTileCol());
+		req.append("&J=" + y);
+		req.append("&I=" + x);
+		req.append("&InfoFormat=" + stat.getInfoFormat());
+		return req.toString();
+	}
+	
+	/**
+	 * @return the exceptions format
+	 */
+    public String getExceptionsFormat(){
+		return Tags.EXCEPTIONS_1_1_x;
+	}
+
+}
+

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetFeatureInfoRequest1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetCapabilitiesRequest1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetCapabilitiesRequest1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetCapabilitiesRequest1_0_0.java	(revision 6892)
@@ -0,0 +1,62 @@
+/* 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.ogc.impl.wmts_1_0_0.request;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSProtocolHandler;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSServerDescription;
+import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetCapabilitiesRequest;
+
+/**
+ * Class for a GetCapabilities WMTS request using the version 1.0.0
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSGetCapabilitiesRequest1_0_0 extends WMTSGetCapabilitiesRequest {
+
+	/**
+	 * @param status
+	 * @param protocolHandler
+	 */
+	public WMTSGetCapabilitiesRequest1_0_0(WMTSServerDescription status,
+			WMTSProtocolHandler protocolHandler) {
+		super(status, protocolHandler);		
+	}
+
+	public String getHttpGetRequest(String onlineResource) {
+		StringBuffer req = new StringBuffer();
+		req.append(onlineResource);
+		req.append("REQUEST=GetCapabilities&SERVICE=WMTS&");
+		req.append("VERSION=").append(protocolHandler.getVersion());
+		req.append("&EXCEPTIONS=" + getExceptionsFormat()); 
+		return req.toString();
+	}
+	
+	/**
+	 * @return the exceptions format
+	 */
+	protected String getExceptionsFormat(){
+		return Tags.EXCEPTIONS_1_1_x;
+	}
+
+}
+

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetCapabilitiesRequest1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetTileRequest1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetTileRequest1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetTileRequest1_0_0.java	(revision 6892)
@@ -0,0 +1,54 @@
+/* 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.ogc.impl.wmts_1_0_0.request;
+
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSProtocolHandler;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSStatusImpl;
+import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetTileRequest;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSGetTileRequest1_0_0 extends WMTSGetTileRequest {
+    
+	public WMTSGetTileRequest1_0_0(WMTSStatusImpl status,
+			WMTSProtocolHandler protocolHandler) {
+		super(status, protocolHandler);		
+	}
+
+	public String getHttpGetRequest(String onlineResource) {
+		StringBuffer req = new StringBuffer();
+		req.append(onlineResource);
+		req.append("REQUEST=GetTile&SERVICE=WMTS&VERSION=").append(protocolHandler.getVersion()).append("&");
+		req.append(getPartialQuery((WMTSStatusImpl)status));   
+		//System.out.println("==>" + req);
+		return req.toString();
+	}
+
+}
+

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/request/WMTSGetTileRequest1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/WMTSProtocolHandler1_0_0.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/WMTSProtocolHandler1_0_0.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/WMTSProtocolHandler1_0_0.java	(revision 6892)
@@ -0,0 +1,185 @@
+/* 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.ogc.impl.wmts_1_0_0;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.EncodingXMLParser;
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSProtocolHandler;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSServerDescription;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSStatusImpl;
+import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetCapabilitiesRequest;
+import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetFeatureInfoRequest;
+import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetTileRequest;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSLayerImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileMatrixSetImpl;
+import org.gvsig.raster.wmts.ogc.impl.wmts_1_0_0.request.WMTSGetCapabilitiesRequest1_0_0;
+import org.gvsig.raster.wmts.ogc.impl.wmts_1_0_0.request.WMTSGetFeatureInfoRequest1_0_0;
+import org.gvsig.raster.wmts.ogc.impl.wmts_1_0_0.request.WMTSGetTileRequest1_0_0;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Describes the handler to comunicate to a WMTS 1.0.0
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSProtocolHandler1_0_0 extends WMTSProtocolHandler {
+	private String                    gmlTag             = Tags.WMTS_GMLTAG;
+    
+	public WMTSProtocolHandler1_0_0() {
+		this.version = "1.0.0";
+		this.name = "WMS1.0.0";
+		//this.serviceInfo = new WMTSServiceInformation(); 
+	}
+	
+	public boolean parseCapabilities(File f) {       
+    	int tag;
+    	EncodingXMLParser parser = null;
+    	parser = new EncodingXMLParser();
+    	if(getServerDescription() != null)
+    		getServerDescription().clear();
+    	try {
+    		parser.setInput(f);
+    		parser.nextTag();
+    		if ( parser.getEventType() != KXmlParser.END_DOCUMENT ) {    		
+    			parser.require(KXmlParser.START_TAG, null, Tags.WMTS_CAPABILITIES);    			
+    			tag = parser.nextTag();
+				 while(tag != KXmlParser.END_DOCUMENT) {
+                     switch(tag) {
+                         
+						case KXmlParser.START_TAG:
+							if (compareName(parser, Tags.WMTS_SERVICEID)) {
+								getServerDescription().getServiceIdentification().parse(parser);
+							} else if (compareName(parser, Tags.WMTS_SERVICEPROV )) {
+								getServerDescription().getServiceProvider().parse(parser);
+							} else if (compareName(parser, Tags.WMTS_OPMETADATA)) {
+								getServerDescription().getOperationsMetadata().parse(parser);
+							} else if (compareName(parser, Tags.WMTS_CONTENTS )) {
+								parseServiceContent(parser, getServerDescription());
+							} else if (compareName(parser, Tags.WMTS_THEMES )) {
+								getServerDescription().getThemes().parse(parser);
+							}
+							break;
+						case KXmlParser.END_TAG:							
+							break;
+						case KXmlParser.TEXT:
+												
+						break;
+					 }
+    				 tag = parser.next();
+    			 }
+
+    			parser.require(KXmlParser.END_DOCUMENT, null, null);
+    		}
+    	} catch(XmlPullParserException parser_ex) {
+    		parser_ex.printStackTrace();
+    		return false;
+    	} catch (IOException ioe) {			
+   			ioe.printStackTrace();
+   			return false;
+		} 
+    	
+    	//Calcula las referencias a las capas dentro de los temas
+    	getServerDescription().getThemes().calculateLayers(getServerDescription().getLayerList());
+    	//Se calculan los temas como lista de capas
+    	getServerDescription().getLayerListAsThemes().loadThemesWithLayerInfo(getServerDescription().getLayerList(), getServerDescription());
+    	
+    	//Asocia los TileMatrixSet a los TileMatrixLimits
+    	for (int i = 0; i < getServerDescription().getLayerList().size(); i++) {
+			WMTSLayerImpl layer = (WMTSLayerImpl)getServerDescription().getLayerList().get(i);
+			layer.linkTileMatrixSets(getServerDescription().getTileMatrixSet());
+		}
+        return true;
+    } 
+    
+    /**
+     * Parses the Content section    
+     * @param parser
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    private void parseServiceContent(KXmlParser parser, WMTSServerDescription content) throws IOException, XmlPullParserException {
+    	int currentTag;
+    	boolean end = false;
+    	
+    	currentTag = parser.next();
+    	
+    	while (!end) {
+			 switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, Tags.WMTS_LAYER)) {
+						WMTSLayerImpl layer = content.buildNewLayer();
+						layer.setForceChangeAxisOrder(forceChangeAxisOrder);
+						layer.parse(parser);
+					} else if (compareName(parser, Tags.WMTS_OTHERSRC)) {
+						parseOtherSource(parser); 
+					} else if (compareName(parser, Tags.WMTS_TILEMATRIXSET)) {
+						WMTSTileMatrixSetImpl mSet = (WMTSTileMatrixSetImpl)content.createVersionObject("WMTSTileMatrixSet");
+						mSet.setForceChangeAxisOrder(forceChangeAxisOrder);
+						mSet.parse(parser, content.getTileMatrixSet()); 
+					}			
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, Tags.WMTS_CONTENTS))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+				break;
+			 }
+             if (!end)
+                 currentTag = parser.next();
+    	}
+    }
+    
+    private void parseOtherSource(KXmlParser parser) throws IOException, XmlPullParserException {
+    	parser.skipSubTree();
+    }
+    
+    /**
+     * Compares the next name in the selected parser with the string passed
+     * by value.
+     * @param parser
+     * @param name
+     * @return
+     */
+    private boolean compareName(KXmlParser parser, String name) {
+    	String s = parser.getName();
+    	if(s.compareTo(name) == 0 || s.compareTo(gmlTag + name) == 0)
+    		return true;
+    	return false;
+    }
+
+    public WMTSGetCapabilitiesRequest createGetCapabilitiesRequest() {
+		return new WMTSGetCapabilitiesRequest1_0_0(getServerDescription(), this);
+	}
+	
+	public WMTSGetTileRequest createGetTileRequest(WMTSStatusImpl status) {
+		return new WMTSGetTileRequest1_0_0(status, this);
+	}
+	
+	public WMTSGetFeatureInfoRequest createGetFeatureInfoRequest(WMTSStatusImpl status, int x, int y) {
+		return new WMTSGetFeatureInfoRequest1_0_0(status, this, x, y);
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/wmts_1_0_0/WMTSProtocolHandler1_0_0.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSServerDescription.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSServerDescription.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSServerDescription.java	(revision 6892)
@@ -0,0 +1,287 @@
+/* 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.ogc.impl.base;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.exception.WMTSException;
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSLayerImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSOperationsMetadataImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSServiceIdentificationImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSServiceProviderImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSThemesImpl;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSet;
+
+
+/**
+ * Describes the status of a WMTSclient, so it adds to the Remote client status
+ * a list of layers, a list of layer styles, the extent of the map.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSServerDescription {
+	// width and heigh of the map
+    private int                           width;
+    private int                           height;
+    //format of the image to be retrieved
+    private String                        format             = null;
+    private String                        infoFormat         = null;
+    // spatial reference system of the image to be retrieved
+    private String                        srs                = null;
+    // exception format, to be retrieved in case of error
+    private String                        exceptionFormat    = null;
+    //To set if the client has to use GET or POST
+	private int                           protocol           = Tags.PROTOCOL_UNDEFINED;
+	private List<WMTSLayer>               layerList          = null;
+	private List<WMTSTileMatrixSet>       tileMatrixSet      = null;
+	private WMTSThemesImpl                themes             = null;
+	private WMTSThemesImpl                themesAsLayerList  = null;
+	private WMTSServiceIdentificationImpl serviceId          = null;
+	private WMTSServiceProviderImpl       serviceProv        = null;
+	private WMTSOperationsMetadataImpl    operationsMetadata = null;
+	private String                        version            = null;
+	
+	public WMTSServerDescription(String version) {
+		this.version = version;
+	}
+	
+	public int getWidth() {        
+        return width;
+    }
+    
+    public void setWidth(int _width) {        
+    	width = _width;
+    } 
+
+    public int getHeight() {                
+        return height;
+    } 
+    public void setHeight(int _height) {        
+        height = _height;
+    } 
+
+    public String getFormat() {        
+        return format;
+    }
+    
+    public void setFormat(String _format) {        
+        format = _format;
+    } 
+    
+    public String getInfoFormat() {        
+        return infoFormat;
+    } 
+    
+    public void setInfoFormat(String _format) {        
+        infoFormat = _format;
+    } 
+
+    public String getSrs() {        
+        return srs;
+    } 
+
+    public void setSrs(String _srs) {        
+        srs = _srs;
+    } 
+
+    public void setExceptionFormat(String _format) {        
+        exceptionFormat = _format;
+    } 
+    
+    public String getExceptionFormat() {        
+        return exceptionFormat;
+    }
+    
+	public int getProtocol() {
+		return protocol;
+	}
+	
+	public void setProtocol(int protocol) {
+		this.protocol = protocol;
+	}
+	
+	/**
+	 * Builds a new layer using the version number
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	public WMTSLayerImpl buildNewLayer() {
+		try {
+			Class clase;
+			version = version.replace('.', '_');
+			clase = Class.forName("org.gvsig.raster.wmts.ogc.impl.wmts_" + version + ".struct.WMTSLayer_" + version);
+			Class [] args = {WMTSServerDescription.class};
+			try {
+				Constructor hazNuevo = clase.getConstructor(args);
+				Object [] args2 = {this};
+				return (WMTSLayerImpl) hazNuevo.newInstance(args2);
+			} catch (SecurityException e) {
+				throw new WMTSException("Error SecurityException in open", e);
+			} catch (NoSuchMethodException e) {
+				throw new WMTSException("Error NoSuchMethodException in open", e);
+			} catch (IllegalArgumentException e) {
+				throw new WMTSException("Error IllegalArgumentException in open", e);
+			} catch (InstantiationException e) {
+				throw new WMTSException("Error InstantiationException in open", e);
+			} catch (IllegalAccessException e) {
+				throw new WMTSException("Error IllegalAccessException in open", e);
+			} catch (InvocationTargetException e) {
+				throw new WMTSException("Error opening this image with " + clase, e);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			//throw new Exception("WMSDriverFactory. Unknown driver version " + e);
+			return null;
+		}
+	}
+	
+	/**
+	 * It creates an instance of a WMSDriver class.
+	 *
+	 * @param String, with the version of the driver to be created
+	 * @return WMSDriver.
+	 */
+	public Object createVersionObject(String className) {
+		return createVersionObject(className, version);
+	}
+	
+    /**
+     * It creates an instance of a WMSDriver class.
+     *
+     * @param String, with the version of the driver to be created
+     * @return WMSDriver.
+     */
+	public Object createVersionObject(String className, String version) {
+		try {
+			Class<?> driver;
+			version = version.replace('.', '_');
+			driver = Class.forName("org.gvsig.raster.wmts.ogc.impl.wmts_" + version + ".struct." + className + "_" + version);
+			return driver.newInstance();
+		} catch (Exception e) {
+			e.printStackTrace();
+			//throw new Exception("WMSDriverFactory. Unknown driver version " + e);
+			return null;
+		}
+	}
+	
+	/**
+	 * Gets the OperationMetadata information
+	 * @return
+	 */
+	public WMTSOperationsMetadataImpl getOperationsMetadata() {
+		if(operationsMetadata == null)
+			operationsMetadata = (WMTSOperationsMetadataImpl)createVersionObject("WMTSOperationsMetadata", version);
+		return operationsMetadata;
+	}
+
+	/**
+	 * Gets the ServiceIdentification information
+	 * @return
+	 */
+	public WMTSServiceIdentificationImpl getServiceIdentification() {
+		if(serviceId == null)
+			serviceId = (WMTSServiceIdentificationImpl)createVersionObject("WMTSServiceIdentification", version);
+		return serviceId;
+	}
+	
+	/**
+	 * Gets the layer structure
+	 * @return
+	 */
+	public WMTSServiceProviderImpl getServiceProvider() {
+		if(serviceProv == null)
+			serviceProv = (WMTSServiceProviderImpl)createVersionObject("WMTSServiceProvider", version);
+		return serviceProv;
+	}
+	
+	/**
+	 * Gets the list of WMTSLayer
+	 */
+	public List<WMTSLayer> getLayerList() {
+		if(layerList == null)
+			layerList = new ArrayList<WMTSLayer>();
+		return layerList;
+	}
+	
+	/**
+	 * Gets the list of WMTSTileMatrixSet
+	 * @return
+	 */
+	public List<WMTSTileMatrixSet> getTileMatrixSet() {
+		if(tileMatrixSet == null)
+			tileMatrixSet = new ArrayList<WMTSTileMatrixSet>();
+		return tileMatrixSet;
+	}
+	
+	/**
+	 * Gets the layer structure whether the server offer this service
+	 * @return
+	 */
+	public WMTSThemesImpl getThemes() {
+		if(themes == null)
+			themes = (WMTSThemesImpl)createVersionObject("WMTSThemes", version);
+		return themes;
+	}
+	
+	/**
+	 * Returns the list of layers as themes
+	 * @return
+	 */
+	public WMTSThemesImpl getLayerListAsThemes() {
+		if(themesAsLayerList == null)
+			themesAsLayerList = (WMTSThemesImpl)createVersionObject("WMTSThemes", version);
+		return themesAsLayerList;
+	}
+	
+	/**
+	 * Gets a layer by its title
+	 * @param titleLayer
+	 * @return
+	 */
+	public WMTSLayerImpl getLayerByTitle(String titleLayer) {
+		for (int i = 0; i < layerList.size(); i++) {
+			WMTSLayerImpl layer = ((WMTSLayerImpl)layerList.get(i));
+			if(layer.getTitle().compareTo(titleLayer) == 0) {
+				return layer;
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Clean all attributes
+	 */
+	public void clear() {
+		if(layerList != null)
+			layerList.clear();
+		if(tileMatrixSet != null)
+			tileMatrixSet.clear();
+		themes = null;
+		serviceId = null;
+		serviceProv = null;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSServerDescription.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSProtocolHandler.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSProtocolHandler.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSProtocolHandler.java	(revision 6892)
@@ -0,0 +1,750 @@
+/* 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.ogc.impl.base;
+
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.prefs.Preferences;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import org.gvsig.compat.CompatLocator;
+import org.gvsig.compat.net.Downloader;
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.gui.beans.incrementabletask.IncrementableProcess;
+import org.gvsig.raster.wmts.ogc.WMTSStatus;
+import org.gvsig.raster.wmts.ogc.exception.DownloadException;
+import org.gvsig.raster.wmts.ogc.exception.ServerErrorException;
+import org.gvsig.raster.wmts.ogc.exception.WMTSException;
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.Utilities;
+import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetCapabilitiesRequest;
+import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetFeatureInfoRequest;
+import org.gvsig.raster.wmts.ogc.impl.request.WMTSGetTileRequest;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSOperationsMetadata;
+import org.gvsig.raster.wmts.ogc.struct.WMTSStyle;
+import org.kxml2.io.KXmlParser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * <p> Abstract class that represents handlers to comunicate via WMS protocol.</p>
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSProtocolHandler {
+    private static final Logger logger = LoggerFactory
+            .getLogger(WMTSProtocolHandler.class);
+
+	protected static final Downloader downloader = CompatLocator.getDownloader();
+	/**
+	 * Encoding used to parse different xml documents.
+	 */
+	protected String                 encoding                     = "UTF-8";
+	private static int               count                        = 0;
+	final String                     tempDirectoryPath            = System.getProperty("java.io.tmpdir")+"/tmp-andami";
+	protected boolean                forceChangeAxisOrder         = false;
+    protected String                 name;
+    protected String                 version;
+    protected String                 host;
+    protected String                 port;  
+    private WMTSServerDescription    serverDescription            = null;
+	
+    protected abstract WMTSGetFeatureInfoRequest createGetFeatureInfoRequest(WMTSStatusImpl status, int x, int y);
+
+    protected abstract WMTSGetTileRequest createGetTileRequest(WMTSStatusImpl status);
+    
+    protected abstract WMTSGetCapabilitiesRequest createGetCapabilitiesRequest();
+    
+    /**
+     * parses the data retrieved by the Capabilities XML document
+     */
+    public abstract boolean parseCapabilities(File f);
+    
+	public WMTSServerDescription getServerDescription() {
+		if(serverDescription == null) {
+			serverDescription = new WMTSServerDescription(getVersion());
+		}
+		return this.serverDescription;
+	}
+
+    /**
+     * @return Returns the host.
+     */
+    public String getHost() {
+        return host;
+    }
+    /**
+     * @param host The host to set.
+     */
+    public void setHost(String host) {
+        this.host = host;
+    }
+    /**
+     * @return Returns the name.
+     */
+    public String getName() {
+        return name;
+    }
+    /**
+     * @param name The name to set.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+    /**
+     * @return Returns the port.
+     */
+    public String getPort() {
+        return port;
+    }
+    /**
+     * @param port The port to set.
+     */
+    public void setPort(String port) {
+        this.port = port;
+    }
+    /**
+     * @return Returns the version.
+     */
+    public String getVersion() {
+        return version;
+    }
+    /**
+     * @param version The version to set.
+     */
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    /**
+     * Just for not repeat code. Gets the correct separator according 
+     * to the server URL
+     * @param h
+     * @return
+     */
+    public String getSymbol(String h) {
+        String symbol;
+        if (h.indexOf("?")==-1) 
+            symbol = "?";
+        else if (h.indexOf("?")!=h.length()-1)
+            symbol = "&";
+        else
+            symbol = "";
+        return symbol;
+    }  
+
+    /**
+     * Copy the file in a byte array
+     * @param file
+     * The file to copy
+     * @return
+     * An array of bytes
+     * @throws IOException
+     */
+    protected byte[] fileToBytes(File file) throws IOException {
+        FileInputStream fis = null;
+        byte[] bytes = null;
+        try{
+            fis = new FileInputStream(file);
+
+            //long length = file.length(); 
+            bytes = new byte[(int)file.length()];
+
+            int offset = 0;
+            int numRead = 0; 
+            while (offset < bytes.length && 
+            	(numRead = fis.read(bytes, offset, bytes.length-offset)) >= 0) { 
+                offset += numRead; 
+            }
+        } catch (IOException e) {
+            throw e;
+        } finally {
+            if (fis != null) {
+                fis.close();
+            }
+        }         
+        return bytes;
+    }
+    
+    /**
+	 * Sets longitude first in the axis order read from the capabilities file
+	 * @param force
+	 */
+	public void setForceChangeAxisOrder(boolean force) {
+		this.forceChangeAxisOrder = force;
+	}
+	
+    //**************************************************************
+    //Esto es temporal hasta que est� la cach�
+    
+	private Hashtable<URL, String>                downloadedFiles;
+    /**
+	 * Returns the content of a URL as a file from the file system.<br>
+	 * <p>
+	 * If the URL has been already downloaded in this session and notified
+	 * to the system using the static <b>Utilities.addDownloadedURL(URL)</b>
+	 * method, it can be restored faster from the file system avoiding to
+	 * download it again.
+	 * </p>
+	 * @param url
+	 * @return File containing this URL's content or null if no file was found.
+	 */
+	private File getPreviousDownloaded(Object object) {
+		File f = null;
+		if (downloadedFiles != null && downloadedFiles.containsKey(object)) {
+			String filePath = (String) downloadedFiles.get(object);
+			f = new File(filePath);
+			if (!f.exists())
+				return null;
+		}
+		return f;
+	}
+
+	/**
+	 * Adds an URL to the table of downloaded files for further uses. If the URL
+	 * already exists in the table its filePath value is updated to the new one and
+	 * the old file itself is removed from the file system.
+	 *
+	 * @param url
+	 * @param filePath
+	 */
+	void addDownloadedURL(URL url, String filePath) {
+		if (downloadedFiles == null)
+			downloadedFiles = new Hashtable<URL, String>();
+		downloadedFiles.put(url, filePath);
+	}
+	
+	//Fin del c�digo temporal hasta que est� la cach�
+	//**************************************************************
+    
+    public synchronized File getTile(WMTSStatusImpl status, ICancellable cancel, File file) throws ServerErrorException, WMTSException {
+    	try {
+			WMTSGetTileRequest request = createGetTileRequest(status);
+			request.sendRequest(cancel, file);
+			try {
+				checkFileError(file);
+			} catch(WMTSException e) {
+				file.delete();
+				throw new WMTSException("This tile is not available:" + file.getAbsoluteFile().toString(), e);
+			} catch(IOException e) {
+				file.delete();
+				throw new WMTSException("This tile is not available:" + file.getAbsoluteFile().toString(), e);
+			}
+			return file;
+		} catch(IOException e) {
+            throw new WMTSException(e);
+		}
+    }
+    
+    public synchronized File getTile(WMTSStatus status, ICancellable cancel) throws ServerErrorException, WMTSException {
+    	try {
+			WMTSGetTileRequest request = createGetTileRequest((WMTSStatusImpl)status);
+			File f = request.sendRequest(cancel);
+			try {
+				checkFileError(f);
+			} catch(WMTSException e) {
+				downloader.removeURL(request);
+	            throw new ServerErrorException();
+			}
+			return f;
+		} catch(IOException e) {
+			e.printStackTrace();
+            throw new ServerErrorException();
+		}
+    }
+    
+    public synchronized File getTile(String url, ICancellable cancel, File file) throws ServerErrorException, WMTSException {
+    	try {
+			downloadFile(new URL(url), cancel, file);
+			try {
+				checkFileError(file);
+			} catch(WMTSException e) {
+				file.delete();
+				throw new WMTSException("This tile is not available:" + file.getAbsoluteFile().toString(), e);
+			} catch(IOException e) {
+				file.delete();
+				throw new WMTSException("This tile is not available:" + file.getAbsoluteFile().toString(), e);
+			}
+			return file;
+		} catch(IOException e) {
+            throw new WMTSException(e);
+		} catch (DownloadException e1) {
+			throw new WMTSException(e1);
+		}
+    }
+    
+    /**
+     * Checks if the file downloaded is correct or doesn't
+     * @param f
+     * @throws WMTSException
+     * @throws IOException
+     */
+    private void checkFileError(File f) throws WMTSException, IOException {
+		if (f == null)
+    		return;
+    	if (Utilities.isTextFile(f)) {
+            byte[] data = fileToBytes(f);
+
+        	String exceptionMessage = parseException(data);
+            if (exceptionMessage == null) {
+             	String error = new String(data);
+            	int pos = error.indexOf("<?xml");
+            	if (pos!= -1) {
+            		String xml = error.substring(pos,error.length());
+            		exceptionMessage = parseException(xml.getBytes());
+            	}
+                if (exceptionMessage == null)
+                	exceptionMessage = new String(data);
+
+            }
+            throw new WMTSException(exceptionMessage);
+        }
+    }
+    
+    public synchronized URL getTileURL(WMTSStatusImpl status) throws MalformedURLException {
+    	String onlineResource = getBaseURL(Tags.GETTILE);
+
+		StringBuffer req = new StringBuffer();
+		req.append(onlineResource)
+		.append("REQUEST=GetTile&SERVICE=WMTS&VERSION=").append(getVersion()).append("&")
+		.append("Layer=" + status.getLayer())
+        .append("&Style=" + status.getStyle())
+        .append("&Format=" + status.getFormat())
+        .append("&TileMatrixSet=" + status.getTileMatrixSet())
+        .append("&TileMatrix=" + status.getTileMatrix())
+        .append("&TileRow=" + status. getTileRow())
+        .append("&TileCol=" + status.getTileCol());
+		
+		return new URL(req.toString());
+    }
+    
+    /**
+     * Gets the URL base for a operation (GetCapabilities, GetTile, ...)
+     * @param operation
+     * @return the base URL for the GET protocol or the host passed by the user 
+     * if it does not exists. 
+     */
+    public String getBaseURL(String operation) {
+    	String onlineResource = null;
+    	WMTSServerDescription svDescription = getServerDescription();
+    	if(svDescription != null) {
+    		WMTSOperationsMetadata opMetadata = svDescription.getOperationsMetadata();
+    		if(opMetadata != null)
+    			onlineResource = opMetadata.getOnlineResource(operation);
+    	}
+    	if(onlineResource == null)
+    		onlineResource = getHost();
+		String symbol = getSymbol(onlineResource);
+		onlineResource = onlineResource + symbol;
+		return onlineResource;
+    }
+    
+    /**
+     * Gets the URL base for a operation (GetCapabilities, GetTile, ...) and 
+     * a protocol GET or POST
+     * @param operation
+     * @return the base URL for this protocol or null if it does not exists. 
+     */
+    public String getBaseURL(String operation, int protocol) {
+    	String onlineResource = null;
+    	WMTSServerDescription svDescription = getServerDescription();
+    	if(svDescription != null) {
+    		WMTSOperationsMetadata opMetadata = svDescription.getOperationsMetadata();
+    		if(opMetadata != null) {
+    			onlineResource = opMetadata.getOnlineResource(operation, protocol);
+    			if(onlineResource != null) {
+    				String symbol = getSymbol(onlineResource);
+    				return onlineResource + symbol;
+    			}
+    		}
+    	}
+		return null;
+    }
+    
+    /**
+     * Gets a file name to download. I
+     * @param url
+     * @return
+     */
+    private File getFile() {
+    	count ++;
+		int index = name.lastIndexOf(".");
+		if (index > 0){
+			return new File(tempDirectoryPath + "/" + name.substring(0,index) + System.currentTimeMillis() + count + 
+				name.substring(index, name.length()));
+		}
+		return new File(tempDirectoryPath + "/" + name + System.currentTimeMillis() + count);
+    }
+    
+    public synchronized File downloadFile(URL url, ICancellable cancel, File forceFile) throws DownloadException {
+    	if(forceFile == null) {
+    		File f = null;
+    		if((f = getPreviousDownloaded(url)) != null)
+    			return f;
+    	}
+    		
+    	Preferences prefs = Preferences.userRoot().node( "gvsig.downloader" );
+    	int IO_BUFFER_SIZE = 8 * 1024;
+		int timeout = prefs.getInt("timeout", 60000);
+		
+		File dstFile = forceFile;
+		if(dstFile == null)
+			dstFile = getFile();
+		
+		DataOutputStream dos;
+		try {
+			DataInputStream is;
+			//OutputStreamWriter os = null;
+			HttpURLConnection connection = null;
+
+			if (url.getProtocol().equals("https")) {
+				disableHttsValidation();
+			}
+			connection = (HttpURLConnection)url.openConnection();
+			connection.setConnectTimeout(timeout);
+			
+			is = new DataInputStream(url.openStream());
+			
+			dos = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(dstFile)));
+			byte[] buffer = new byte[IO_BUFFER_SIZE];
+
+			int read;
+			while ((read = is.read(buffer)) != -1) {
+				dos.write(buffer, 0, read);
+			}
+			
+			/*if(os != null) {
+				os.close();
+			}*/
+			dos.close();
+			is.close();
+			is = null;
+			dos = null;
+			if (cancel != null && cancel.isCanceled()) {
+				dstFile.delete();
+				dstFile = null;
+				return null;
+			}
+		} catch (Exception e) {
+			logger.error("[WMTSProtocolHandler.java:473] " + e);
+			throw new DownloadException(e);
+		}
+		addDownloadedURL(url, dstFile.getAbsolutePath());
+		return dstFile;
+    }
+    
+    /**
+	 * This method disables the Https certificate validation.
+	 * @throws KeyManagementException
+	 * @throws NoSuchAlgorithmException
+	 */
+	private void disableHttsValidation() throws KeyManagementException, NoSuchAlgorithmException{
+		// Create a trust manager that does not validate certificate chains
+		TrustManager[] trustAllCerts = new TrustManager[] {
+				new X509TrustManager() {
+					public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+						return null;
+					}
+					public void checkClientTrusted(
+							java.security.cert.X509Certificate[] certs, String authType) {
+					}
+					public void checkServerTrusted(
+							java.security.cert.X509Certificate[] certs, String authType) {
+					}
+				}
+		};
+
+		// Install the all-trusting trust manager
+		SSLContext sc = SSLContext.getInstance("SSL");
+		sc.init(null, trustAllCerts, new java.security.SecureRandom());
+		HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+	}
+	
+	/**
+     * @return string that represents the url for getting the wms legend
+     * If the layer has the object layer-->style-->legendurl that url will be returned 
+     * otherwise builds the getLegendGraphic according to the OGC WMS Specifications
+     * 
+     */
+    /*private String buildGetLegendGraphicRequest(WMTSLayer layer, WMTSStyle style) {
+    	String onlineResource = style.getLegendURL().getHref();
+		String symbol = getSymbol(onlineResource);
+		String layerName = layer.getTitle();
+		
+		if(onlineResource == null || onlineResource.equals(""))
+			return null;
+
+		StringBuffer req = new StringBuffer();
+		req.append(onlineResource + symbol + "REQUEST=GetLegendGraphic&SERVICE=WMS&VERSION=").append(getVersion());
+        req.append("&LAYER=" + layerName).append("&TRANSPARENT=TRUE").append("&FORMAT=image/png");
+        String aux = req.toString().replaceAll(" ", "%20");
+        System.out.println("GetLegendGraphic url:" + aux);
+		return aux;
+    }*/
+
+	public File getLegendGraphic(WMTSLayer layer, WMTSStyle style, ICancellable cancel) 
+			throws ServerErrorException, WMTSException, DownloadException {
+		URL request = null;
+		try {
+			String requestStr = style.getLegendURL().getHref();
+			if(requestStr == null || requestStr.equals(""))
+				return null;
+			request = new URL(requestStr);
+			System.out.println(requestStr);
+			
+			File f = downloadFile(request, cancel, null);
+			if (f== null)
+				return null;
+			if (Utilities.isTextFile(f)) {
+				FileInputStream fis = new FileInputStream(f);
+				FileChannel fc = fis.getChannel();
+				byte[] data = new byte[(int)fc.size()];
+				ByteBuffer bb = ByteBuffer.wrap(data);
+				fc.read(bb);
+
+				WMTSException wmsEx = null;
+
+				String exceptionMessage = parseException(data);
+				if (exceptionMessage == null) {
+					String error = new String(data);
+					int pos = error.indexOf("<?xml");
+					if (pos!= -1) {
+						String xml = error.substring(pos,error.length());
+						exceptionMessage = parseException(xml.getBytes());
+					}
+					if (exceptionMessage == null)
+						exceptionMessage = new String(data);
+
+				}
+				wmsEx = new WMTSException(exceptionMessage);
+				wmsEx.setWMTSMessage(new String(data));
+				Utilities.removeURL(request);
+				fis.close();
+				throw wmsEx;
+			}
+			return f;
+		} catch(IOException e) {
+			e.printStackTrace();
+			throw new ServerErrorException();
+		}
+	}
+
+	/**
+	 * <p>It will send a GetFeatureInfo request to the WMTS
+     * Parsing the response and redirecting the info to the WMTS client</p>
+     * TODO: return a stored file instead a String.
+     */
+    public String getFeatureInfo(WMTSStatusImpl status, int x, int y, ICancellable cancel) {
+    	StringBuffer output = new StringBuffer();
+    	String outputFormat = new String();
+    	String ServiceException = "ServiceExceptionReport";
+    	StringBuffer sb = new StringBuffer();
+    	sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
+		try {
+			WMTSGetFeatureInfoRequest request = createGetFeatureInfoRequest(status, x, y);
+			URL url = request.getURL();
+	    	outputFormat = url.openConnection().getContentType();
+	    	File f = request.sendRequest(cancel);
+			if (f == null) {
+				return "";
+			}
+
+			FileReader fReader = new FileReader(f);
+			char[] buffer = new char[1024*256];
+			for (int i = fReader.read(buffer);i > 0;i = fReader.read(buffer)) {
+		    	String str = new String(buffer, 0, i);
+		    	output.append(str);
+		    }
+			fReader.close();
+		    if ( (outputFormat == null) || (outputFormat.indexOf("xml") != -1)
+		    		||output.toString().toLowerCase().startsWith("<?xml")
+		    		||(outputFormat.indexOf("gml") != -1)) {
+		    	KXmlParser kxmlParser = null;
+		    	kxmlParser = new KXmlParser();
+		    	//kxmlParser.setInput(new StringReader(output.toString()));
+		    	kxmlParser.setInput(new FileReader(f));
+
+		    	kxmlParser.nextTag();
+		    	if (kxmlParser.getName().compareTo(ServiceException) == 0) {
+		    		sb.append("<INFO>").append(parseException( output.toString().getBytes())).append("</INFO>");
+		    		return sb.toString();
+				} else if (kxmlParser.getName().compareToIgnoreCase("ERROR") == 0) {
+					return output.toString();
+				} else {
+					return output.toString();
+				}
+	    	} else {  		
+	    		 return output.toString();
+	    	}
+		} catch(XmlPullParserException parserEx) {
+    		if (output.toString().toLowerCase().indexOf("xml") != -1) {
+    			return output.toString().trim();
+    		} else {
+    	   		sb.append("<INFO>").append("Info format not supported").append("</INFO>");
+        		return sb.toString();
+    		}
+    	} catch(Exception e) {
+    		e.printStackTrace();
+    		sb.append("<INFO>").append("Info format not supported").append("</INFO>");
+    		return sb.toString();
+    	}
+    }
+
+    /**
+	 * <p>Builds a GetCapabilities request that is sent to the WMS
+	 * the response will be parse to extract the data needed by the
+	 * WMS client</p>
+	 * @param override, if true the previous downloaded data will be overridden
+	 */
+    public void getCapabilities(WMTSServerDescription status, boolean override, ICancellable cancel) {
+    	try {
+    		serverDescription = status;
+			WMTSGetCapabilitiesRequest request = createGetCapabilitiesRequest();
+			File f = request.sendRequest(cancel);			
+	
+			if (f == null)
+				return;
+			parseCapabilities(f);
+	    } catch(Exception e) {
+			e.printStackTrace();
+		}
+    }
+    
+    
+    /**
+     * Builds the GetCapabilitiesRequest according to the OGC WMS Specifications
+     * without a VERSION, to get the highest version than a WMS supports.
+     */
+    public static String buildCapabilitiesSuitableVersionRequest(String _host, String _version) {
+		int index = _host.indexOf('?');
+		
+		if (index > -1) {
+			String host = _host.substring(0, index + 1);
+			String query = _host.substring(index + 1, _host.length());
+			
+			StringTokenizer tokens = new StringTokenizer(query, "&");
+			String newQuery = "", token;
+
+			// If there is a field or a value with spaces, (and then it's on different tokens) -> unify them
+			while (tokens.hasMoreTokens()) {
+				token = tokens.nextToken().trim();
+
+				if (token.toUpperCase().compareTo("REQUEST=GETCAPABILITIES") == 0)
+					continue;
+
+				if (token.toUpperCase().compareTo("SERVICE=WMTS") == 0)
+					continue;
+
+				if ((_version != null) && (_version.length() > 0)) {
+    				if (token.toUpperCase().compareTo("VERSION=" + _version) == 0)
+    					continue;
+				}
+
+				if (token.toUpperCase().compareTo("EXCEPTIONS=XML") == 0)
+					continue;
+
+				newQuery += token + "&";
+			}
+
+        	_host = host + newQuery;
+		}
+		else {
+			_host += "?";
+		}
+
+    	if ((_version != null) && (_version.compareTo("") != 0))
+    		_host += "REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=" + _version;
+    	else
+    		_host += "REQUEST=GetCapabilities&SERVICE=WMTS";
+
+    	return _host;
+    }
+    
+	protected String parseException(byte[] data) throws IOException {
+        List<String> errors = new ArrayList<String>();
+        KXmlParser kxmlParser = new KXmlParser();
+        try
+        {
+            kxmlParser.setInput(new ByteArrayInputStream(data), encoding);
+            kxmlParser.nextTag();
+            int tag;
+            if ( kxmlParser.getEventType() != KXmlParser.END_DOCUMENT )
+            {
+                kxmlParser.require(KXmlParser.START_TAG, null, Tags.EXCEPTION_ROOT);
+                tag = kxmlParser.nextTag();
+                 while(tag != KXmlParser.END_DOCUMENT)
+                 {
+                     switch(tag)
+                     {
+                        case KXmlParser.START_TAG:
+                            if (kxmlParser.getName().compareTo(Tags.SERVICE_EXCEPTION)==0){
+                                String errorCode = kxmlParser.getAttributeValue("", Tags.CODE);
+                                errorCode = (errorCode != null) ? "["+errorCode+"] " : "";
+                                String errorMessage = kxmlParser.nextText();
+                                errors.add(errorCode + errorMessage);
+                            }
+                            break;
+                        case KXmlParser.END_TAG:
+                            break;
+
+                     }
+                     tag = kxmlParser.nextTag();
+                 }
+                 //kxmlParser.require(KXmlParser.END_DOCUMENT, null, null);
+            }
+        }
+        catch(XmlPullParserException parser_ex){
+            throw new IOException(parser_ex.getMessage());
+        }
+       
+        String message = errors.size() > 0? "" : null;
+        for (int i = 0; i < errors.size(); i++) {
+            message += (String) errors.get(i)+"\n";
+        }
+        return message;
+    }
+    
+ }

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSProtocolHandler.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSClientImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSClientImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSClientImpl.java	(revision 6892)
@@ -0,0 +1,308 @@
+/* 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.ogc.impl.base;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.raster.wmts.ogc.WMTSClient;
+import org.gvsig.raster.wmts.ogc.WMTSStatus;
+import org.gvsig.raster.wmts.ogc.exception.DownloadException;
+import org.gvsig.raster.wmts.ogc.exception.ServerErrorException;
+import org.gvsig.raster.wmts.ogc.exception.WMTSException;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSLayerImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSServiceProviderImpl;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSServiceIdentification;
+import org.gvsig.raster.wmts.ogc.struct.WMTSStyle;
+import org.gvsig.raster.wmts.ogc.struct.WMTSThemes;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * <p>Represents the class with the necessary logic to connect to a OGCWMTS and interpret the data </p>
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSClientImpl implements WMTSClient {
+	protected String                      hostName;
+	protected int                         port;
+	protected String                      serviceName;
+	private String                        type;
+	private String                        subtype;
+	private WMTSProtocolHandler           handler                      = null;
+	private WMTSServerDescription         serverDescription            = null;
+	protected boolean                     forceChangeAxisOrder         = false;
+	private Logger                        logger                       = LoggerFactory.getLogger(WMTSClientImpl.class.toString());
+	
+	/**
+	 * Constructor.
+	 * the parameter host, indicates the WMS host to connect.
+	 * */
+	public WMTSClientImpl(String host) throws ConnectException, IOException {
+		setHost(host);
+		getHandler();       
+	}
+	
+	private WMTSProtocolHandler getHandler() throws ConnectException, IOException {
+    	if (handler == null) {
+			if (getHost().trim().length() > 0) {					
+				handler = WMTSProtocolHandlerFactory.negotiate(getHost());
+				handler.setHost(getHost());
+			}          
+		}
+    	return handler;
+    }
+	
+	 /**
+	 * Sets longitude first in the axis order
+	 * @param force
+	 */
+	public void setForceChangeAxisOrder(boolean force) {
+		this.forceChangeAxisOrder = force;
+		if(handler != null) {
+			handler.setForceChangeAxisOrder(force);
+		}
+	}
+    
+    public String getVersion() {
+        return handler.getVersion();
+    }
+    
+    /**
+     * <p> Reads from the WMS Capabilities, the layers available in the service</p>
+     * @return a TreeMap with the available layers in the WMS 
+     */
+	public List<WMTSLayer> getLayers() {        
+    	if(serverDescription != null)
+			return serverDescription.getLayerList();
+		return null;
+    } 
+    
+    /**
+     * <p>Reads from the WMS Capabilities the number if layers available in the service</p>
+     * @return, number of layers available
+     */
+    public int getNumberOfLayers() {        
+    	if(serverDescription != null)
+			return serverDescription.getLayerList().size();
+		return 0;
+    }
+
+	public void close() {
+		serverDescription = null;
+		handler = null;
+	}
+	
+	public File getTile(String url, ICancellable cancel, File file) throws WMTSException, ServerErrorException {
+		return handler.getTile(url, cancel, file);
+	}
+	
+	/**
+     * <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 handler.getTile((WMTSStatusImpl)status, cancel, file);
+    }
+	
+	 /**
+     * <p>One of the three interfaces that OGC WMS defines. Request a map.</p> 
+     * @throws ServerErrorException 
+     */
+    public synchronized File getTile(WMTSStatus status, ICancellable cancel) throws WMTSException, ServerErrorException {   
+        return handler.getTile((WMTSStatusImpl)status, cancel);
+    }
+    
+    /**
+     * Builds the URL to get a tile using a WMTSStatus object 
+     * @throws ServerErrorException 
+     */
+    public synchronized URL getTileURL(WMTSStatus status) throws MalformedURLException {   
+        return handler.getTileURL((WMTSStatusImpl)status);
+    }
+    
+    /**
+     * Downloads a file
+     * @throws DownloadException 
+     * @throws ServerErrorException 
+     */
+    public synchronized File downloadFile(URL url, ICancellable cancel) throws DownloadException {   
+        return handler.downloadFile(url, cancel, null);
+    }
+	
+	/**
+     * <p>One of the three interfaces defined by OGC WMS, it gets the service capabilities</p>
+     * @param override, if true the previous downloaded data will be overridden
+     */
+    public void getCapabilities(WMTSServerDescription serverDescription, boolean override, ICancellable cancel) {        
+        handler.getCapabilities(serverDescription, override, 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) {
+    	return handler.getFeatureInfo((WMTSStatusImpl)status, x, y, cancel);
+    }
+    
+    /**
+     * Gets the legend graphic of one layer
+     */
+    public File getLegendGraphic(WMTSLayer layer, WMTSStyle style, ICancellable cancel) throws WMTSException {
+    	try {
+			return handler.getLegendGraphic(layer, style, cancel);
+		} catch (ServerErrorException e) {
+			throw new WMTSException("Error getting the legend", e);
+		} catch (DownloadException e) {
+			throw new WMTSException("Error downloading the legend", e);
+		}
+    }
+    
+    public boolean connect(boolean override, ICancellable cancel) {
+    	try {            
+    		if(getHandler() == null)
+    			return false;
+    		
+   			serverDescription = getHandler().getServerDescription();
+    		//getHandler().setForceLongitudeFirstAxisOrder(forceLongitudeFirstAxisOrder);
+    		getCapabilities(serverDescription, override, cancel);
+    		return true;
+    	} catch (Exception e) {
+    		logger.debug("Error connecting to the server", e);
+    		return false;
+    	}
+    } 
+	
+	public boolean connect(ICancellable cancel) {
+		return connect(false, cancel);
+	}
+	
+	/**
+	 * Gets the list of formats supported by a layer
+	 * @param layerTitle
+	 * @return
+	 */
+	public List<String> getFormats(String layerTitle) {
+		if(serverDescription != null)
+			return serverDescription.getLayerByTitle(layerTitle).getFormat();
+		return null;
+    }
+	
+	public WMTSServiceIdentification getServiceIdentification() {
+		if(serverDescription != null)
+			return serverDescription.getServiceIdentification();
+		return null;
+	}
+	
+	public WMTSServiceProviderImpl getServiceProvider() {
+		if(serverDescription != null)
+			return serverDescription.getServiceProvider();
+		return null;
+	}
+
+	/**
+	 * Gets the list of themes
+	 * @return
+	 */
+	public WMTSThemes getThemes() {
+		if(serverDescription != null)
+			return serverDescription.getThemes();
+		return null;
+	}
+	
+	public WMTSThemes getLayerListAsThemes() {
+		if(serverDescription != null)
+			return serverDescription.getLayerListAsThemes();
+		return null;
+	}
+	
+    public List<WMTSTileMatrixSet> getTileMatrixSet() {
+    	if(serverDescription != null)
+    		return serverDescription.getTileMatrixSet();
+    	return null;
+    }
+    
+    public WMTSLayer getLayer(String layerName) {
+    	if(serverDescription != null) {
+			List<WMTSLayer> list = serverDescription.getLayerList();
+			for (int i = 0; i < list.size(); i++) {
+				WMTSLayerImpl layer = (WMTSLayerImpl)list.get(i);
+				if(layer.getTitle().compareTo(layerName) == 0) {
+					return layer;
+				}
+			}
+    	}
+		return null;
+    }
+    
+    public String getHost() {
+        return hostName;
+    }
+
+    public void setHost(String _hostName) {
+        hostName = _hostName;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int _port) {
+        port = _port;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String _serviceName) {
+        serviceName = _serviceName;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String _type) {
+        type = _type;
+    }
+
+    public String getSubtype() {
+        return subtype;
+    }
+    
+    public void setSubtype(String _subtype) {
+        subtype = _subtype;
+    }
+
+	public WMTSStatus createStatus() {
+		return new WMTSStatusImpl();
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSClientImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSOperation.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSOperation.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSOperation.java	(revision 6892)
@@ -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.
+ * 
+ */
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2009 Iver T.I.  {{Task}}
+ */
+
+package org.gvsig.raster.wmts.ogc.impl.base;
+
+import java.util.Hashtable;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSOperation { 
+	protected static Hashtable<String, WMTSOperation> 
+                               operations     = new Hashtable<String, WMTSOperation>();
+	protected String           operationName;
+	protected String           onlineResource;
+
+	static {
+		operations.put(Tags.GETCAPABILITIES, new WMTSOperation(Tags.GETCAPABILITIES));
+		operations.put(Tags.GETFEATUREINFO, new WMTSOperation(Tags.GETFEATUREINFO));
+		operations.put(Tags.GETLEGENDGRAPHIC, new WMTSOperation(Tags.GETLEGENDGRAPHIC));
+		operations.put(Tags.GETTILE, new WMTSOperation(Tags.GETTILE));
+		operations.put(Tags.DESCRIBELAYER, new WMTSOperation(Tags.DESCRIBELAYER));
+	}
+	
+	public WMTSOperation(String operationName) {
+		this.operationName = operationName;	
+	}
+
+	public WMTSOperation(String operationName, String onlineResource) {
+		this.onlineResource = onlineResource;
+		this.operationName = operationName;	
+	}
+	
+	public Hashtable<String, WMTSOperation> getOperations() {
+		return operations;
+	}
+	
+	/**
+	 * @return Returns the onlineResource.
+	 */
+	public String getOnlineResource() {
+		return onlineResource;
+	}
+	/**
+	 * @param onlineResource The onlineResource to set.
+	 */
+	public void setOnlineResource(String onlineResource) {
+		this.onlineResource = onlineResource;
+	}	
+
+	/**
+	 * @return Returns the operationName.
+	 */
+	public String getOperationName() {
+		return operationName;
+	}
+	
+	/**
+	 * @param operationName The operationName to set.
+	 */
+	public void setOperationName(String operationName) {
+		this.operationName = operationName;
+	}		
+}
+

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSOperation.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSStatusImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSStatusImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSStatusImpl.java	(revision 6892)
@@ -0,0 +1,234 @@
+/* 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.ogc.impl.base;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.WMTSStatus;
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
+
+/**
+ * Describes the status of a WMTSclient, so it adds to the Remote client status
+ * a list of layers, a list of layer styles, the extent of the map.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSStatusImpl implements WMTSStatus {
+	// width and heigh of the map
+    private int            width             = 0;
+    private int            height            = 0;
+    private String         format            = null;
+    private String         srs               = null;
+    private String         exceptionFormat   = null;
+	private int            protocol          = Tags.PROTOCOL_UNDEFINED;
+	private String         layer             = null;
+	private String         style             = null;
+	private String         tileMatrixSet     = null;
+	private String         tileMatrix        = null;
+	private int            tileCol           = -1;
+	private int            tileRow           = -1;
+	private List<WMTSTile> tileList          = null;
+	private String         infoFormat        = null;
+	private int            level             = -1;
+	private HashMap<String , String>
+	                       resourceURL       = new HashMap<String, String>();
+	private String         dimension         = null;
+	private String         valueForDimension = null;
+	
+	public int getWidth() {        
+        return width;
+    }
+    
+    public void setWidth(int _width) {        
+    	width = _width;
+    } 
+
+    public int getHeight() {                
+        return height;
+    } 
+    public void setHeight(int _height) {        
+        height = _height;
+    } 
+
+    public String getFormat() {        
+        return format;
+    }
+    
+    public void setFormat(String _format) {        
+        format = _format;
+    } 
+    
+    public String getSrs() {        
+        return srs;
+    } 
+
+    public void setSrs(String _srs) {        
+        srs = _srs;
+    } 
+
+    public void setExceptionFormat(String _format) {        
+        exceptionFormat = _format;
+    } 
+    
+    public String getExceptionFormat() {        
+        return exceptionFormat;
+    }
+    
+    public String getDimension() {
+		return dimension;
+	}
+
+	public void setDimension(String dimension) {
+		this.dimension = dimension;
+	}
+
+	public String getValueForDimension() {
+		return valueForDimension;
+	}
+
+	public void setValueForDimension(String valueForDimension) {
+		this.valueForDimension = valueForDimension;
+	}
+    
+    /**
+	 * @return the protocol
+	 */
+	public int getProtocol() {
+		return protocol;
+	}
+
+	/**
+	 * @param protocol the protocol to set
+	 */
+	public void setProtocol(int protocol) {
+		this.protocol = protocol;
+	}
+
+	public String getLayer() {
+		return layer;
+	}
+
+	public String getStyle() {
+		return style;
+	}
+
+	public String getTileMatrixSet() {
+		return tileMatrixSet;
+	}
+
+	public String getTileMatrix() {
+		return tileMatrix;
+	}
+
+	public int getTileRow() {
+		return tileRow;
+	}
+
+	public int getTileCol() {
+		return tileCol;
+	}
+
+	public void setLayer(String layer) {
+		this.layer = layer;
+	}
+
+	public void setStyle(String style) {
+		this.style = style;
+	}
+
+	public void setTileMatrixSet(String tileMatrixSet) {
+		this.tileMatrixSet = tileMatrixSet;
+	}
+
+	public void setTileMatrix(String tileMatrix) {
+		this.tileMatrix = tileMatrix;
+	}
+
+	public void setTileCol(int tileCol) {
+		this.tileCol = tileCol;
+	}
+
+	public void setTileRow(int tileRow) {
+		this.tileRow = tileRow;
+	}
+
+	public List<WMTSTile> getTileList() {
+		return tileList;
+	}
+
+	public void setTileList(List<WMTSTile> tileList) {
+		this.tileList = tileList;
+	}
+	
+    public String getInfoFormat() {        
+        return this.infoFormat;
+    } 
+    
+    public void setInfoFormat(String format) {        
+    	this.infoFormat = format;
+    }
+    
+    public int getLevel() {
+		return level;
+	}
+
+	public void setLevel(int level) {
+		this.level = level;
+	}
+	
+	public String getResourceURL(String key) {
+		return resourceURL.get(key);
+	}
+	
+	public void addResourceURL(String key, String url) {
+		resourceURL.put(key, url);
+	}
+    
+    public WMTSStatusImpl cloneStatus() {
+    	WMTSStatusImpl status     = new WMTSStatusImpl();
+    	status.layer          = layer;
+    	status.style          = style;
+    	status.tileMatrixSet  = tileMatrixSet;
+    	status.tileMatrix     = tileMatrix;
+    	status.tileCol        = tileCol;
+    	status.tileRow        = tileRow;
+    	status.tileList       = new ArrayList<WMTSTile>();
+    	for (int i = 0; i < tileList.size(); i++) {
+			WMTSTile t = tileList.get(i).cloneTile();
+			status.tileList.add(t);
+		}
+    	if(resourceURL != null) {
+    		status.resourceURL = (HashMap<String, String>)resourceURL.clone();
+    	}
+    	status.infoFormat     = infoFormat;
+    	status.setFormat(getFormat());
+    	status.setWidth(getWidth());
+    	status.setHeight(getHeight());
+    	status.setSrs(getSrs());
+    	status.setInfoFormat(getInfoFormat());
+    	return status;
+    }
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSStatusImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSServiceInformation_deprecated.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSServiceInformation_deprecated.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSServiceInformation_deprecated.java	(revision 6892)
@@ -0,0 +1,245 @@
+/* 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.ogc.impl.base;
+
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Vector;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+
+/**
+ * Class that represents the description of the WMS metadata.
+ * 
+ * @deprecated This information is in ServiceIdentification, ServiceProvider and OperationsMetadata
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSServiceInformation_deprecated {
+	public String online_resource = null;
+	protected HashMap<String, WMTSOperation> 
+	              operationsGet = new HashMap<String, WMTSOperation>();
+	protected HashMap<String, WMTSOperation> 
+                  operationsPost = new HashMap<String, WMTSOperation>();
+	public String version;
+	public String name;
+	public String scope;
+	public String title;
+	public String abstr;
+	public String keywords;
+	public String fees;
+	public String operationsInfo;
+	public String personname;
+	public String organization;
+	public String function;
+	public String addresstype;
+	public String address;
+	public String place;
+	public String province;
+	public String postcode;
+	public String country;
+	public String phone;
+	public String fax;
+	public String email;
+	public Vector<String> 
+	              formats;
+
+	public WMTSServiceInformation_deprecated() {
+		version = new String();
+		name = new String();
+		scope = new String();
+		title = new String();
+		abstr = new String();
+		keywords = new String();
+		fees = new String();
+		operationsInfo = new String();
+		personname = new String();
+		organization = new String();
+		function = new String();
+		addresstype = new String();
+		address = new String();
+		place = new String();
+		province = new String();
+		postcode = new String();
+		country = new String();
+		phone = new String();
+		fax = new String();
+		email = new String();
+		formats = new Vector<String>();       
+	}
+
+	/**
+	 * @return Returns the online_resource.
+	 */
+	 public String getOnline_resource() {
+		return online_resource;
+	}
+
+	/**
+	 * Add a new supported operation
+	 * @param operation
+	 * The operation to support
+	 * @param protocol
+	 * The HTTP protocol (Get or Post)
+	 */
+	 public void addOperation(String operation, int protocol){
+		 if (protocol == Tags.PROTOCOL_GET){
+			 operationsGet.put(operation, createOperation(operation));			
+		 }else if (protocol == Tags.PROTOCOL_POST){
+			 operationsPost.put(operation, createOperation(operation));
+		 }
+	 }
+
+	 /**
+	  * Add a new supported operation
+	  * @param operation
+	  * The operation to support
+	  * @param protocol
+	  * The HTTP protocol (Get or Post)
+	  * @param onlineResource
+	  * The online resource
+	  */
+	 public void addOperation(String operation, int protocol, String onlineResource){
+		 if (protocol == Tags.PROTOCOL_GET){
+			 operationsGet.put(operation, createOperation(operation, onlineResource));
+		 }else if (protocol == Tags.PROTOCOL_POST){
+			 operationsPost.put(operation, createOperation(operation, onlineResource));
+		 }
+	 }
+
+	 /**
+	  * Gest the online resource for a concrete operation
+	  * @param operation
+	  * The operation
+	  * @param protocol
+	  * The HTTP protocol (Get or Post)
+	  * @return
+	  * The online resource
+	  */
+	 public String getOnlineResource(String operation, int protocol){
+		 WMTSOperation op = null;
+		 if (protocol == Tags.PROTOCOL_GET){
+			 op = (WMTSOperation)operationsGet.get(operation);
+		 }else if (protocol == Tags.PROTOCOL_POST){
+			 op = (WMTSOperation)operationsPost.get(operation);
+		 }
+		 if ((op == null) ||
+				 (op.getOnlineResource() == null) || 
+				 (op.getOnlineResource().equals(""))){
+			 return null;
+		 }
+		 return op.getOnlineResource();
+	 }
+
+	 /**
+	  * Gets the online resource for a concrete operation.
+	  * The default protocol is GET
+	  * @param operation
+	  * The operation
+	  * @return
+	  * The online resource
+	  */
+	 public String getOnlineResource(String operation){
+		 return getOnlineResource(operation, Tags.PROTOCOL_GET);
+	 }
+
+	 /**
+	  * Get a hash map with the supported operations
+	  * @return
+	  */
+	 public Hashtable<String, String> getSupportedOperationsByName(){
+		 Hashtable<String, String> operations = new Hashtable<String, String>();
+		 Iterator<String> getIt = operationsGet.keySet().iterator();
+		 while (getIt.hasNext()){
+			 String id = (String)getIt.next();
+			 WMTSOperation operation = (WMTSOperation)operationsGet.get(id);
+			 operations.put(operation.getOperationName(),
+					 operation.getOnlineResource());
+		 }
+		 return operations;
+	 }
+
+	 public boolean isOperationSupported(String operationName){
+		 if (operationsGet.containsKey(operationName)){
+			 return true;
+		 }
+		 if (operationsPost.containsKey(operationName)){
+			 return true;
+		 }
+		 return false;
+	 }	
+
+	 public boolean isQueryable() {
+		 if (getOnlineResource(Tags.GETFEATUREINFO) != null)    	
+			 return true;
+		 else
+			 return false;
+	 }
+
+    public boolean hasLegendGraphic() {
+    	if (getOnlineResource(Tags.GETLEGENDGRAPHIC) != null) 
+    		return true;
+    	else
+    		return false;
+    }
+    
+    public void clear() {
+    	version = new String();
+        name = new String();
+        scope = new String();
+        title = new String();
+        abstr = new String();
+        keywords = new String();
+        fees = new String();
+        operationsInfo = new String();
+        personname = new String();
+        organization = new String();
+        function = new String();
+        addresstype = new String();
+        address = new String();
+        place = new String();
+        province = new String();
+        postcode = new String();
+        country = new String();
+        phone = new String();
+        fax = new String();
+        email = new String();
+        formats = new Vector<String>();        
+    }      
+    
+	public WMTSOperation createOperation(String name) {
+		return new WMTSOperation(name); 
+	}
+
+	public WMTSOperation createOperation(String name, String onlineResource) {
+		return new WMTSOperation(name, onlineResource);
+	}	
+
+ }
+

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSServiceInformation_deprecated.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSProtocolHandlerFactory.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSProtocolHandlerFactory.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSProtocolHandlerFactory.java	(revision 6892)
@@ -0,0 +1,149 @@
+/* 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.ogc.impl.base;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.StringReader;
+import java.net.ConnectException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * This factory builds a new handler depending on the supported protocol.
+ * This protocol could be negotiated with the server. Now only 1.0.0 version
+ * is supported.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WMTSProtocolHandlerFactory {
+
+	private static List<String> supportedVersions = new ArrayList<String>();
+
+	static {
+		supportedVersions.add("1.0.0");
+	}
+
+    /**
+     * Establece la versi�n con la que se comunicar� con el servidor y devuelve
+     * el objeto Capabilities obtenido con dicha versi�n
+     *
+     * @param host maquina con la que se negocia
+     *
+     * @return instancia de un cliente capaz de negociar con el host que se
+     *         pasa como par�metro
+     */
+    public static WMTSProtocolHandler negotiate(String host) throws ConnectException, IOException {
+    	String highestVersionSupportedByServer  = getSuitableWMTSVersion(host, "");
+    	if (supportedVersions.contains(highestVersionSupportedByServer)) {
+    		//we support the highest version supported by the server
+    		// this is the best case
+    		return createVersionDriver(highestVersionSupportedByServer);
+    	}
+    	return null;
+    }
+
+     /**
+      * Sends a GetCapabilities to the WMTS server to get the version
+      * if the version parameter is null, the WMTS will return the highest version supported
+      * if not it will return the lower highest version than the one requested.
+      * @param host
+      * @param version
+      * @return suitable version supported by the server
+      */
+     private static String getSuitableWMTSVersion(String host, String _version) throws ConnectException, IOException {
+    	 String request = WMTSProtocolHandler.buildCapabilitiesSuitableVersionRequest(host, _version);
+    	 String version = "";
+    	 StringReader reader = null;
+    	 DataInputStream dis = null;
+
+    	 try {
+    		 URL url = new URL(request);
+    		 byte[] buffer = new byte[1024];
+    		 dis = new DataInputStream(url.openStream());
+    		 dis.readFully(buffer);
+    		 String string = new String(buffer);
+
+    		 int a = string.toLowerCase().indexOf("<?xml");
+    		 if (a !=-1)
+    			 string = string.substring(a, string.length());
+
+    		 reader = new StringReader(string);
+    		 KXmlParser kxmlParser = null;
+    		 kxmlParser = new KXmlParser();
+    		 kxmlParser.setInput(reader);
+    		 kxmlParser.nextTag();
+    		 if ( kxmlParser.getEventType() != KXmlParser.END_DOCUMENT ) {
+    			 if ((kxmlParser.getName().compareTo(Tags.WMTS_CAPABILITIES) == 0)) {
+    				 version = kxmlParser.getAttributeValue("", Tags.VERSION);
+    			 }
+    		 }
+    		 // do not forget to close the Stream.
+    		 reader.close();
+    		 dis.close();
+    		 return version;
+    	 } catch(XmlPullParserException xmlEx) {
+    		 xmlEx.printStackTrace();
+    		 return "";
+    	 } finally {
+    		 if (reader != null) {
+    			 try {
+    				 reader.close();
+    			 } catch(Exception ex) {
+    				 ex.printStackTrace();
+    			 }
+    		 }
+    		 if (dis != null) {
+    			 try {
+    				 dis.close();
+    			 } catch(Exception ex) {
+    				 ex.printStackTrace();
+    			 }
+    		 }
+    	 }
+     }
+
+     /**
+      * It creates an instance of a WMSDriver class.
+      *
+      * @param String, with the version of the driver to be created
+      * @return WMSDriver.
+      */
+     private static WMTSProtocolHandler createVersionDriver(String version) {
+    	 try {
+    		 Class<?> driver;
+    		 version = version.replace('.', '_');
+    		 driver = Class.forName("org.gvsig.raster.wmts.ogc.impl.wmts_" + version + ".WMTSProtocolHandler" + version);
+    		 return (WMTSProtocolHandler)driver.newInstance();
+    	 } catch (Exception e) {
+    		 e.printStackTrace();
+    		 //throw new Exception("WMSDriverFactory. Unknown driver version " + e);
+    		 return null;
+    	 }
+     }
+
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/base/WMTSProtocolHandlerFactory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/Utilities.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/Utilities.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/Utilities.java	(revision 6892)
@@ -0,0 +1,409 @@
+package org.gvsig.raster.wmts.ogc.impl;
+
+import java.io.BufferedOutputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ConnectException;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+import org.gvsig.compat.CompatLocator;
+import org.gvsig.compat.net.Downloader;
+import org.gvsig.compat.net.ICancellable;
+
+public class Utilities {
+	private static final Downloader downloader = CompatLocator.getDownloader();
+    private static String characters;
+	static boolean canceled;
+	static final long latency = 500;
+	static Exception downloadException;
+
+	static {
+		characters = "";
+		for (int j = 32; j <= 127; j++){
+			characters += (char) j;
+		}
+		characters += "�������������������������������������������ǡ�����\n\r\f\t��";
+	}
+
+
+	/**
+	 * Checks a File and tries to figure if the file is a text or a binary file.<br>
+	 * Keep in mind that binary files are those that contains at least one
+	 * non-printable character.
+	 *
+	 * @param file
+	 * @return <b>true</b> when the file is <b>pretty problably</b> text,
+	 * <b>false</b> if the file <b>is</b> binary.
+	 */
+	public static boolean isTextFile(File file){
+		return isTextFile(file, 1024);
+	}
+
+	/**
+	 * Checks a File and tries to figure if the file is a text or a binary file.<br>
+	 * Keep in mind that binary files are those that contains at least one
+	 * non-printable character.
+	 *
+	 * @param file
+	 * @param byteAmount, number of bytes to check.
+	 * @return <b>true</b> when the file is <b>pretty problably</b> text,
+	 * <b>false</b> if the file <b>is</b> binary.
+	 */
+	public static boolean isTextFile(File file, int byteAmount){
+		int umbral = byteAmount;
+		try {
+			FileReader fr = new FileReader(file);
+			for (int i = 0; i < umbral; i++) {
+				int c = fr.read();
+				if (c==-1){
+					// End of file. If we reach this
+					// everything before is printable data.
+					return true;
+				}
+				char ch = (char) c;
+				if (characters.indexOf(ch)==-1){
+					// We've found a non-printable character.
+					// Then we'll assume that this file is binary.
+					return false;
+				}
+			}
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return true;
+	}
+
+	/**
+	 * Checks a byte array and tells if it contains only text or contains
+	 * any binary data.
+	 *
+	 * @param file
+	 * @return <b>true</b> when the data is <b>only</b> text, <b>false</b> otherwise.
+	 * @deprecated
+	 */
+	public static boolean isTextData(byte[] data){
+		char[] charData = new char[data.length];
+		for (int i = 0; i<data.length; i++){
+			charData[i] = (char) data[i];
+		}
+
+		for (int i = 0; i < data.length; i++) {
+			int c = charData[i];
+
+
+			if (c==-1){
+				// End of file. If we reach this
+				// everything before is printable data.
+				return true;
+			}
+			char ch = (char) c;
+			if (characters.indexOf(ch)==-1){
+				// We've found a non-printable character.
+				// Then we'll assume that this file is binary.
+
+				//System.out.println(ch+" at "+i);
+				return false;
+			}
+		}
+		return true;
+	}
+
+
+
+
+	/**
+	 * Copia el contenido de un InputStream en un OutputStream
+	 *
+	 * @param in InputStream
+	 * @param out OutputStream
+	 */
+	public static void serializar(InputStream in, OutputStream out) {
+		byte[] buffer = new byte[102400];
+
+		int n;
+
+		try {
+			while ((n = in.read(buffer)) != -1) {
+				out.write(buffer, 0, n);
+			}
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Elimina del xml la declaraci�n del DTD
+	 *
+	 * @param bytes bytes del fichero XML de respuesta a getCapabilities
+	 * @param startTag Tag raiz del xml respuesta a getCapabilities
+	 *
+	 * @return bytes del fichero XML sin la declaraci�n del DTD
+	 */
+	public static byte[] eliminarDTD(byte[] bytes, String startTag) {
+		String text = new String(bytes);
+		int index1 = text.indexOf("?>") + 2;
+		int index2;
+
+		try {
+			index2 = findBeginIndex(bytes, startTag);
+		} catch (Exception e) {
+			return bytes;
+		}
+
+		byte[] buffer = new byte[bytes.length - (index2 - index1)];
+		System.arraycopy(bytes, 0, buffer, 0, index1);
+		System.arraycopy(bytes, index2, buffer, index1, bytes.length - index2);
+
+		return buffer;
+	}
+
+	/**
+	 * Obtiene el �ndice del comienzo del xml
+	 *
+	 * @param bytes bytes del fichero XML en el que se busca
+	 * @param tagRaiz Tag raiz del xml respuesta a getCapabilities
+	 *
+	 * @return �ndice donde empieza el tag raiz
+	 *
+	 * @throws Exception Si no se encuentra el tag
+	 */
+	private static int findBeginIndex(byte[] bytes, String tagRaiz)
+	throws Exception {
+		try {
+			int nodo = 0;
+			int ret = -1;
+
+			int i = 0;
+
+			while (true) {
+				switch (nodo) {
+				case 0:
+
+					if (bytes[i] == '<') {
+						ret = i;
+						nodo = 1;
+					}
+
+					break;
+
+				case 1:
+
+					if (bytes[i] == ' ') {
+					} else if (bytes[i] == tagRaiz.charAt(0)) {
+						nodo = 2;
+					} else {
+						nodo = 0;
+					}
+
+					break;
+
+				case 2:
+
+					String aux = new String(bytes, i, 18);
+
+					if (aux.equalsIgnoreCase(tagRaiz.substring(1))) {
+						return ret;
+					}
+
+					nodo = 0;
+
+					break;
+				}
+
+				i++;
+			}
+		} catch (Exception e) {
+			throw new Exception("No se pudo parsear el xml", e);
+		}
+	}
+
+	/**
+	 * Converts the contents of a Vector to a comma separated list
+	 *
+	 * */
+	public static String Vector2CS(Vector<String> v) {
+		String str = new String();
+		if (v != null) {
+			int i;
+			for (i = 0; i < v.size() ;i ++) {
+				str = str + v.elementAt(i);
+				if (i < v.size()-1)
+					str = str + ",";
+			}
+		}
+		return str;
+	}
+
+	public static boolean isValidVersion(String version)
+	{
+		if(version.trim().length() == 5)
+		{
+			if ( (version.charAt(1)=='.') && (version.charAt(3)=='.'))
+			{
+				char x = version.charAt(0);
+				char y = version.charAt(2);
+				char z = version.charAt(4);
+
+				if ((Character.isDigit(x)) && (Character.isDigit(y)) && (Character.isDigit(z)))
+				{
+					return true;
+				}
+				else
+				{
+					return false;
+				}
+			}
+			else
+			{
+				return false;
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	/**
+	 * Crea un fichero temporal con un nombre concreto y unos datos pasados por
+	 * par�metro.
+	 * @param fileName Nombre de fichero
+	 * @param data datos a guardar en el fichero
+	 */
+	public static void createTemp(String fileName, String data)throws IOException{
+		File f = new File(fileName);
+		DataOutputStream dos = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(f)) );
+		dos.writeBytes(data);
+		dos.close();
+		f.deleteOnExit();
+	}
+
+	/**
+	 * Checks if a String is a number or not
+	 *
+	 * @param String, s
+	 * @return boolean, true if s is a number
+	 */
+	public static boolean isNumber(String s)
+	{
+		try
+		{
+			//double d = Double.parseDouble(s);
+			return true;
+		}
+		catch(NumberFormatException e)
+		{
+			return false;
+		}
+
+	}
+
+	/**
+	 * Parses the String containing different items [character] separated and
+	 * creates a vector with them.
+	 * @param str String contains item1[c]item2[c]item3...
+	 * @param c is the string value for separating the items
+	 * @return Vector containing all the items
+	 */
+	public static Vector<String> createVector(String str, String c) {
+		StringTokenizer tokens = new StringTokenizer(str, c);
+		Vector<String> v = new Vector<String>();
+		try {
+			while (tokens.hasMoreTokens()) {
+				v.addElement(tokens.nextToken());
+			}
+			return v;
+		} catch (Exception e) {
+			return new Vector<String>();
+		}
+	}
+
+	/**
+	 * @param dimensions
+	 * @return
+	 */
+	public static String Vector2URLParamString(Vector<String> v) {
+		if (v == null) 
+			return "";
+		String s = "";
+		for (int i = 0; i < v.size(); i++) {
+			s += v.get(i);
+			if (i<v.size()-1)
+				s += "&";
+		}
+		return s;
+	}
+	
+	/**
+	 * Downloads an URL into a temporary file that is removed the next time the
+	 * tempFileManager class is called, which means the next time gvSIG is launched.
+	 *
+	 * @param url
+	 * @param name
+	 * @return
+	 * @throws IOException
+	 * @throws ServerErrorResponseException
+	 * @throws ConnectException
+	 * @throws UnknownHostException
+	 */
+	public static synchronized File downloadFile(URL url, String name, ICancellable cancel) throws IOException,ConnectException, UnknownHostException{
+	    return downloader.downloadFile(url, name, cancel);
+	}
+	
+	/**
+	 * Downloads a URL using the HTTP Post protocol
+	 * @param url
+	 * The server URL
+	 * @param data
+	 * The data to send in the request
+	 * @param name
+	 * A common name for all the retrieved files
+	 * @param cancel
+	 * Used to cancel the downloads
+	 * @return
+	 * The retrieved file
+	 * @throws IOException
+	 * @throws ConnectException
+	 * @throws UnknownHostException
+	 */
+	public static synchronized File downloadFile(URL url, String data, String name, ICancellable cancel) throws IOException,ConnectException, UnknownHostException{
+	    return downloader.downloadFile(url, data, name, cancel);
+	}
+
+	/**
+	 * Cleans every temporal file previously downloaded.
+	 */
+	public static void cleanUpTempFiles() {
+		downloader.cleanUpTempFiles();
+	}
+
+
+	/**
+	 * Remove an URL from the system cache. The file will remain in the file
+	 * system for further eventual uses.
+	 * @param request
+	 */
+	public static void removeURL(URL url) {
+		downloader.removeURL(url);
+	}
+
+	/**
+	 * Remove an URL from the system cache. The file will remain in the file
+	 * system for further eventual uses.
+	 * @param request
+	 */
+	public static void removeURL(Object url) {
+	    downloader.removeURL(url);
+	}
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/Tags.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/Tags.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/Tags.java	(revision 6892)
@@ -0,0 +1,224 @@
+package org.gvsig.raster.wmts.ogc.impl;
+
+/**
+ * Class containing a description for all the TAGS defined in the Capabilities Object returned from a WMS
+ * note: this describes the WMT_MS_Capabilitites 1.1.1
+ * */
+public class Tags {
+	private Tags () {};
+	//EXCEPTION
+    //***************
+	public final static String EXCEPTION_ROOT            = "ServiceExceptionReport";
+    public final static String SERVICE_EXCEPTION         = "ServiceException";
+    public final static String CODE                      = "code";
+    
+	//OPERATIONS
+    //***************
+	public final static int    PROTOCOL_UNDEFINED        = -1;
+	public final static int    PROTOCOL_GET              = 0;
+	public final static int    PROTOCOL_POST             = 1;
+	public final static String OPERATION                 = "Operation";
+	public final static String OPERATIONS_METADATA       = "OperationsMetadata";
+	public final static String OPERATION_NAME            = "name";
+	public final static String DCP                       = "DCP";
+	public final static String HREF                      = "xlink:href";
+	
+	//CAPABILITIES
+    //***************
+    
+	public final static String CAPABILITIES_ROOT1_1_0    = "WMT_MS_Capabilities";
+	public final static String CAPABILITIES_ROOT1_1_1    = "WMT_MS_Capabilities";
+	public final static String CAPABILITIES_ROOT1_3_0    = "WMS_Capabilities";
+	public final static String CAPABILITY                = "Capability";
+	public final static String SERVICE                   = "Service";
+	public final static String NAME                      = "Name";
+	public final static String TITLE                     = "Title";
+	public final static String ABSTRACT                  = "Abstract";
+	public final static String KEYWORDLIST               = "KeywordList";
+	public final static String KEYWORD                   = "Keyword";
+	public final static String ONLINERESOURCE            = "OnlineResource";
+
+	public final static String CONTACTINFORMATION        = "ContactInformation";
+	public final static String CONTACTPOSITION           = "ContactPosition";
+	public final static String CONTACTADRESS             = "ContactAddress";
+	public final static String CONTACTVOICETELEPHONE     = "ContactVoiceTelephone";
+	public final static String CONTACTFACSIMILETELEPHONE = "ContactFacsimileTelephone";
+	public final static String CONTACTPERSONPRIMARY      = "ContactPersonPrimary";
+	public final static String CONTACTPERSON             = "ContactPerson";
+	public final static String CONTACTORGANIZATION       = "ContactOrganization";
+	public final static String CONTACTEMAILADRESS        = "ContactElectronicMailAddress";
+	public final static String FEES                      = "Fees";
+	public final static String ACCESSCONSTRAINTS         = "AccessConstraints";
+	public final static String REQUEST                   = "Request";
+	public final static String GETCAPABILITIES           = "GetCapabilities";
+	public final static String FORMAT                    = "Format";
+	public final static String DCPTYPE                   = "DCPType";
+	public final static String XMLNS_XLINK ="xmlns:xlink";
+	public final static String XLINK_TYPE ="xlink:type";
+	public final static String XLINK_HREF ="xlink:href";
+	public final static String HTTP ="HTTP";
+	public final static String GET ="Get";
+	public final static String POST ="Post";
+	public final static String GETTILE ="GetTile";
+	public final static String GETFEATUREINFO ="GetFeatureInfo";
+	public final static String DESCRIBELAYER ="DescribeLayer";
+	public final static String GETLEGENDGRAPHIC ="GetLegendGraphic";
+	public final static String EXCEPTION ="Exception";
+	public final static String VENDORSPECIFICCAPABILITIES ="VendorSpecificCapabilities";
+	public final static String USERDEFINEDSYMBOLIZATION ="UserDefinedSymbolization";
+	public final static String LAYER ="Layer";
+	public final static String EXCEPTIONS_1_1_x = "application/vnd.ogc.se_xml";
+	public final static String EXCEPTIONS_1_3_0 = "XML";
+	public final static String SRS ="SRS";
+	public final static String CRS ="CRS";
+	public final static String DEAFAULTSRS ="DefaultSRS";	
+    public final static String OTHERSRS ="OtherSRS";   
+
+	public final static String BOUNDINGBOX ="BoundingBox";
+	public final static String WGS84BOUNDINGBOX = "WGS84BoundingBox";
+	public final static String LOWERCORNER = "LowerCorner";
+	public final static String UPPERCORNER = "UpperCorner";
+	// Used in the WMS as "LatLonBoundingBox" don't change it and create your own one
+	public final static String LATLONBOUNDINGBOX ="LatLonBoundingBox";
+	public final static String EX_GEOGRAPHICBOUNDINGBOX ="EX_GeographicBoundingBox";
+	public final static String METADATAURL ="MetadataURL";
+	public final static String LOGOURL ="LogoURL";
+	public final static String AUTHORITYURL ="AuthorityURL";
+	public final static String STYLE ="Style";
+	public final static String LEGENDURL="LegendURL";
+	public final static String SCALEHINT ="ScaleHint";
+	public final static String MINSCALEDENOMINATOR ="MinScaleDenominator";
+	public final static String DIMENSION ="Dimension";
+	public final static String TIME ="Time";
+	public final static String CONSTRAINT = "Constraint";
+
+	// capabilities attributes
+	public final static String VERSION ="version";
+	public final static String UPDATESEQUENCE ="updatesequence";
+	public final static String ENCODING ="encoding";
+	public final static String STANDALONE ="standalone";
+	public final static String SUPPORTSLD ="SupportSLD";
+	public final static String USERLAYER ="UserLayer";
+	public final static String USERSTYLE ="UserStyle";
+	public final static String QUERYABLE ="queryable";
+	public final static String CASCADED ="cascaded";
+	public final static String NOSUBSETS ="noSubsets";
+	public final static String OPAQUE ="opaque";
+	public final static String FIXEDWIDTH ="fixedWidth";
+	public final static String FIXEDHEIGHT ="fixedHeight";
+    public static final String ATTRIBUTION = "Attribution";
+    
+    //LegendURL attributes
+    public static final String WIDTH = "width";
+    public static final String HEIGHT = "height";
+
+	public final static String MINX ="minx";
+	public final static String MINY ="miny";
+	public final static String MAXX ="maxx";
+	public final static String MAXY ="maxy";
+	public final static String RESX ="resx";
+	public final static String RESY ="rexy";
+	public final static String WESTBOUNDLONGITUDE ="westBoundLongitude";
+	public final static String EASTBOUNDLONGITUDE ="eastBoundLongitude";
+	public final static String SOUTHBOUNDLATITUDE ="southBoundLatitude";
+	public final static String NORTHBOUNDLATITUDE ="northBoundLatitude";
+
+	public final static String TYPE ="type";
+	public final static String MIN ="min";
+	public final static String MAX ="max";
+	public final static String DIMENSION_NAME ="name";
+    public final static String DIMENSION_UNITS ="units";
+    public final static String DIMENSION_UNIT_SYMBOL ="unitSymbol";
+
+    // Miscelaneous
+    public final static String DEFAULT ="default";
+
+    public final static String EPSG_4326="EPSG:4326";
+    public final static String CRS_84 ="CRS:84";
+    
+	//WMTS
+	public final static String WMTS_GMLTAG = "ows:";
+	public final static String WMTS_CAPABILITIES = "Capabilities";
+	public final static String WMTS_SERVICEID = "ServiceIdentification";
+	public final static String WMTS_SERVICEPROV = "ServiceProvider";
+	public final static String WMTS_OPMETADATA = "OperationsMetadata";
+	public final static String WMTS_CONTENTS = "Contents";
+	//Themes
+	public final static String WMTS_THEMES = "Themes";
+	public final static String WMTS_THEME = "Theme";
+	public final static String WMTS_LAYERREF = "LayerRef";
+	//Content
+	public final static String WMTS_LAYER = "Layer";
+	public final static String WMTS_OTHERSRC = "OtherSource";
+	public final static String WMTS_TILEMATRIXSET = "TileMatrixSet";
+	//Style
+	public final static String WMTS_IDENTIFIER = "Identifier";
+	public final static String WMTS_TITLE = "Title";
+	public final static String WMTS_ABSTRACT = "Abstract";
+	public final static String WMTS_KEYWORDS = "Keywords";
+	public final static String WMTS_KEYWORD = "Keyword";
+	public final static String WMTS_LEGENDURL = "LegendURL";
+	public final static String WMTS_ISDEFAULT = "isDefault";
+	//Layer
+	public final static String WMTS_WGS84BOUNDINGBOX = "WGS84BoundingBox";
+	public final static String WMTS_BOUNDINGBOX = "BoundingBox";
+	public final static String WMTS_STYLE = "Style";
+	public final static String WMTS_FORMAT = "Format";
+	public final static String WMTS_INFOFORMAT = "InfoFormat";
+	public final static String WMTS_DIMENSION = "Dimension";
+	public final static String WMTS_METADATA = "Metadata";
+	public final static String WMTS_RESOURCEURL = "ResourceURL";
+	public final static String WMTS_TILEMATRIXSETLINK = "TileMatrixSetLink";
+	public final static String WMTS_TILEMATRIXLIMITS = "TileMatrixLimits";
+	//LegendURL
+	public final static String WMTS_MINSCALEDEN = "MinScaleDenominator";
+	public final static String WMTS_MAXSCALEDEN = "MaxScaleDenominator";
+	public final static String WMTS_HREF = "href";
+	public final static String WMTS_WIDTH = "width";
+	public final static String WMTS_HEIGHT = "height";
+	//WGS84BoundingBox
+	public final static String WMTS_LOWERCORNER = "LowerCorner";
+	public final static String WMTS_UPPERCORNER = "UpperCorner";
+	public final static String WMTS_CRS = "crs";
+	public final static String WMTS_DIMENSIONS = "dimensions";
+	//Tiles
+	public final static String WMTS_TILEMATRIX = "TileMatrix";
+	public final static String WMTS_MINTILEROW = "MinTileRow";
+	public final static String WMTS_MAXTILEROW = "MaxTileRow";
+	public final static String WMTS_MINTILECOL = "MinTileCol";
+	public final static String WMTS_MAXTILECOL = "MaxTileCol";
+	//TileMatrixSet
+	public final static String WMTS_SUPPORTEDCRS = "SupportedCRS";
+	public final static String WMTS_WELLKNOWNSCALESET = "WellKnownScaleSet";
+	//TileMatrix
+	public final static String WMTS_SCALEDENOMINATOR = "ScaleDenominator";
+	public final static String WMTS_TOPLEFTCORNER = "TopLeftCorner";
+	public final static String WMTS_TILEWIDTH = "TileWidth";
+	public final static String WMTS_TILEHEIGHT = "TileHeight";
+	public final static String WMTS_MATRIXWIDTH = "MatrixWidth";
+	public final static String WMTS_MATRIXHEIGHT = "MatrixHeight";
+	
+	public final static String WMTS_UNITSYMBOL = "UnitSymbol";
+	public final static String WMTS_DEFAULTVALUE = "Default";
+	public final static String WMTS_CURRENT = "Current";
+	public final static String WMTS_AVAILABLEVALUE = "Value";
+	public final static String WMTS_UOM = "UOM";
+	
+	//ServiceIdentification
+	public final static String WMTS_SERVICETYPE = "ServiceType";
+	public final static String WMTS_SERVICETYPEVERSION = "ServiceTypeVersion";
+	public final static String WMTS_PROFILE = "Profile";
+	public final static String WMTS_FEES = "Fees";
+	public final static String WMTS_ACCESSCONSTRAINTS = "AccessConstraints";
+	
+	//ServiceProvider
+	public final static String WMTS_PROVIDERNAME = "ProviderName";
+	public final static String WMTS_PROVIDERSITE = "ProviderSite";
+	public final static String WMTS_SERVICECONTACT = "ServiceContact";
+	
+	//ResourceURL
+	public final static String WMTS_RESOURCETYPE = "resourceType";
+	public final static String WMTS_TEMPLATE = "template";
+}
+
+

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/WMTSOGCDefaultImplLibrary.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/WMTSOGCDefaultImplLibrary.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/WMTSOGCDefaultImplLibrary.java	(revision 6892)
@@ -0,0 +1,50 @@
+/* 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.ogc.impl;
+
+import org.gvsig.raster.wmts.ogc.WMTSOGCLibrary;
+import org.gvsig.raster.wmts.ogc.WMTSOGCLocator;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Library for default implementation initialization and configuration.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @version $Id$
+ */
+public class WMTSOGCDefaultImplLibrary extends AbstractLibrary {
+	
+	public WMTSOGCDefaultImplLibrary() {
+		registerAsImplementationOf(WMTSOGCLibrary.class);
+	}
+
+	protected void doInitialize() throws LibraryException {
+		WMTSOGCLocator.registerManager(WMTSOGCManagerImpl.class);
+	}
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+
+    }
+
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/WMTSOGCManagerImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/WMTSOGCManagerImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/WMTSOGCManagerImpl.java	(revision 6892)
@@ -0,0 +1,20 @@
+package org.gvsig.raster.wmts.ogc.impl;
+
+import java.io.IOException;
+import java.net.ConnectException;
+
+import org.gvsig.raster.wmts.ogc.WMTSClient;
+import org.gvsig.raster.wmts.ogc.WMTSOGCManager;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSClientImpl;
+import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileImpl;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
+
+public class WMTSOGCManagerImpl implements WMTSOGCManager {
+	public WMTSClient createWMTSClient(String url) throws ConnectException, IOException {
+		return new WMTSClientImpl(url);
+	}
+
+	public WMTSTile createTile(int[] size, int[] position, double[] coords) {
+		return new WMTSTileImpl(size, position, coords);
+	}
+}

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/EncodingXMLParser.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/EncodingXMLParser.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/EncodingXMLParser.java	(revision 6892)
@@ -0,0 +1,107 @@
+package org.gvsig.raster.wmts.ogc.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StringReader;
+
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/* 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.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+/* CVS MESSAGES:
+ *
+ * $Id$
+ * $Log$
+ *
+ */
+/**
+ * This class is a XML pull parser that discover and manage
+ * the file encoding
+ * @author Jorge Piera LLodr� (jorge.piera@iver.es)
+ */
+public class EncodingXMLParser extends KXmlParser{
+
+	/**
+	 * This method reads the first bytes of the file and
+	 * try to discover the file encoding. It parses the file
+	 * with retrieved encoding.
+	 * @param file
+	 * @throws XmlPullParserException 
+	 * @throws IOException 
+	 */
+	public void setInput(File file) throws XmlPullParserException, IOException{
+		FileReader reader = null;
+		reader = new FileReader(file);
+		//BufferedReader br = new BufferedReader(reader);
+		String encoding = "UTF-8";
+
+		char[] buffer = new char[(int) file.length()];
+		reader.read(buffer);
+		String string = new String(buffer);
+
+		// patch for ArcIMS + WMS connector > 9.0 bug
+		int a = string.toLowerCase().indexOf("<?xml");
+		if (a !=-1){
+			string = string.substring(a, string.length());
+		}
+		// end patch
+
+		StringBuffer st = new StringBuffer(string);
+		String searchText = "encoding=\"";
+		int index = st.indexOf(searchText);
+		if (index>-1) {
+			st.delete(0, index+searchText.length());
+			encoding = st.substring(0, st.indexOf("\""));
+		}			
+		
+		if (a > 0){
+			// patch for ArcIMS + WMS connector > 9.0 bug
+			super.setInput(new StringReader(string));
+			// end patch
+		}else{
+			super.setInput( new FileInputStream(file), encoding);
+		}
+	}
+}
+

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

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSServiceIdentificationImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSServiceIdentificationImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSServiceIdentificationImpl.java	(revision 6892)
@@ -0,0 +1,89 @@
+/* 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.ogc.impl.struct;
+
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSServiceIdentification;
+
+
+/**
+ * General information about this server
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSServiceIdentificationImpl extends WMTSBaseStruct implements WMTSServiceIdentification {
+	private String       serviceType          = null;
+	private String       serviceTypeVersion   = null;
+	private String       profile              = null;
+	private String       fees                 = null;
+	private String       accessConstraints    = null;
+	private List<String> keywords             = null;
+	
+	public List<String> getKeywords() {
+		return keywords;
+	}
+	
+	public void setKeywords(List<String> k) {
+		this.keywords = k;
+	}
+	
+	public String getServiceType() {
+		return serviceType;
+	}
+	
+	public void setServiceType(String serviceType) {
+		this.serviceType = serviceType;
+	}
+	
+	public String getServiceTypeVersion() {
+		return serviceTypeVersion;
+	}
+	
+	public void setServiceTypeVersion(String serviceTypeVersion) {
+		this.serviceTypeVersion = serviceTypeVersion;
+	}
+
+	public String getProfile() {
+		return profile;
+	}
+
+	public void setProfile(String profile) {
+		this.profile = profile;
+	}
+
+	public String getFees() {
+		return fees;
+	}
+
+	public void setFees(String fees) {
+		this.fees = fees;
+	}
+
+	public String getAccessConstraints() {
+		return accessConstraints;
+	}
+
+	public void setAccessConstraints(String accessConstraints) {
+		this.accessConstraints = accessConstraints;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSServiceIdentificationImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/TemplateSupport.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/TemplateSupport.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/TemplateSupport.java	(revision 6892)
@@ -0,0 +1,144 @@
+package org.gvsig.raster.wmts.ogc.impl.struct;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.gvsig.raster.wmts.ogc.WMTSStatus;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSStatusImpl;
+import org.gvsig.raster.wmts.ogc.struct.WMTSDimension;
+import org.gvsig.raster.wmts.ogc.struct.WMTSResourceURL;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
+
+/**
+ * Support for URL templates and parameters substitution
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TemplateSupport {
+	private List<WMTSDimension>    dimensions   = null;
+	private List<WMTSResourceURL>  resourcesURL = null;
+	
+	public TemplateSupport(List<WMTSDimension> dimensions, List<WMTSResourceURL> resourcesURL) {
+		this.dimensions = dimensions;
+		this.resourcesURL = resourcesURL;
+	}
+	
+	public List<WMTSDimension> getDimensions() {
+		if(dimensions == null)
+			dimensions = new ArrayList<WMTSDimension>(); 
+		return dimensions;
+	}
+	
+	public List<WMTSResourceURL> getResourceURL() {
+		if(resourcesURL == null)
+			resourcesURL = new ArrayList<WMTSResourceURL>();
+		return resourcesURL;
+	}
+	
+	/**
+	 * Builds the list of URL whether the capabilities file uses templates.
+	 */
+	public void buildResourceURLListFromTemplate(WMTSStatus status) {
+		String template = getTemplate(status.getFormat(), status.getStyle());
+		String dimensionValueToWrite = status.getValueForDimension();
+		
+		if(template == null)
+			return;
+		
+		if(dimensionValueToWrite == null)
+			dimensionValueToWrite = getDimensionValueToWriteInTemplate(template);
+		
+		replacePatternsInTemplate(template, status, dimensionValueToWrite);
+	}
+	
+	/**
+	 * Gets the dimension which we want to write in the template, replacing the
+	 * dimension identifier. This function is just called if the user has not passed 
+	 * this value.
+	 * @param template
+	 * @return
+	 */
+	private String getDimensionValueToWriteInTemplate(String template) {
+		for (int iDimension = 0; iDimension < getDimensions().size(); iDimension++) {
+			WMTSDimension dim = getDimensions().get(iDimension);
+			String idDim = dim.getIdentifier();
+			if(template.toLowerCase().contains("{" + idDim.toLowerCase() + "}")) {
+				return dim.getDefaultValue();
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Replaces strings in the template and load each URL in an array in <code>WMTSStatus</code>
+	 * @param template
+	 * @param status
+	 * @param dimensionValue
+	 */
+	private void replacePatternsInTemplate(String template, WMTSStatus status, String dimensionValue) {
+		String idDimensionToBeReplaced = getDimensionIDToReplace(template);
+		template = template.replaceAll("(?i)\\{" + idDimensionToBeReplaced + "\\}", dimensionValue);
+		template = template.replace("{TileMatrixSet}", status.getTileMatrixSet());
+		template = template.replace("{TileMatrix}", status.getTileMatrix());
+		
+		for (int i = 0; i < status.getTileList().size(); i++) {
+			WMTSTile tile = status.getTileList().get(i);
+			String url = new String(template);
+			url = url.replace("{TileRow}", tile.getRow() + "");
+			url = url.replace("{TileCol}", tile.getCol() + "");
+			((WMTSStatusImpl)status).addResourceURL(tile.getRow() + "" + tile.getCol() + "", url);
+		}
+	}
+	
+	/**
+	 * Gets the dimension identifier to be replaced by the dimension value
+	 * @param template
+	 * @return
+	 */
+	private String getDimensionIDToReplace(String template) {
+		for (int iDimension = 0; iDimension < getDimensions().size(); iDimension++) {
+			WMTSDimension dim = getDimensions().get(iDimension);
+			String idDim = dim.getIdentifier();
+			if(template.toLowerCase().contains("{" + idDim.toLowerCase() + "}")) {
+				return idDim;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Return a template which supports the format and the style selected
+	 * @param format
+	 * @param style
+	 * @return
+	 */
+	private String getTemplate(String format, String style) {
+		for (int iResourceURL = 0; iResourceURL < getResourceURL().size(); iResourceURL++) {
+			String currentFormat = getResourceURL().get(iResourceURL).getFormat();
+			if(currentFormat != null && currentFormat.equals(format)) {
+				String template = getResourceURL().get(iResourceURL).getTemplate();
+				if(isStyleSupported(template, style)) {
+					return template;
+				}
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Returns true if the style is supported in the template URL
+	 * @param template
+	 * @param style
+	 * @return
+	 */
+	private boolean isStyleSupported(String template, String style) {
+		Pattern p = Pattern.compile("/" + style + "/", Pattern.CASE_INSENSITIVE);
+		Matcher m = p.matcher(template);
+		if(m.find())
+			return true;
+		return false;
+	}
+	
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/TemplateSupport.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSServiceProviderImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSServiceProviderImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSServiceProviderImpl.java	(revision 6892)
@@ -0,0 +1,60 @@
+/* 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.ogc.impl.struct;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSServiceProvider;
+
+
+/**
+ * General information about this server
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSServiceProviderImpl extends WMTSBaseStruct implements WMTSServiceProvider {
+	private String      providerName      = null;
+	private String      providerSite      = null;
+	private String      serviceContact    = null;
+	
+	public String getProviderName() {
+		return providerName;
+	}
+	
+	public void setProviderSite(String providerSite) {
+		this.providerSite = providerSite;
+	}
+	
+	public String getProviderSite() {
+		return providerSite;
+	}
+	
+	public void setProviderName(String providerName) {
+		this.providerName = providerName;
+	}
+
+	public String getServiceContact() {
+		return serviceContact;
+	}
+
+	public void setServiceContact(String serviceContact) {
+		this.serviceContact = serviceContact;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSServiceProviderImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixSetLinkImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixSetLinkImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixSetLinkImpl.java	(revision 6892)
@@ -0,0 +1,142 @@
+/* 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.ogc.impl.struct;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixLimits;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSet;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSetLink;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Set of tiles
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSTileMatrixSetLinkImpl implements WMTSTileMatrixSetLink {
+	private String                       tileMatrixSetId              = null;
+	private WMTSTileMatrixSetImpl        tileMatrixSet                = null;
+	private List<WMTSTileMatrixLimits>   tileMatrixLimits             = null;
+	protected boolean                    forceChangeAxisOrder         = false;
+	
+	/**
+	 * Sets longitude first in the axis order read from the capabilities file
+	 * @param force
+	 */
+	public void setForceChangeAxisOrder(boolean force) {
+		this.forceChangeAxisOrder = force;
+	}
+	
+    /**
+     * Parses this service
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public abstract void parse(KXmlParser parser) throws IOException, XmlPullParserException; 
+    
+	public String getTileMatrixSetId() {
+		return tileMatrixSetId;
+	}
+	
+	public void setTileMatrixSetId(String tileMatrixSetId) {
+		this.tileMatrixSetId = tileMatrixSetId;
+	}
+	
+	public WMTSTileMatrixSet getTileMatrixSet() {
+		return tileMatrixSet;
+	}
+	
+	public void setTileMatrixSet(WMTSTileMatrixSetImpl tileMatrixSet) {
+		this.tileMatrixSet = tileMatrixSet;
+	}
+	
+	public List<WMTSTileMatrixLimits> getTileMatrixLimits() {
+		if(tileMatrixLimits == null)
+			tileMatrixLimits = new ArrayList<WMTSTileMatrixLimits>();
+		return tileMatrixLimits;
+	}
+	
+	/**
+	 * Links the TileMatrixLimits with the TileMatrix
+	 * @param tileMatrixSet
+	 */
+	public void linkTileMatrix(WMTSTileMatrixSetImpl tileMatrixSet) {
+		//Recorre la lista de TileMatrixLimits y asigna a cada uno el TileMatrix asociado 
+		//definido en la etiqueta
+		if(tileMatrixLimits == null)
+			return;
+		java.util.List<String> idListToRemove = new ArrayList<String>();
+		for (int i = 0; i < tileMatrixLimits.size(); i++) {
+			WMTSTileMatrixLimitsImpl limits = (WMTSTileMatrixLimitsImpl)tileMatrixLimits.get(i);
+			String id = limits.getRefToTileMatrix();
+			boolean isWithoutReference = true;
+			for (int j = 0; j < tileMatrixSet.getTileMatrix().size(); j++) {
+				WMTSTileMatrixImpl tileMatrix = (WMTSTileMatrixImpl)tileMatrixSet.getTileMatrix().get(j);
+				if(tileMatrix.getIdentifier().compareTo(id) == 0) {
+					limits.setTileMatrix(tileMatrix);
+					isWithoutReference = false;
+					break;
+				}
+			}
+			if(isWithoutReference) {
+				idListToRemove.add(id);
+			}
+		}
+		removeLevelsFromTileMatrix(idListToRemove);
+	}
+	
+	/**
+	 * Removes form the <code>WMTSTileMatrixLimits</code> the elements in the
+	 * ID list. These elements are <code>WMTSTileMatrix</code> without reference
+	 * @param idList 
+	 *        List of identifiers
+	 */
+	private void removeLevelsFromTileMatrix(java.util.List<String> idList) {
+		if(tileMatrixLimits == null || idList == null || idList.size() == 0)
+			return;
+		for (int i = 0; i < idList.size(); i++) {
+			String id = idList.get(i);
+			for (int j = 0; j < tileMatrixLimits.size(); j++) {
+				WMTSTileMatrixLimitsImpl limits = (WMTSTileMatrixLimitsImpl)tileMatrixLimits.get(j);
+				if(id.equals(limits.getRefToTileMatrix())) {
+					tileMatrixLimits.remove(j);
+					break;
+				}
+			}
+		}
+	}
+	
+	
+	public void print() {
+		System.out.println(" *****WMTSTileMatrixSetLink******");
+		System.out.println("TileMatrixSet ID:" + getTileMatrixSetId());
+		for (int i = 0; i < getTileMatrixLimits().size(); i++) {
+			WMTSTileMatrixLimitsImpl limits = ((WMTSTileMatrixLimitsImpl)getTileMatrixLimits().get(i));
+			limits.print();
+		}
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixSetLinkImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSLayerImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSLayerImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSLayerImpl.java	(revision 6892)
@@ -0,0 +1,286 @@
+/* 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.ogc.impl.struct;
+
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.raster.wmts.ogc.WMTSStatus;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSServerDescription;
+import org.gvsig.raster.wmts.ogc.struct.WMTSBoundingBox;
+import org.gvsig.raster.wmts.ogc.struct.WMTSDimension;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSResourceURL;
+import org.gvsig.raster.wmts.ogc.struct.WMTSStyle;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrix;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixLimits;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSet;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSetLink;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Describes the attributes of a layer in a WMTS server
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSLayerImpl extends WMTSBaseStruct implements WMTSLayer {
+	protected WMTSBoundingBox             wgs84bbox                    = null;
+	protected WMTSBoundingBox             bbox                         = null;
+	private List<WMTSStyle>               style                        = null;
+	private List<String>                  imageFormat                  = null;
+	private List<String>                  infoFormat                   = null;
+	private List<String>                  keywords                     = null;
+	private List<WMTSDimension>           dimension                    = null;
+	private String                        metadata                     = null;
+	private List<WMTSTileMatrixSetLink>   tileMatrixSetLinkList        = null;
+	private List<WMTSResourceURL>         resourceURL                  = null;
+	protected WMTSServerDescription       status                       = null;
+	private Logger                        log                          = LoggerFactory.getLogger(WMTSLayerImpl.class);
+	protected boolean                     forceChangeAxisOrder         = false;
+	private HashMap<String, Rectangle2D>  transformations = new HashMap<String, Rectangle2D>();
+
+	/**
+	 * Sets longitude first in the axis order read from the capabilities file
+	 * @param force
+	 */
+	public void setForceChangeAxisOrder(boolean force) {
+		this.forceChangeAxisOrder = force;
+	}
+
+	public WMTSLayerImpl(WMTSServerDescription status) {
+		this.status = status;
+	}
+
+	public String getMetadata() {
+		return metadata;
+	}
+
+	public void setMetadata(String metadata) {
+		this.metadata = metadata;
+	}
+
+	public List<String> getFormat() {
+		if(imageFormat == null)
+			imageFormat = new ArrayList<String>();
+		return imageFormat;
+	}
+
+	public List<String> getInfoFormat() {
+		if(infoFormat == null)
+			infoFormat = new ArrayList<String>();
+		return infoFormat;
+	}
+
+	public List<String> getKeywords() {
+		return keywords;
+	}
+
+	public void setKeywords(List<String> k) {
+		this.keywords = k;
+	}
+
+	public WMTSBoundingBox getWGS84BBox() {
+		return wgs84bbox;
+	}
+
+	public Rectangle2D getWGS84BBoxTransformed(String epsg) {
+		Rectangle2D r = transformations.get(epsg);
+		if(r != null) {
+			return r;
+		}
+
+		IProjection projSrc = CRSFactory.getCRS("EPSG:4326");
+		try {
+			IProjection projDst = CRSFactory.getCRS(epsg);
+			if(projDst != null) {
+				try {
+					ICoordTrans t = projSrc.getCT(projDst);
+					if (t!=null){
+						r = t.convert(wgs84bbox.toRectangle2D());
+					} else {
+						r = wgs84bbox.toRectangle2D();
+					}
+					if(isBoundingBoxValid(r)) {
+						transformations.put(epsg, r);
+						return r;
+					}
+				} catch (Exception e) {
+					log.info("I cannot get the transformation between EPSG:4326 and " + epsg, e);
+				}
+			}
+		} catch (Exception e1) {
+			log.info("I cannot get " + epsg, e1);
+		}
+		return null;
+	}
+
+	private boolean isBoundingBoxValid(Rectangle2D bbox) {
+		if(Double.isInfinite(bbox.getX()) ||
+			Double.isNaN(bbox.getX()) ||
+			Double.isInfinite(bbox.getY()) ||
+			Double.isNaN(bbox.getY())) {
+			return false;
+		}
+		return true;
+	}
+
+	public WMTSBoundingBox getBBox() {
+		return bbox;
+	}
+
+	public void setWGS84BBox(WMTSBoundingBox wgs84bbox) {
+		this.wgs84bbox = wgs84bbox;
+	}
+
+	public void setBBox(WMTSBoundingBox bbox) {
+		this.bbox = bbox;
+	}
+
+	public List<WMTSResourceURL> getResourceURL() {
+		if(resourceURL == null)
+			resourceURL = new ArrayList<WMTSResourceURL>();//resourceURL = (WMTSResourceURL)status.createVersionObject("WMTSResourceURL");
+		return resourceURL;
+	}
+
+	public List<WMTSDimension> getDimensions() {
+		if(dimension == null)
+			dimension = new ArrayList<WMTSDimension>(); //(WMTSDimension)status.createVersionObject("WMTSDimension");
+		return dimension;
+	}
+
+	public List<WMTSStyle> getStyle() {
+		if(style == null)
+			style = new ArrayList<WMTSStyle>();//(WMTSStyle)status.createVersionObject("WMTSStyle");
+		return style;
+	}
+
+	public List<WMTSTileMatrixSetLink> getTileMatrixSetLink() {
+		if(tileMatrixSetLinkList == null)
+			tileMatrixSetLinkList = new ArrayList<WMTSTileMatrixSetLink>();
+		return tileMatrixSetLinkList;
+	}
+
+	/**
+	 * Returns the initial level of this layer inside the matrix set.
+	 * @return
+	 */
+	public int getInitialLevel(String tileMatrixSetId) {
+		int initialLevel = 0;
+		for (int i = 0; i < tileMatrixSetLinkList.size(); i++) {
+			WMTSTileMatrixSetLinkImpl tileMatrixSetLink = (WMTSTileMatrixSetLinkImpl)tileMatrixSetLinkList.get(i);
+			String id = tileMatrixSetLink.getTileMatrixSetId();
+			if(tileMatrixSetId.compareTo(id) == 0) {
+				List<WMTSTileMatrixLimits> tileMatrixLimits = tileMatrixSetLink.getTileMatrixLimits();
+				if(tileMatrixLimits != null && tileMatrixLimits.size() > 0) {
+					String ref = ((WMTSTileMatrixLimitsImpl)tileMatrixLimits.get(0)).getRefToTileMatrix();
+					List<WMTSTileMatrix> tileMatrixList = ((WMTSTileMatrixSetImpl)tileMatrixSetLink.getTileMatrixSet()).getTileMatrix();
+					for (int j = 0; j < tileMatrixList.size(); j++) {
+						String idTileMatrix = ((WMTSTileMatrixImpl)tileMatrixList.get(j)).getIdentifier();
+						if(idTileMatrix.compareTo(ref) == 0)
+							return initialLevel;
+						initialLevel ++;
+					}
+				}
+			}
+		}
+		return initialLevel;
+	}
+
+	/**
+	 * Links the TileMatrixSet with the limits inside the layer structure
+	 * @param tileMatrixSetList
+	 */
+	public void linkTileMatrixSets(List<WMTSTileMatrixSet> tileMatrixSetList) {
+		//Recorre la lista de TileMatrixSetLink y a cada uno le asigna su TileMatrixSet
+		//Para cada TileMatrixLimits contenido en el TileMatrixSetLimits asociado le asigna
+		//el objeto TileMatrix a partir de su referencia.
+		if(tileMatrixSetLinkList == null)
+			return;
+		for (int i = 0; i < tileMatrixSetLinkList.size(); i++) {
+			WMTSTileMatrixSetLinkImpl tileMatrixSetLink = (WMTSTileMatrixSetLinkImpl)tileMatrixSetLinkList.get(i);
+			String id = tileMatrixSetLink.getTileMatrixSetId();
+			for (int j = 0; j < tileMatrixSetList.size(); j++) {
+				WMTSTileMatrixSetImpl tileMatrixSet = (WMTSTileMatrixSetImpl)tileMatrixSetList.get(j);
+				if(tileMatrixSet.getIdentifier().compareTo(id) == 0) {
+					tileMatrixSetLink.setTileMatrixSet(tileMatrixSet);
+					tileMatrixSetLink.linkTileMatrix(tileMatrixSet);
+					break;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Gets the list of srs's supported
+	 * @return
+	 */
+	public List<String> getSrsList() {
+		List<String> list = new ArrayList<String>();
+		for (int i = 0; i < tileMatrixSetLinkList.size(); i++) {
+			WMTSTileMatrixSetLinkImpl link = (WMTSTileMatrixSetLinkImpl)tileMatrixSetLinkList.get(i);
+			WMTSTileMatrixSetImpl tileMatrixSet = (WMTSTileMatrixSetImpl)link.getTileMatrixSet();
+			list.add(tileMatrixSet.getSupportedCRS());
+		}
+		return list;
+	}
+
+	/**
+	 * Builds the list of URL whether the capabilities file uses templates.
+	 */
+	public void buildResourceURLListFromTemplate(WMTSStatus status) {
+		TemplateSupport templateSupport = new TemplateSupport(getDimensions(), getResourceURL());
+		templateSupport.buildResourceURLListFromTemplate(status);
+	}
+
+	public void print() {
+		System.out.println("*****WMTSLayer******");
+		System.out.println("Abstract:" + getAbstract());
+		System.out.println("Identifier:" + getIdentifier());
+		System.out.println("Keywords:");
+		for (int i = 0; i < keywords.size(); i++) {
+			System.out.println("Keyword:" + keywords.get(i));
+		}
+		System.out.println("Title:" + getTitle());
+		for (int i = 0; i < getFormat().size(); i++) {
+			System.out.println("Format:" + getFormat().get(i));
+		}
+		for (int i = 0; i < getInfoFormat().size(); i++) {
+			System.out.println("InfoFormat:" + getInfoFormat().get(i));
+		}
+		((WMTSBoundingBoxImpl)getBBox()).print();
+		((WMTSBoundingBoxImpl)getWGS84BBox()).print();
+		for (int i = 0; i < getDimensions().size(); i++) {
+			((WMTSDimensionImpl)getDimensions().get(i)).print();
+		}
+		System.out.println("Metadata:" + getMetadata());
+		for (int i = 0; i < getTileMatrixSetLink().size(); i++) {
+			((WMTSTileMatrixSetLinkImpl)getTileMatrixSetLink().get(i)).print();
+		}
+	}
+
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSLayerImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSBoundingBoxImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSBoundingBoxImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSBoundingBoxImpl.java	(revision 6892)
@@ -0,0 +1,111 @@
+/* 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.ogc.impl.struct;
+
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSBoundingBox;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Describes the bounding box of a layer in a WMTS server
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSBoundingBoxImpl implements WMTSBoundingBox {
+	private double[]   lowerCorner                  = new double[2];
+	private double[]   upperCorner                  = new double[2];
+	private String     crs                          = "";
+	private int        dimensions                   = 2;
+	//protected boolean  forceLongitudeFirstAxisOrder = false;
+	
+	/**
+	 * Sets longitude first in the axis order read from the capabilities file
+	 * @param force
+	 */
+	/*public void setForceLongitudeFirstAxisOrder(boolean force) {
+		this.forceLongitudeFirstAxisOrder = force;
+	}*/
+	
+	/**
+     * Parses this service ID
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public abstract void parse(KXmlParser parser) throws IOException, XmlPullParserException; 
+    
+	
+	public double[] getLowerCorner() {
+		return lowerCorner;
+	}
+	
+	public void setLowerCorner(double[] lowerCorner) {
+		this.lowerCorner = lowerCorner;
+	}
+	
+	public double[] getUpperCorner() {
+		return upperCorner;
+	}
+	
+	public void setUpperCorner(double[] upperCorner) {
+		this.upperCorner = upperCorner;
+	}
+	
+	public String getCrs() {
+		return crs;
+	}
+	
+	public void setCrs(String crs) {
+		this.crs = crs;
+	}
+	
+	public int getDimensions() {
+		return dimensions;
+	}
+	
+	public void setDimensions(int dimensions) {
+		this.dimensions = dimensions;
+	}
+	
+	public Rectangle2D toRectangle2D() {
+		return new Rectangle2D.Double(Math.min(upperCorner[0], lowerCorner[0]), 
+				Math.min(upperCorner[1], lowerCorner[1]), 
+				Math.abs(upperCorner[0] - lowerCorner[0]), 
+				Math.abs(upperCorner[1] - lowerCorner[1]));
+	}
+	
+	public boolean isValid() {
+		return lowerCorner[0] != 0 || lowerCorner[1] != 0 || upperCorner[0] != 0 || upperCorner[1] != 0;
+	}
+	
+	public void print() {
+		System.out.println("*****WMTSBoundingBox******");
+		System.out.println("LowerCorner:" + getLowerCorner()[0] + "," + getLowerCorner()[1]);
+		System.out.println("UpperCorner:" + getUpperCorner()[0] + "," + getUpperCorner()[1]);
+		System.out.println("Crs:" + getCrs());
+		System.out.println("Dimensions:" + getDimensions());
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSBoundingBoxImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSLegendURLImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSLegendURLImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSLegendURLImpl.java	(revision 6892)
@@ -0,0 +1,99 @@
+/* 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.ogc.impl.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSLegendURL;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Description of an image that represents the legend of the map
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSLegendURLImpl implements WMTSLegendURL {
+	private int    width               = 0;
+	private int    height              = 0;
+	private double minScaleDenominator = 0;
+	private double maxScaleDenominator = 0;
+	private String format              = "";
+	private String href                = "";
+	
+	/**
+     * Parses this service
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public abstract void parse(KXmlParser parser) throws IOException, XmlPullParserException; 
+    
+    
+	public int getWidth() {
+		return width;
+	}
+	
+	public void setWidth(int width) {
+		this.width = width;
+	}
+	
+	public int getHeight() {
+		return height;
+	}
+	
+	public void setHeight(int height) {
+		this.height = height;
+	}
+	
+	public double getMinScaleDenominator() {
+		return minScaleDenominator;
+	}
+	
+	public void setMinScaleDenominator(double minScaleDenominator) {
+		this.minScaleDenominator = minScaleDenominator;
+	}
+	
+	public double getMaxScaleDenominator() {
+		return maxScaleDenominator;
+	}
+	
+	public void setMaxScaleDenominator(double maxScaleDenominator) {
+		this.maxScaleDenominator = maxScaleDenominator;
+	}
+	
+	public String getFormat() {
+		return format;
+	}
+	
+	public void setFormat(String format) {
+		this.format = format;
+	}
+	
+	public String getHref() {
+		return href;
+	}
+	
+	public void setHref(String href) {
+		this.href = href;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSLegendURLImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixImpl.java	(revision 6892)
@@ -0,0 +1,502 @@
+/* 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.ogc.impl.struct;
+
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrix;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixLimits;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Description of a tile matrix
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSTileMatrixImpl extends WMTSBaseStruct implements WMTSTileMatrix {
+    private double                  scaleDenominator             = 0;
+    private Rectangle2D             bboxTileMatrixSet            = null;
+    private double[]                topLeftCorner                = null;
+    private int                     tileWidth                    = 0;
+    private int                     tileHeight                   = 0;
+    private long                    matrixWidth                  = 0;
+    private long                    matrixHeight                 = 0;
+    private static final double     MTS_X_GRADO                  = 111319.490793274;
+    protected boolean               forceChangeAxisOrder         = false;
+    private double                  epsilon                      = 1e-6;
+    private String                  tileMatrixSetSupportedCRS    = null;
+	
+    
+	/**
+	 * Force to change the axis order read from the capabilities
+	 * @param force
+	 */
+	public void setForceChangeAxisOrder(boolean force) {
+		this.forceChangeAxisOrder = force;
+	}
+	
+	/**
+	 * Sets the CRS supported by the parent
+	 * @param parentSupportedCRS
+	 */
+	public void setSupportedCRS(String parentSupportedCRS) {
+		this.tileMatrixSetSupportedCRS = parentSupportedCRS;
+	}
+	
+	/**
+	 * Gets the CRS supported by the parent
+	 * @return
+	 */
+	public String getSupportedCRS() {
+		return this.tileMatrixSetSupportedCRS;
+	}
+	
+	public void checkChangeAxis() {
+		if(forceChangeAxisOrder) {
+			double aux = topLeftCorner[0];
+			topLeftCorner[0] = topLeftCorner[1];
+			topLeftCorner[1] = aux;
+			return;
+		}
+		
+    	if(tileMatrixSetSupportedCRS.contains("CRS:84") || tileMatrixSetSupportedCRS.contains("CRS84"))
+    		return;
+    	
+		//Para CRS no proyectados menos CRS:84 hay que cambiar de orden los ejes
+		String epsgNumber = tileMatrixSetSupportedCRS.substring(tileMatrixSetSupportedCRS.lastIndexOf(":") + 1);
+		try {
+			Integer.parseInt(epsgNumber);
+			IProjection projSrc = CRSFactory.getCRS("EPSG:" + epsgNumber);
+			if(projSrc != null && !projSrc.isProjected()) {
+				double aux = topLeftCorner[0];
+				topLeftCorner[0] = topLeftCorner[1];
+				topLeftCorner[1] = aux;
+			}
+		} catch (NumberFormatException e) {
+			//No se invierte el orden de los ejes
+		} catch (Exception e) {
+		}
+	}
+	
+	public void setBBoxTileMatrixSet(Rectangle2D bbox) {
+		if(bboxTileMatrixSet == null)
+			this.bboxTileMatrixSet = bbox;
+	}
+	
+	public Rectangle2D getBBoxTileMatrixSet() {
+		return bboxTileMatrixSet;
+	}
+
+    /*public class InternalTileImpl implements WMTSTile {
+    	public int       wPx, hPx;
+    	public int       row, col;
+    	public double    ulx, uly, lrx, lry;
+    	public File      file;
+
+    	public InternalTileImpl(int wPx, int hPx, int row, int col, double ulx, double uly, double lrx, double lry) {
+    		this.row = row;
+    		this.col = col;
+    		this.ulx = ulx;
+    		this.uly = uly;
+    		this.lrx = lrx;
+    		this.lry = lry;
+    		this.wPx = wPx;
+    		this.hPx = hPx;
+    	}
+    	
+    	public double getULX() {
+    		return ulx;
+    	}
+    	
+    	public double getULY() {
+    		return uly;	
+    	}
+    	
+    	public double getLRX() {
+    		return lrx;
+    	}
+    	
+    	public double getLRY() {
+    		return lry;
+    	}
+    	
+    	public int getWidthPx() {
+    		return wPx;
+    	}
+    	
+    	public int getHeightPx() {
+    		return hPx;
+    	}
+    	
+    	public int getRow() {
+    		return row;
+    	}
+    	
+    	public int getCol() {
+    		return col;
+    	}
+    	
+    	public void setFile(File file) {
+    		this.file = file;
+    	}
+    	
+    	public File getFile() {
+    		return file;
+    	}
+    	 
+    	
+    	public Point2D worldToRaster(Point2D pt) {
+    		Point2D p = new Point2D.Double();
+    		double psX = (lrx - ulx) / tileWidth;
+    		double psY = (lry - uly) / tileHeight;
+    		AffineTransform t = new AffineTransform(psX, 0, 0, psY, ulx - (psX / 2), uly + (psY / 2));
+    		try {
+    			t.inverseTransform(pt, p);
+    		} catch (NoninvertibleTransformException e) {
+    			return pt;
+    		}
+    		return p;
+    	}
+    	
+    	public WMTSTile cloneTile() {
+    		InternalTileImpl status = new InternalTileImpl(wPx, hPx, row, col, ulx, uly, lrx, lry);
+    		status.file = file;
+    		return status;
+    	}
+    }*/
+
+    /**
+     * Parses this service
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+	public abstract void parse(KXmlParser parser, List<WMTSTileMatrix> list) throws IOException, XmlPullParserException; 
+	
+    
+	public double getScaleDenominator() {
+		return scaleDenominator;
+	}
+
+	public void setScaleDenominator(double scaleDenominator) {
+		this.scaleDenominator = scaleDenominator;
+	}
+
+	public int getTileWidth() {
+		return tileWidth;
+	}
+
+	public void setTileWidth(int tileWidth) {
+		this.tileWidth = tileWidth;
+	}
+
+	public int getTileHeight() {
+		return tileHeight;
+	}
+
+	public void setTileHeight(int tileHeight) {
+		this.tileHeight = tileHeight;
+	}
+
+	public long getMatrixWidth() {
+		return matrixWidth;
+	}
+
+	public void setMatrixWidth(long matrixWidth) {
+		this.matrixWidth = matrixWidth;
+	}
+
+	public long getMatrixHeight() {
+		return matrixHeight;
+	}
+
+	public void setMatrixHeight(long matrixHeight) {
+		this.matrixHeight = matrixHeight;
+	}
+
+	public double[] getTopLeftCorner() {
+		if(topLeftCorner == null)
+			topLeftCorner = new double[2];
+		return topLeftCorner;
+	}
+	
+    public void parse(KXmlParser parser) throws IOException, XmlPullParserException {
+    	
+    }
+    
+    /**
+     * Gets the width in world coordinates of a tile
+     * @return
+     */
+    public double getWidthWCTile(boolean projected) {
+    	double pixelSpan = 0;
+    	if(!projected) {
+    		/*if(getBBoxTileMatrixSet() != null)
+    			return getBBoxTileMatrixSet().getWidth() / matrixWidth;
+    		else {*/
+    			pixelSpan = (scaleDenominator * 0.00028) / MTS_X_GRADO;
+    		//}
+    	} else {
+    		pixelSpan = (scaleDenominator * 0.00028);
+    	}
+    	
+    	double w = pixelSpan * tileWidth;
+		if(((w - ((int)w)) > (1 - epsilon) || (w - ((int)w)) < epsilon))
+			return Math.round(w);
+		return w;
+    }
+    
+    /**
+     * Gets the height in world coordinates of a tile
+     * @return
+     */
+    public double getHeightWCTile(boolean projected) {
+    	double pixelSpan = 0;
+    	if(!projected) {
+    		/*if(getBBoxTileMatrixSet() != null)
+    			return getBBoxTileMatrixSet().getHeight() / matrixHeight;
+    		else {*/
+    			pixelSpan = (scaleDenominator * 0.00028) / MTS_X_GRADO;
+    		//}
+    	} else {
+    		pixelSpan = (scaleDenominator * 0.00028);
+    	}
+    	
+    	double h = pixelSpan * tileHeight;
+		if(((h - ((int)h)) > (1 - epsilon) || (h - ((int)h)) < epsilon))
+			return Math.round(h);
+		return h;
+    }
+    
+    /**
+     * This function will check if the request coordinates intersects with the tiles in the matrix. If a tile
+     * intersects then this will be added to the list.
+     * @deprecated this method was for grid subsets.   
+     */
+	public List<WMTSTile> intersects(boolean projected, WMTSTileMatrixLimits tileMatrixLimits, Rectangle2D request, Rectangle2D extentLayer) {
+    	double widthMtsTile = getWidthWCTile(projected);
+    	double heightMtsTile = getHeightWCTile(projected);
+
+		double ulx, uly, lrx, lry;
+    	List<WMTSTile> list = new ArrayList<WMTSTile>();
+    	Rectangle2D r = new Rectangle2D.Double(0, 0, 0, 0);
+
+    	//Recorre la matriz de tiles calculando las coordenadas de cada tile
+    	//Para cada tile comprueba si intersecta con el �rea seleccionada si es as�
+    	//mete el tile en la lista para devolverlo como resultado
+    	
+    	//cambiar esto por un conversor entre coordenadas pixel y reales
+    	
+    	int i = 0, j = 0;
+    	double initX = topLeftCorner[1] + (widthMtsTile * tileMatrixLimits.getMinTileCol());
+    	double initY = topLeftCorner[0] - (heightMtsTile * (tileMatrixLimits.getMinTileRow()));
+    	
+    	for (int row = tileMatrixLimits.getMinTileRow(); row <= tileMatrixLimits.getMaxTileRow(); row++) {
+    		uly = initY - (heightMtsTile * i);
+			lry = uly - heightMtsTile;
+			j = 0;
+			for (int col = tileMatrixLimits.getMinTileCol(); col <= tileMatrixLimits.getMaxTileCol(); col++) {
+				ulx = initX + (widthMtsTile * j);
+				lrx = ulx + widthMtsTile;
+				r.setRect(Math.min(ulx, lrx), Math.min(uly, lry), Math.abs(ulx - lrx), Math.abs(uly - lry));
+				if(request.intersects(r) && r.intersects(extentLayer)) {
+					list.add(new WMTSTileImpl(tileWidth, tileHeight, row, col, ulx, uly, lrx, lry));
+				}
+				j ++;
+			}
+			i ++;
+		}
+    	
+    	return list;
+    }
+    
+    /**
+     * This function will check if the request coordinates intersects with the tiles in the matrix. If a tile
+     * intersects then this will be added to the list.  
+     */
+	public List<WMTSTile> intersects(boolean projected, Rectangle2D request, Rectangle2D extentLayer) {
+    	double widthWorldCoordTile = getWidthWCTile(projected);
+    	double heightWorldCoordTile = getHeightWCTile(projected); 
+
+		double ulx, uly, lrx, lry;
+		List<WMTSTile> list = new ArrayList<WMTSTile>();
+    	Rectangle2D r = new Rectangle2D.Double(0, 0, 0, 0);
+
+    	//Recorre la matriz de tiles calculando las coordenadas de cada tile
+    	//Para cada tile comprueba si intersecta con el �rea seleccionada si es as�
+    	//mete el tile en la lista para devolverlo como resultado
+    	
+    	double initX = topLeftCorner[0];
+    	double initY = topLeftCorner[1];
+    	
+    	int tileInitX = 0;
+    	int tileInitY = 0;
+    	int tileEndX = (int)(matrixWidth - 1);
+    	int tileEndY = (int)(matrixHeight - 1);
+    	
+    	if(request.getMinX() >= initX)
+    		tileInitX = (int)((request.getMinX() - initX) / widthWorldCoordTile);
+    	if(request.getMaxY() <= initY)
+    		tileInitY = (int)(Math.abs(request.getMaxY() - initY) / heightWorldCoordTile);
+    	if(request.getMaxX() <= (widthWorldCoordTile * matrixWidth))
+    		tileEndX = (int)((request.getMaxX() - initX) / widthWorldCoordTile);
+    	if(request.getMinY() >= (heightWorldCoordTile * matrixHeight))
+    		tileEndY = (int)(Math.abs(request.getMinY() - initY) / heightWorldCoordTile);
+    	
+    	for (int row = tileInitY; row <= tileEndY; row++) {
+    		uly = initY - (heightWorldCoordTile * row);
+			lry = uly - heightWorldCoordTile;
+			for (int col = tileInitX; col <= tileEndX; col++) {
+				ulx = initX + (widthWorldCoordTile * col);
+				lrx = ulx + widthWorldCoordTile;
+				r.setRect(Math.min(ulx, lrx), Math.min(uly, lry), Math.abs(ulx - lrx), Math.abs(uly - lry));
+				//El segundo intersects es necesario porque el extent de la capa puede variar por cada nivel de 
+				//resoluci�n en caso de que haya una lista de TileMatrix en el capabilities
+				if(row < matrixHeight && col < matrixWidth) {
+					if(request.intersects(r) && r.intersects(extentLayer)) { 
+						list.add(new WMTSTileImpl(tileWidth, tileHeight, row, col, ulx, uly, lrx, lry));
+					}
+				}
+			}
+		}
+    	
+//    	int i = 0, j = 0;
+//    	for (int row = 0; row < matrixHeight; row++) {
+//    		uly = initY - (heightMtsTile * i);
+//			lry = uly - heightMtsTile;
+//			j = 0;
+//			for (int col = 0; col < matrixWidth; col++) {
+//				ulx = initX + (widthMtsTile * j);
+//				lrx = ulx + widthMtsTile;
+//				r.setRect(Math.min(ulx, lrx), Math.min(uly, lry), Math.abs(ulx - lrx), Math.abs(uly - lry));
+//				if(request.intersects(r)) {
+//					list.add(new Tile(tileWidth, tileHeight, row, col, ulx, uly, lrx, lry));
+//				}
+//				j ++;
+//			}
+//			i ++;
+//		}
+    	
+    	return list;
+    }
+	
+    
+    /**
+     * This function will check if the request coordinates intersects with the tiles in the matrix. If a tile
+     * intersects then this will be added to the list.  
+     */
+	public List<WMTSTile> contains(boolean projected, Point2D point, Rectangle2D extentLayer) {
+		double widthMtsTile = getWidthWCTile(projected); //getWidthMtsTile(projected);
+    	double heightMtsTile = getHeightWCTile(projected); //getHeightMtsTile(projected);
+
+		double ulx, uly, lrx, lry;
+		List<WMTSTile> list = new ArrayList<WMTSTile>();
+    	Rectangle2D r = new Rectangle2D.Double(0, 0, 0, 0);
+
+    	//Recorre la matriz de tiles calculando las coordenadas de cada tile
+    	//Para cada tile comprueba si intersecta con el �rea seleccionada si es as�
+    	//mete el tile en la lista para devolverlo como resultado
+    	
+    	int i = 0, j = 0;
+    	double initX = topLeftCorner[1];
+    	double initY = topLeftCorner[0];
+    	
+    	//cambiar esto por un conversor entre coordenadas pixel y reales
+    	for (int row = 0; row < matrixHeight; row++) {
+    		uly = initY - (heightMtsTile * i);
+			lry = uly - heightMtsTile;
+			j = 0;
+			for (int col = 0; col < matrixWidth; col++) {
+				ulx = initX + (widthMtsTile * j);
+				lrx = ulx + widthMtsTile;
+				r.setRect(Math.min(ulx, lrx), Math.min(uly, lry), Math.abs(ulx - lrx), Math.abs(uly - lry));
+				if(r.contains(point)) {
+					list.add(new WMTSTileImpl(tileWidth, tileHeight, row, col, ulx, uly, lrx, lry));
+				}
+				j ++;
+			}
+			i ++;
+		}
+    	
+    	return list;
+    }
+    
+    /**
+     * This function will check if the request coordinates intersects with the tiles in the matrix. If a tile
+     * intersects then this will be added to the list.  
+     */
+	public List<WMTSTile> contains(boolean projected, WMTSTileMatrixLimits tileMatrixLimits, Point2D point, Rectangle2D extentLayer) {
+		double widthMtsTile = getWidthWCTile(projected);
+    	double heightMtsTile = getHeightWCTile(projected);
+
+		double ulx, uly, lrx, lry;
+		List<WMTSTile> list = new ArrayList<WMTSTile>();
+    	Rectangle2D r = new Rectangle2D.Double(0, 0, 0, 0);
+
+    	//Recorre la matriz de tiles calculando las coordenadas de cada tile
+    	//Para cada tile comprueba si intersecta con el �rea seleccionada si es as�
+    	//mete el tile en la lista para devolverlo como resultado
+    	
+    	//cambiar esto por un conversor entre coordenadas pixel y reales
+    	
+    	int i = 0, j = 0;
+    	double initX = topLeftCorner[1] + (widthMtsTile * tileMatrixLimits.getMinTileCol());
+    	double initY = topLeftCorner[0] - (heightMtsTile * (tileMatrixLimits.getMinTileRow()));
+    	
+    	for (int row = tileMatrixLimits.getMinTileRow(); row <= tileMatrixLimits.getMaxTileRow(); row++) {
+    		uly = initY - (heightMtsTile * i);
+			lry = uly - heightMtsTile;
+			j = 0;
+			for (int col = tileMatrixLimits.getMinTileCol(); col <= tileMatrixLimits.getMaxTileCol(); col++) {
+				ulx = initX + (widthMtsTile * j);
+				lrx = ulx + widthMtsTile;
+				r.setRect(Math.min(ulx, lrx), Math.min(uly, lry), Math.abs(ulx - lrx), Math.abs(uly - lry));
+				if(r.contains(point)) {
+					list.add(new WMTSTileImpl(tileWidth, tileHeight, row, col, ulx, uly, lrx, lry));
+				}
+				j ++;
+			}
+			i ++;
+		}
+    	
+    	return list;
+    }
+	
+	public void print() {
+		System.out.println("   *****WMTSTileMatrix******");
+		System.out.println("   scaleDenominator:" + getScaleDenominator());
+		if(topLeftCorner != null)
+			System.out.println("   topLeftCorner:" + topLeftCorner[0] + ", " + topLeftCorner[1]);
+		System.out.println("   tileWidth:" + getTileWidth());
+		System.out.println("   tileHeight:" + getTileHeight());
+		System.out.println("   matrixWidth:" + getMatrixWidth());
+		System.out.println("   matrixHeight:" + getMatrixHeight());
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSOperationsMetadataImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSOperationsMetadataImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSOperationsMetadataImpl.java	(revision 6892)
@@ -0,0 +1,132 @@
+/* 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.ogc.impl.struct;
+
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSOperation;
+import org.gvsig.raster.wmts.ogc.struct.WMTSOperationsMetadata;
+
+
+
+/**
+ * Metadata about the operations specified by this service and
+ * implemented by the current server, including the URLs for operation request. 
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSOperationsMetadataImpl extends WMTSBaseStruct implements WMTSOperationsMetadata {
+	public String online_resource = null;
+	protected HashMap<String, WMTSOperation> operationsGet = new HashMap<String, WMTSOperation>();
+	protected HashMap<String, WMTSOperation> operationsPost = new HashMap<String, WMTSOperation>();
+
+	/**
+	 * @return Returns the online_resource.
+	 */
+	public String getOnline_resource() {
+		return online_resource;
+	}
+
+	public WMTSOperation createOperation(String name) {
+		return new WMTSOperation(name); 
+	}
+
+	public WMTSOperation createOperation(String name, String onlineResource) {
+		return new WMTSOperation(name, onlineResource);
+	}	
+
+	/**
+	 * Add a new supported operation
+	 * @param operation
+	 * The operation to support
+	 * @param protocol
+	 * The HTTP protocol (Get or Post)
+	 */
+	public void addOperation(String operation, int protocol) {
+		if (protocol == Tags.PROTOCOL_GET) {
+			operationsGet.put(operation, createOperation(operation));			
+		} else if (protocol == Tags.PROTOCOL_POST) {
+			operationsPost.put(operation, createOperation(operation));
+		}
+	}
+
+	/**
+	 * Add a new supported operation
+	 * @param operation
+	 * The operation to support
+	 * @param protocol
+	 * The HTTP protocol (Get or Post)
+	 * @param onlineResource
+	 * The online resource
+	 */
+	public void addOperation(String operation, int protocol, String onlineResource) {
+		if (protocol == Tags.PROTOCOL_GET) {
+			operationsGet.put(operation, createOperation(operation, onlineResource));
+		}else if (protocol == Tags.PROTOCOL_POST){
+			operationsPost.put(operation, createOperation(operation, onlineResource));
+		}
+	}
+
+	public String getOnlineResource(String operation, int protocol) {
+		WMTSOperation op = null;
+		if (protocol == Tags.PROTOCOL_GET) {
+			op = (WMTSOperation)operationsGet.get(operation);
+		} else if (protocol == Tags.PROTOCOL_POST) {
+			op = (WMTSOperation)operationsPost.get(operation);
+		}
+		if ((op == null) ||
+				(op.getOnlineResource() == null) || 
+				(op.getOnlineResource().equals(""))) {
+			return null;
+		}
+		return op.getOnlineResource();
+	}
+
+	public String getOnlineResource(String operation) {
+		return getOnlineResource(operation, Tags.PROTOCOL_GET);
+	}
+
+	public Hashtable<String, String> getSupportedOperationsByName() {
+		Hashtable<String, String> operations = new Hashtable<String, String>();
+		Iterator<String> getIt = operationsGet.keySet().iterator();
+		while (getIt.hasNext()) {
+			String id = (String)getIt.next();
+			WMTSOperation operation = (WMTSOperation)operationsGet.get(id);
+			operations.put(operation.getOperationName(),
+					operation.getOnlineResource());
+		}
+		return operations;
+	}
+
+	public boolean isOperationSupported(String operationName) {
+		if (operationsGet.containsKey(operationName)) {
+			return true;
+		}
+		if (operationsPost.containsKey(operationName)) {
+			return true;
+		}
+		return false;
+	}	
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSOperationsMetadataImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSDimensionImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSDimensionImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSDimensionImpl.java	(revision 6892)
@@ -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.ogc.impl.struct;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSDimension;
+
+
+/**
+ * Dimension 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSDimensionImpl extends WMTSBaseStruct implements WMTSDimension {
+	private String          unitSymbol               = null;
+	private String          defaultValue             = null;
+	private boolean         current                  = false;
+	private List<String>    availableValues          = null;
+	private String          uom                      = null;
+	
+	public String getUnitSymbol() {
+		return unitSymbol;
+	}
+	
+	public void setUnitSymbol(String unitSymbol) {
+		this.unitSymbol = unitSymbol;
+	}
+	
+	public String getDefaultValue() {
+		return defaultValue;
+	}
+	
+	public void setDefaultValue(String defaultValue) {
+		this.defaultValue = defaultValue;
+	}
+	
+	public boolean isCurrent() {
+		return current;
+	}
+	
+	public void setCurrent(boolean current) {
+		this.current = current;
+	}
+	
+	public List<String> getValueList() {
+		if(availableValues == null)
+			availableValues = new ArrayList<String>(); 
+		return availableValues;
+	}
+	
+	public void addAvailableValue(String value) {
+		getValueList().add(value);
+	}
+	
+	public String getUOM() {
+		return uom;
+	}
+	
+	public void setUOM(String uom) {
+		this.uom = uom;
+	}
+	
+	public void print() {
+		System.out.println("*****WMTSDimension******");
+		System.out.println("UnitSymbol:" + getUnitSymbol());
+		System.out.println("DefaultValue:" + getDefaultValue());
+		System.out.println("Current:" + isCurrent());
+		for (int i = 0; i < getValueList().size(); i++) {
+			System.out.println("DimensionAvailable:" + getValueList().get(i));			
+		}
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSDimensionImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSThemesImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSThemesImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSThemesImpl.java	(revision 6892)
@@ -0,0 +1,143 @@
+/* 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.ogc.impl.struct;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.impl.base.WMTSServerDescription;
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTheme;
+import org.gvsig.raster.wmts.ogc.struct.WMTSThemes;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Layer hierarchy
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSThemesImpl extends ArrayList<WMTSThemeImpl> implements WMTSThemes {
+	private static final long serialVersionUID = 1L;
+	
+    /**
+     * Parses this service ID
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public abstract void parse(KXmlParser parser) throws IOException, XmlPullParserException; 
+    
+    public boolean hasThemes() {
+    	return size() > 0;
+    }
+    
+	/**
+	 * Assign the layer associated
+	 * @param layers
+	 */
+	public void calculateLayers(List<WMTSLayer> layers) {
+		for (int i = 0; i < size(); i++) {
+			((WMTSThemeImpl)get(i)).calculateLayers(layers);
+		}
+	}
+	
+	/**
+	 * Loads this list of themes with the layer information
+	 * @param layers
+	 */
+	public void loadThemesWithLayerInfo(List<WMTSLayer> layers, WMTSServerDescription status) {
+		if(size() == 0) {
+			for (int i = 0; i < layers.size(); i++) {
+				WMTSThemeImpl theme = (WMTSThemeImpl)status.createVersionObject("WMTSTheme");
+				WMTSLayerImpl layer = (WMTSLayerImpl)layers.get(i);
+				theme.setTitle(layer.getTitle());
+				theme.setLayer(layer);
+				theme.setAbstract(layer.getAbstract());
+				add(theme);
+			}
+		}
+	}
+	
+	/**
+	 * Gets a node by its name
+	 * @param name
+	 * @return
+	 */
+	public WMTSTheme getNodeByName(String name) {
+		WMTSTheme result = null;
+		
+		for (int i = 0; i < size(); i++) {
+			WMTSThemeImpl theme = ((WMTSThemeImpl)get(i));
+			String title = theme.getTitle();
+			if(title.compareTo(name) == 0)
+				result = ((WMTSThemeImpl)get(i));
+			else 
+				result = theme.getNodeByName(name);
+			if(result != null)
+				return result;
+		}
+		return null;
+	}
+	
+	/**
+	 * Gets the number of nodes
+	 * @param parent
+	 * @return
+	 */
+	public int getChildCount() {
+		/*int acum = 0;
+		for (int i = 0; i < size(); i++) {
+			acum += 1 + ((WMTSTheme)get(i)).getChildCount();
+		}
+		return acum;
+		*/
+		return size();
+	}
+	
+	/**
+	 * Gets the children of the index position
+	 * @param index
+	 * @return
+	 */
+	public WMTSThemeImpl getChildren(int index) {
+		return (WMTSThemeImpl)get(index);	
+	}
+	
+	/**
+	 * Gets the index of a children
+	 * @param parent
+	 * @param child
+	 * @return
+	 */
+	public int getIndexOfChild(WMTSTheme child) {
+		for (int i = 0; i < size(); i++)
+			if (child == getChildren(i)) 
+				return i;
+		return -1;
+	}
+	
+	public String toString() {
+		return "Base";
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSThemesImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSBaseStruct.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSBaseStruct.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSBaseStruct.java	(revision 6892)
@@ -0,0 +1,98 @@
+/* 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.ogc.impl.struct;
+
+import java.io.IOException;
+
+import org.gvsig.raster.wmts.ogc.impl.Tags;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Base class for WMTS structures
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSBaseStruct {
+	public  static String        gmlTag              = Tags.WMTS_GMLTAG;
+	private String               identifier          = null;
+	private String               title               = null;
+    private String               abstractObj         = null;
+    
+    /**
+     * Parses this service ID
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+    public abstract void parse(KXmlParser parser) throws IOException, XmlPullParserException; 
+    
+    
+    public String getIdentifier() {
+		return identifier;
+	}
+
+	public void setIdentifier(String identifier) {
+		this.identifier = identifier;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getAbstract() {
+		return abstractObj;
+	}
+
+	public void setAbstract(String abstr) {
+		this.abstractObj = abstr;
+	}
+
+    /**
+     * Compares the next name in the selected parser with the string passed
+     * by value.
+     * @param parser
+     * @param name
+     * @return
+     */
+    public boolean compareName(KXmlParser parser, String name) {
+    	String s = parser.getName();
+    	if(s.compareTo(name) == 0 || s.compareTo(gmlTag + name) == 0)
+    		return true;
+    	return false;
+    }
+    
+    /**
+     * Gets the next text from the parser if this exists
+     * @param parser
+     * @return
+     * @throws XmlPullParserException
+     * @throws IOException
+     */
+    public String nextText(KXmlParser parser) throws XmlPullParserException, IOException {
+    	return !parser.isEmptyElementTag() ? parser.nextText() : "";
+    }
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSBaseStruct.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileImpl.java	(revision 6892)
@@ -0,0 +1,101 @@
+package org.gvsig.raster.wmts.ogc.impl.struct;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.io.File;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
+
+public class WMTSTileImpl implements WMTSTile {
+	public int       wPx, hPx;
+	public int       row, col;
+	public double    ulx, uly, lrx, lry;
+	public File      file;
+	
+	public WMTSTileImpl(int[] size, int[] position, double[] coords) {
+		this.row = position[0];
+		this.col = position[1];
+		this.ulx = coords[0];
+		this.uly = coords[1];
+		this.lrx = coords[2];
+		this.lry = coords[3];
+		this.wPx = size[0];
+		this.hPx = size[1];
+	}
+
+	public WMTSTileImpl(int wPx, int hPx, int row, int col, double ulx, double uly, double lrx, double lry) {
+		this.row = row;
+		this.col = col;
+		this.ulx = ulx;
+		this.uly = uly;
+		this.lrx = lrx;
+		this.lry = lry;
+		this.wPx = wPx;
+		this.hPx = hPx;
+	}
+	
+	public double getULX() {
+		return ulx;
+	}
+	
+	public double getULY() {
+		return uly;	
+	}
+	
+	public double getLRX() {
+		return lrx;
+	}
+	
+	public double getLRY() {
+		return lry;
+	}
+	
+	public int getWidthPx() {
+		return wPx;
+	}
+	
+	public int getHeightPx() {
+		return hPx;
+	}
+	
+	public int getRow() {
+		return row;
+	}
+	
+	public int getCol() {
+		return col;
+	}
+	
+	public void setFile(File file) {
+		this.file = file;
+	}
+	
+	public File getFile() {
+		return file;
+	}
+	 
+	/**
+	 * 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();
+		double psX = (lrx - ulx) / wPx;
+		double psY = (lry - uly) / hPx;
+		AffineTransform t = new AffineTransform(psX, 0, 0, psY, ulx - (psX / 2), uly + (psY / 2));
+		try {
+			t.inverseTransform(pt, p);
+		} catch (NoninvertibleTransformException e) {
+			return pt;
+		}
+		return p;
+	}
+	
+	public WMTSTile cloneTile() {
+		WMTSTileImpl status = new WMTSTileImpl(wPx, hPx, row, col, ulx, uly, lrx, lry);
+		status.file = file;
+		return status;
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixSetImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixSetImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixSetImpl.java	(revision 6892)
@@ -0,0 +1,117 @@
+/* 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.ogc.impl.struct;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrix;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixSet;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+
+/**
+ * <p>Defines a OGC style. Theme that describes the appeareance of certain layer.</p>
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSTileMatrixSetImpl extends WMTSBaseStruct implements WMTSTileMatrixSet {
+    protected WMTSBoundingBoxImpl        bbox                         = null;
+    private String                       supportedCRS                 = null;
+    private String                       wellKnownScaleSet            = null;
+    protected List<WMTSTileMatrix>       tileMatrix                   = null;
+    protected boolean                    forceChangeAxisOrder         = false;
+	
+    /**
+	 * Force to change the axis order read from the capabilities
+	 * @param force
+	 */
+	public void setForceChangeAxisOrder(boolean force) {
+		this.forceChangeAxisOrder = force;
+	}
+	
+    /**
+     * Parses this service ID
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+	public abstract void parse(KXmlParser parser, List<WMTSTileMatrixSet> list) throws IOException, XmlPullParserException; 
+    
+	public void setLayerBBox(WMTSBoundingBoxImpl bbox) {
+		if(bbox != null) {
+			this.bbox = bbox;
+			for (int i = 0; i < getTileMatrix().size(); i++) {
+				((WMTSTileMatrixImpl)getTileMatrix().get(i)).setBBoxTileMatrixSet(bbox.toRectangle2D());
+			}
+		}
+	}
+    
+    public abstract WMTSBoundingBoxImpl getBoundingBox();
+    
+	public String getWellKnownScaleSet() {
+		return wellKnownScaleSet;
+	}
+
+	public void setWellKnownScaleSet(String wellKnownScaleSet) {
+		this.wellKnownScaleSet = wellKnownScaleSet;
+	}
+	
+	public List<WMTSTileMatrix> getTileMatrix() {
+		if(tileMatrix == null)
+			tileMatrix = new ArrayList<WMTSTileMatrix>();
+		return tileMatrix;
+	}
+
+	public String getSupportedCRS() {
+		//if(supportedCRS.compareTo("CRS:84") == 0)
+			//supportedCRS = "EPSG:4326";
+		if(supportedCRS.contains("900913"))
+			supportedCRS = "EPSG:3857";
+		return supportedCRS;
+	}
+
+	public void setSupportedCRS(String supportedCRS) {
+		//if(supportedCRS.compareTo("CRS:84") == 0)
+			//supportedCRS = "EPSG:4326";
+		if(supportedCRS.contains("900913"))
+			supportedCRS = "EPSG:3857";
+		this.supportedCRS = supportedCRS;
+	}
+	
+	public void parse(KXmlParser parser) throws IOException,
+			XmlPullParserException {
+	}
+	
+	public void print() {
+		System.out.println("*****WMTSTileMatrixSet******");
+		if(bbox != null)
+			bbox.print();
+		System.out.println("supportedCRS:" + getSupportedCRS());
+		System.out.println("wellKnownScaleSet:" + getWellKnownScaleSet());
+		for (int i = 0; i < tileMatrix.size(); i++) {
+			((WMTSTileMatrixImpl)tileMatrix.get(i)).print();	
+		}
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixSetImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSStyleImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSStyleImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSStyleImpl.java	(revision 6892)
@@ -0,0 +1,48 @@
+/* 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.ogc.impl.struct;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSLegendURL;
+import org.gvsig.raster.wmts.ogc.struct.WMTSStyle;
+
+/**
+ * <p>Defines a OGC style. Theme that describes the appeareance of certain layer.</p>
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSStyleImpl extends WMTSBaseStruct implements WMTSStyle {
+    protected WMTSLegendURLImpl   legendURL     = null;
+    private boolean           isDefault     = false;
+
+	public abstract WMTSLegendURL getLegendURL();
+
+	public boolean isDefault() {
+		return isDefault;
+	}
+
+	public void setDefault(boolean isDefault) {
+		this.isDefault = isDefault;
+	}
+	
+	public String toString() {
+		return getTitle();
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSStyleImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSThemeImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSThemeImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSThemeImpl.java	(revision 6892)
@@ -0,0 +1,155 @@
+/* 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.ogc.impl.struct;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSLayer;
+import org.gvsig.raster.wmts.ogc.struct.WMTSTheme;
+
+/**
+ * Layer hierarchy
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSThemeImpl extends WMTSBaseStruct implements WMTSTheme {
+	private List<WMTSTheme>        theme      = null;
+	private List<String>           layerRef   = null;
+	private WMTSLayerImpl          layer      = null; 
+	
+	public void setLayer(WMTSLayerImpl layer) {
+		this.layer = layer;
+	}
+	
+	public WMTSLayer getLayer() {
+		return layer;
+	}
+	
+	public List<WMTSTheme> getThemeList() {
+		if(theme == null)
+			theme = new ArrayList<WMTSTheme>();
+		return theme;
+	}
+	
+	public List<String> getLayerRef() {
+		if(layerRef == null)
+			layerRef = new ArrayList<String>();
+		return layerRef;
+	}
+	
+	/**
+	 * Assign the layer associated
+	 * @param layers
+	 */
+	public void calculateLayers(List<WMTSLayer> layers) {
+		if(theme != null && theme.size() > 0) {
+			for (int i = 0; i < theme.size(); i++) {
+				((WMTSThemeImpl)theme.get(i)).calculateLayers(layers);
+			}
+		}
+			
+		if(layerRef != null && layerRef.size() > 0) {
+			for (int i = 0; i < layers.size(); i++) {
+				WMTSLayerImpl tmpLayer = (WMTSLayerImpl)layers.get(i);
+				for (int j = 0; j < layerRef.size(); j++) {
+					String layerRef_I = (String)layerRef.get(j);
+					if(tmpLayer.getTitle().compareTo(layerRef_I) == 0) {
+						layer = tmpLayer;
+					}
+				}
+			}
+		}
+	}
+	
+	/**
+	 * Gets a node by its name
+	 * @param name
+	 * @return
+	 */
+	public WMTSTheme getNodeByName(String name) {
+		WMTSTheme result = null;
+		if(theme == null)
+			return null;
+		
+		for (int i = 0; i < theme.size(); i++) {
+			WMTSThemeImpl t = ((WMTSThemeImpl)(theme.get(i)));
+			String title = t.getTitle();
+			
+			if(title.compareTo(name) == 0)
+				result = t;
+			else 
+				result = t.getNodeByName(name);
+			
+			if(result != null)
+				return result;
+		}
+		
+		return null;
+	}
+	
+	/**
+	 * Gets the number of nodes
+	 * @param parent
+	 * @return
+	 */
+	public int getChildCount() {
+		if(theme == null || theme.size() == 0)
+			return 0;
+		else {
+			int acum = 0;
+			for (int i = 0; i < theme.size(); i++) {
+				acum += 1 + ((WMTSThemeImpl)theme.get(i)).getChildCount();
+			}
+			return acum;
+		}
+	}
+	
+	/**
+	 * Gets the children of the index position
+	 * @param index
+	 * @return
+	 */
+	public WMTSTheme getChildren(int index) {
+		if(theme != null)
+			return theme.get(index);	
+		return null;
+	}
+	
+	/**
+	 * Gets the index of a children
+	 * @param parent
+	 * @param child
+	 * @return
+	 */
+	public int getIndexOfChild(WMTSTheme child) {
+		if(theme != null) {
+			for (int i = 0; i < theme.size(); i++)
+				if (child == getChildren(i)) 
+					return i;
+		}
+		return -1;
+	}
+	
+	public String toString() {
+		return this.getTitle();
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSThemeImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixLimitsImpl.java
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixLimitsImpl.java	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixLimitsImpl.java	(revision 6892)
@@ -0,0 +1,111 @@
+/* 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.ogc.impl.struct;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.gvsig.raster.wmts.ogc.struct.WMTSTileMatrixLimits;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+
+/**
+ * Limits of a tile
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class WMTSTileMatrixLimitsImpl implements WMTSTileMatrixLimits {
+	private String                 refToTileMatrix      = null;
+	private WMTSTileMatrixImpl     tileMatrix           = null;
+	private int                    minTileRow           = 0;
+	private int                    maxTileRow           = 0;
+	private int                    minTileCol           = 0;
+	private int                    maxTileCol           = 0;
+	
+	/**
+     * Parses this service
+     * @param parser
+     * @param content
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
+	public abstract void parse(KXmlParser parser, List<WMTSTileMatrixLimits> list) throws IOException, XmlPullParserException; 
+	
+	public WMTSTileMatrixImpl getTileMatrix() {
+		return tileMatrix;
+	}
+	
+	public void setTileMatrix(WMTSTileMatrixImpl tileMatrix) {
+		this.tileMatrix = tileMatrix;
+	}
+	
+	public String getRefToTileMatrix() {
+		return refToTileMatrix;
+	}
+	
+	public void setRefToTileMatrix(String refToTileMatrix) {
+		this.refToTileMatrix = refToTileMatrix;
+	}
+	
+	public int getMinTileRow() {
+		return minTileRow - 1;
+	}
+	
+	public void setMinTileRow(int minTileRow) {
+		this.minTileRow = minTileRow;
+	}
+	
+	public int getMaxTileRow() {
+		return maxTileRow - 1;
+	}
+	
+	public void setMaxTileRow(int maxTileRow) {
+		this.maxTileRow = maxTileRow;
+	}
+	
+	public int getMinTileCol() {
+		return minTileCol;
+	}
+	
+	public void setMinTileCol(int minTileCol) {
+		this.minTileCol = minTileCol;
+	}
+	
+	public int getMaxTileCol() {
+		return maxTileCol;
+	}
+	
+	public void setMaxTileCol(int maxTileCol) {
+		this.maxTileCol = maxTileCol;
+	}
+	
+	public void print() {
+		System.out.println("  *****WMTSTileMatrixLimits******");
+		System.out.println("  MaxTileCol:" + getMaxTileCol());
+		System.out.println("  MaxTileRow:" + getMaxTileRow());
+		System.out.println("  MinTileCol:" + getMinTileCol());
+		System.out.println("  MinTileRow:" + getMinTileRow());
+		System.out.println("  Reference:" + getRefToTileMatrix());
+		if(tileMatrix != null)
+			tileMatrix.print();
+	}
+}

Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/java/org/gvsig/raster/wmts/ogc/impl/struct/WMTSTileMatrixLimitsImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/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/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 6892)
@@ -0,0 +1 @@
+org.gvsig.raster.wmts.ogc.impl.WMTSOGCDefaultImplLibrary
\ No newline at end of file
Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl/pom.xml	(revision 6892)
@@ -0,0 +1,87 @@
+<?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.2.43</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>
+		</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>
+        
+        
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.operation</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.impl</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    <!--
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry.operation</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+    -->
+	</dependencies>
+</project>

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


Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc/org.gvsig.raster.wmts.ogc.impl
___________________________________________________________________
Added: svn:ignore
   + .settings

target

.project

.classpath



Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/org.gvsig.raster.wmts.ogc
___________________________________________________________________
Added: svn:ignore
   + .project
.settings


Index: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/pom.xml
===================================================================
--- org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/pom.xml	(revision 0)
+++ org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43/pom.xml	(revision 6892)
@@ -0,0 +1,122 @@
+<?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.2.43</version>
+    <name>${project.artifactId}</name>
+    <description>WMTS client</description>
+    <inceptionYear>2011</inceptionYear>
+	
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.desktop</artifactId>
+        <version>2.0.180</version>
+    </parent>
+
+        <properties>
+            <!-- El plugin versions:use-latest-versions falla con scope import -->
+            <!-- asi que toca usar el versions:update-properties que si que funciona -->
+            <org.gvsig.raster.version>2.2.60</org.gvsig.raster.version>
+        </properties>
+    
+    <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>
+    
+    <scm>
+        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43</connection>
+        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43</developerConnection>
+        <url>https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43</url>
+    </scm>
+    
+    <dependencyManagement>
+        <dependencies>
+                        <dependency>
+                                <groupId>org.gvsig</groupId>
+                                <artifactId>org.gvsig.raster</artifactId>
+                                <version>${org.gvsig.raster.version}</version>
+                                <type>pom</type>
+                                <scope>import</scope>
+                        </dependency>
+
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.wmts.swing.api</artifactId>
+                <version>2.2.43</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.wmts.swing.impl</artifactId>
+                <version>2.2.43</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.wmts.ogc.api</artifactId>
+                <version>2.2.43</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.wmts.ogc.impl</artifactId>
+                <version>2.2.43</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.wmts.app.wmtsclient</artifactId>
+                <version>2.2.43</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.wmts.io</artifactId>
+                <version>2.2.43</version>
+            </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>
+	
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-release-plugin</artifactId>
+                <configuration>
+                    <tagBase>https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.wmts/tags/</tagBase>
+                    <goals>deploy</goals>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+    <modules>
+        <module>org.gvsig.raster.wmts.swing</module>
+        <module>org.gvsig.raster.wmts.io</module>
+        <module>org.gvsig.raster.wmts.app.wmtsclient</module>
+        <module>org.gvsig.raster.wmts.ogc</module>
+    </modules>
+</project>

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


Property changes on: org.gvsig.raster.wmts/tags/org.gvsig.raster.wmts-2.2.43
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.pom.xml.swp


